projects
/
linux-2.6-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a2fd23b
)
usb: core: Move variable initialization to appropriate place
author
Suwan Kim
<suwan.kim027@gmail.com>
Wed, 30 Jan 2019 14:48:28 +0000
(23:48 +0900)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Mon, 4 Feb 2019 11:58:03 +0000
(12:58 +0100)
It is better to initialize the variable 'cfgno' in the for loop than
at the current place.
Signed-off-by: Suwan Kim <suwan.kim027@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/config.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/usb/core/config.c
b/drivers/usb/core/config.c
index 4a0945c04b4c95e64ebd0c2f26861cdf73986e8f..7bb6b1bd06c8a9292bb33872c89d880c7714f732 100644
(file)
--- a/
drivers/usb/core/config.c
+++ b/
drivers/usb/core/config.c
@@
-805,7
+805,6
@@
int usb_get_configuration(struct usb_device *dev)
unsigned char *bigbuffer;
struct usb_config_descriptor *desc;
- cfgno = 0;
if (ncfg > USB_MAXCONFIG) {
dev_warn(ddev, "too many configurations: %d, "
"using maximum allowed: %d\n", ncfg, USB_MAXCONFIG);
@@
-831,7
+830,7
@@
int usb_get_configuration(struct usb_device *dev)
if (!desc)
goto err2;
- for (; cfgno < ncfg; cfgno++) {
+ for (
cfgno = 0
; cfgno < ncfg; cfgno++) {
/* We grab just the first descriptor so we know how long
* the whole configuration is */
result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno,