Re: [PATCH 3/4] usb: host: ehci.h: remove duplicated return
On 12/09/2015 11:15 PM, Geyslan G. Bem wrote: This patch removes the return of the default switch case, since 'ehci_port_speed()' already has the same default return. Signed-off-by: Geyslan G. Bem--- drivers/usb/host/ehci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 0daed80..49b91b6 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -664,8 +664,8 @@ ehci_port_speed(struct ehci_hcd *ehci, unsigned int portsc) case 1: return USB_PORT_STAT_LOW_SPEED; case 2: + /* fall through to default function return */ We just don't need the above *case*. default: - return USB_PORT_STAT_HIGH_SPEED; And n ow we don't need *dafault* too. Case 1 only? If not low_speed, high_speed. So, I'll change it to a simple if branch. There's *case* 0 yet. } } return USB_PORT_STAT_HIGH_SPEED; MBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/4] usb: host: ehci.h: remove duplicated return
Hi Geyslan, [auto build test ERROR on usb/usb-testing] [also build test ERROR on v4.4-rc4 next-20151209] url: https://github.com/0day-ci/linux/commits/Geyslan-G-Bem/usb-host-ehci-h-cleanup-header-file/20151210-040115 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing config: x86_64-randconfig-s0-12100345 (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): In file included from drivers/usb/chipidea/host.c:29:0: drivers/usb/chipidea/../host/ehci.h: In function 'ehci_port_speed': >> drivers/usb/chipidea/../host/ehci.h:668:3: error: label at end of compound >> statement default: ^ vim +668 drivers/usb/chipidea/../host/ehci.h ^1da177e Linus Torvalds 2005-04-16 662 case 0: ^1da177e Linus Torvalds 2005-04-16 663 return 0; ^1da177e Linus Torvalds 2005-04-16 664 case 1: 288ead45 Alan Stern 2010-03-04 665 return USB_PORT_STAT_LOW_SPEED; ^1da177e Linus Torvalds 2005-04-16 666 case 2: 50691528 Geyslan G. Bem 2015-12-09 667 /* fall through to default function return */ ^1da177e Linus Torvalds 2005-04-16 @668 default: ^1da177e Linus Torvalds 2005-04-16 669 } ^1da177e Linus Torvalds 2005-04-16 670 } 288ead45 Alan Stern 2010-03-04 671 return USB_PORT_STAT_HIGH_SPEED; :: The code at line 668 was first introduced by commit :: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2 :: TO: Linus Torvalds:: CC: Linus Torvalds --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data
Re: [PATCH 3/4] usb: host: ehci.h: remove duplicated return
2015-12-09 17:10 GMT-03:00 Sergei Shtylyov: > Hello. > > On 12/09/2015 10:57 PM, Geyslan G. Bem wrote: > >> This patch removes the return of the default switch case, since >> 'ehci_port_speed()' already has the same default return. >> >> Signed-off-by: Geyslan G. Bem >> --- >> drivers/usb/host/ehci.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h >> index 0daed80..49b91b6 100644 >> --- a/drivers/usb/host/ehci.h >> +++ b/drivers/usb/host/ehci.h >> @@ -664,8 +664,8 @@ ehci_port_speed(struct ehci_hcd *ehci, unsigned int >> portsc) >> case 1: >> return USB_PORT_STAT_LOW_SPEED; >> case 2: >> + /* fall through to default function return */ > > >We just don't need the above *case*. > >> default: >> - return USB_PORT_STAT_HIGH_SPEED; > > >And n ow we don't need *dafault* too. Case 1 only? If not low_speed, high_speed. So, I'll change it to a simple if branch. > >> } >> } >> return USB_PORT_STAT_HIGH_SPEED; > > > MBR, Sergei > -- Regards, Geyslan G. Bem hackingbits.com -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/4] usb: host: ehci.h: remove duplicated return
Hi Geyslan, [auto build test ERROR on usb/usb-testing] [also build test ERROR on v4.4-rc4 next-20151209] url: https://github.com/0day-ci/linux/commits/Geyslan-G-Bem/usb-host-ehci-h-cleanup-header-file/20151210-040115 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing config: x86_64-randconfig-s3-12100340 (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): In file included from drivers/usb/host/ehci-hcd.c:109:0: drivers/usb/host/ehci.h: In function 'ehci_port_speed': >> drivers/usb/host/ehci.h:668:3: error: label at end of compound statement default: ^ vim +668 drivers/usb/host/ehci.h ^1da177e Linus Torvalds 2005-04-16 662 case 0: ^1da177e Linus Torvalds 2005-04-16 663 return 0; ^1da177e Linus Torvalds 2005-04-16 664 case 1: 288ead45 Alan Stern 2010-03-04 665 return USB_PORT_STAT_LOW_SPEED; ^1da177e Linus Torvalds 2005-04-16 666 case 2: 50691528 Geyslan G. Bem 2015-12-09 667 /* fall through to default function return */ ^1da177e Linus Torvalds 2005-04-16 @668 default: ^1da177e Linus Torvalds 2005-04-16 669 } ^1da177e Linus Torvalds 2005-04-16 670 } 288ead45 Alan Stern 2010-03-04 671 return USB_PORT_STAT_HIGH_SPEED; :: The code at line 668 was first introduced by commit :: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2 :: TO: Linus Torvalds:: CC: Linus Torvalds --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data
Re: [PATCH 3/4] usb: host: ehci.h: remove duplicated return
2015-12-09 18:24 GMT-03:00 kbuild test robot: > Hi Geyslan, > > [auto build test ERROR on usb/usb-testing] > [also build test ERROR on v4.4-rc4 next-20151209] > > url: > https://github.com/0day-ci/linux/commits/Geyslan-G-Bem/usb-host-ehci-h-cleanup-header-file/20151210-040115 > base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git > usb-testing > config: x86_64-randconfig-s0-12100345 (attached as .config) > reproduce: > # save the attached .config to linux build tree > make ARCH=x86_64 > > All errors (new ones prefixed by >>): > >In file included from drivers/usb/chipidea/host.c:29:0: >drivers/usb/chipidea/../host/ehci.h: In function 'ehci_port_speed': >>> drivers/usb/chipidea/../host/ehci.h:668:3: error: label at end of compound >>> statement > default: Missed the break. Coul be removed too. > ^ > > vim +668 drivers/usb/chipidea/../host/ehci.h > > ^1da177e Linus Torvalds 2005-04-16 662 case 0: > ^1da177e Linus Torvalds 2005-04-16 663 return 0; > ^1da177e Linus Torvalds 2005-04-16 664 case 1: > 288ead45 Alan Stern 2010-03-04 665 return > USB_PORT_STAT_LOW_SPEED; > ^1da177e Linus Torvalds 2005-04-16 666 case 2: > 50691528 Geyslan G. Bem 2015-12-09 667 /* fall through to > default function return */ > ^1da177e Linus Torvalds 2005-04-16 @668 default: > ^1da177e Linus Torvalds 2005-04-16 669 } > ^1da177e Linus Torvalds 2005-04-16 670 } > 288ead45 Alan Stern 2010-03-04 671 return > USB_PORT_STAT_HIGH_SPEED; > > :: The code at line 668 was first introduced by commit > :: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2 > > :: TO: Linus Torvalds > :: CC: Linus Torvalds > > --- > 0-DAY kernel test infrastructureOpen Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation > No, please leave it as-is, it helps to understand what is going on here > easier. Ok. Let it go. :) > thanks, > greg k-h -- Regards, Geyslan G. Bem hackingbits.com -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/4] usb: host: ehci.h: remove duplicated return
Hello. On 12/09/2015 10:57 PM, Geyslan G. Bem wrote: This patch removes the return of the default switch case, since 'ehci_port_speed()' already has the same default return. Signed-off-by: Geyslan G. Bem--- drivers/usb/host/ehci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 0daed80..49b91b6 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -664,8 +664,8 @@ ehci_port_speed(struct ehci_hcd *ehci, unsigned int portsc) case 1: return USB_PORT_STAT_LOW_SPEED; case 2: + /* fall through to default function return */ We just don't need the above *case*. default: - return USB_PORT_STAT_HIGH_SPEED; And n ow we don't need *dafault* too. } } return USB_PORT_STAT_HIGH_SPEED; MBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/4] usb: host: ehci.h: remove duplicated return
This patch removes the return of the default switch case, since 'ehci_port_speed()' already has the same default return. Signed-off-by: Geyslan G. Bem--- drivers/usb/host/ehci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 0daed80..49b91b6 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -664,8 +664,8 @@ ehci_port_speed(struct ehci_hcd *ehci, unsigned int portsc) case 1: return USB_PORT_STAT_LOW_SPEED; case 2: + /* fall through to default function return */ default: - return USB_PORT_STAT_HIGH_SPEED; } } return USB_PORT_STAT_HIGH_SPEED; -- 2.6.3 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html