[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161107185509.GA19018@vnote>
Date: Mon, 7 Nov 2016 21:55:09 +0300
From: Eugene Korenevsky <ekorenevsky@...il.com>
To: linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Luiz Capitulino <lcapitulino@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Chase Metzger <chasemetzger15@...il.com>,
Alan Stern <stern@...land.harvard.edu>,
Mathias Nyman <mathias.nyman@...ux.intel.com>,
Lu Baolu <baolu.lu@...ux.intel.com>,
Oliver Neukum <oneukum@...e.com>, Hans Yang <hansy@...dia.com>
Subject: [PATCH v3 2/2] USB hub_probe: put initialization before usage
Minor optimization: move initialization immediately before usage.
This gives a chance for more accurate register allocation by the compiler.
Signed-off-by: Eugene Korenevsky <ekorenevsky@...il.com>
---
drivers/usb/core/hub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 7a20980..c7f6b5f 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1742,7 +1742,6 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
struct usb_device *hdev;
struct usb_hub *hub;
- desc = intf->cur_altsetting;
hdev = interface_to_usbdev(intf);
/*
@@ -1813,6 +1812,7 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
}
#endif
+ desc = intf->cur_altsetting;
if (!hub_check_descriptor_sanity(desc)) {
dev_err(&intf->dev, "bad descriptor, ignoring hub\n");
return -EIO;
--
2.10.2
Powered by blists - more mailing lists