[PATCH] [PATCH v7] USB hub_probe: rework ugly goto-into-compound-statement

2017-06-25 Thread Eugene Korenevsky
Rework smelling code (goto inside compound statement). Perhaps this is legacy. Anyway such code is not appropriate for Linux kernel. Signed-off-by: Eugene Korenevsky --- Changes in v7: rename hub_check_descriptor_sanity -> hub_descriptor_is_sane Changes in v6: more pedantic conversion from `

[PATCH v6] USB hub_probe: rework ugly goto-into-compound-statement

2016-11-18 Thread Eugene Korenevsky
Rework smelling code (goto inside compound statement). Perhaps this is legacy. Anyway such code is not appropriate for Linux kernel. Signed-off-by: Eugene Korenevsky --- Changes in v6: more pedantic conversion from `int` to `bool`; fix comment Changes in v5: make `bool` a return type of

Re: [PATCH v5] USB hub_probe: rework ugly goto-into-compound-statement

2016-11-18 Thread Eugene Korenevsky
> Ok, I'm going to be really pedantic here and ask that you spell this > last statement out: >if (usb...) > return true; >return false; > > Also, the comment should say: > /* If the first endpoint is not interrupt IN, we... */ > It's better to inverse the

[PATCH v5] USB hub_probe: rework ugly goto-into-compound-statement

2016-11-13 Thread Eugene Korenevsky
Rework smelling code (goto inside compound statement). Perhaps this is legacy. Anyway such code is not appropriate for Linux kernel. Signed-off-by: Eugene Korenevsky --- Changes in v5: make `bool` a return type of `hub_check_descriptor_sanity()` Changes in v4: fix typo Changes in v3: extract the

[PATCH v4] USB hub_probe: rework ugly goto-into-compound-statement

2016-11-09 Thread Eugene Korenevsky
7; Signed-off-by: Eugene Korenevsky --- drivers/usb/core/hub.c | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index cbb1467..b770c8d 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/

[PATCH v3] USB hub_probe: rework ugly goto-into-compound-statement

2016-11-08 Thread Eugene Korenevsky
Rework smelling code (goto inside compound statement). Perhaps this is legacy. Anyway such code is not appropriate for Linux kernel. Changes since v2: extract the code to static function Changes since v1: fix spaces instead of tab, add missing 'Signed-off-by' Signed-off-by: Eugene

[PATCH v3 2/2] USB hub_probe: put initialization before usage

2016-11-07 Thread Eugene Korenevsky
Minor optimization: move initialization immediately before usage. This gives a chance for more accurate register allocation by the compiler. Signed-off-by: Eugene Korenevsky --- drivers/usb/core/hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/hub.c b

[PATCH v3 1/2] USB hub_probe: rework ugly goto-into-compound-statement

2016-11-07 Thread Eugene Korenevsky
Rework smelling code (goto inside compound statement). Perhaps this is legacy. Anyway such code is not appropriate for Linux kernel. Signed-off-by: Eugene Korenevsky --- drivers/usb/core/hub.c | 33 - 1 file changed, 16 insertions(+), 17 deletions(-) diff --git

Re: [PATCH v2] USB hub_probe: remove ugly goto-into-compound-statement

2016-11-07 Thread Eugene Korenevsky
On Mon, Nov 07, 2016 at 10:09:17AM +0100, Greg Kroah-Hartman wrote: > > Rework smelling code (goto inside compound statement). Perhaps this is > > legacy. > > Anyway such code is not appropriate for Linux kernel. > > > > Signed-off-by: Eugene Korenevsky > >

[PATCH v2] USB hub_probe: remove ugly goto-into-compound-statement

2016-11-02 Thread Eugene Korenevsky
Rework smelling code (goto inside compound statement). Perhaps this is legacy. Anyway such code is not appropriate for Linux kernel. Signed-off-by: Eugene Korenevsky --- drivers/usb/core/hub.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers

[PATCH] USB hub_probe: refactor ugly goto-into-compound-statement

2016-11-02 Thread Eugene Korenevsky
Rework smelling code (goto inside compound statement). Perhaps this is legacy. Anyway such code is not appropriate for Linux kernel. --- drivers/usb/core/hub.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/