提交 1760435d 编写于 作者: S Suwan Kim 提交者: Greg Kroah-Hartman

usb: core: Move variable initialization to appropriate place

It is better to initialize the variable 'cfgno' in the for loop than
at the current place.
Signed-off-by: NSuwan Kim <suwan.kim027@gmail.com>
Acked-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 a2fd23b9
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部