aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-hub.c
diff options
context:
space:
mode:
authorDavid Daney <ddaney@caviumnetworks.com>2011-01-25 12:59:37 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-04 14:43:59 -0500
commitac8d67417816fa7c568b24a8f2891eb02e6d0462 (patch)
tree77ca466e0dc5bc7466292cc16292649132c82bf0 /drivers/usb/host/ehci-hub.c
parenteb34a90861a290cd271f4b887c0d59070e1b69b0 (diff)
USB: EHCI: Rearrange create_companion_file() to avoid GCC-4.6 warnings.
In create_companion_file() there is a bogus assignemt to i created for the express purpose of avoiding an ignored return value warning. With pre-release GCC-4.6, this causes a 'set but not used' warning. Kick the problem further down the road by just returning i. All the callers of create_companion_file() ignore its return value, so all is good: o No warnings are issued. o We still subvert the desires of the authors of device_create_file() by ignorning error conditions. Signed-off-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ehci-hub.c')
-rw-r--r--drivers/usb/host/ehci-hub.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 796ea0c8900f..5aa6c4947325 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -531,14 +531,15 @@ static ssize_t store_companion(struct device *dev,
531} 531}
532static DEVICE_ATTR(companion, 0644, show_companion, store_companion); 532static DEVICE_ATTR(companion, 0644, show_companion, store_companion);
533 533
534static inline void create_companion_file(struct ehci_hcd *ehci) 534static inline int create_companion_file(struct ehci_hcd *ehci)
535{ 535{
536 int i; 536 int i = 0;
537 537
538 /* with integrated TT there is no companion! */ 538 /* with integrated TT there is no companion! */
539 if (!ehci_is_TDI(ehci)) 539 if (!ehci_is_TDI(ehci))
540 i = device_create_file(ehci_to_hcd(ehci)->self.controller, 540 i = device_create_file(ehci_to_hcd(ehci)->self.controller,
541 &dev_attr_companion); 541 &dev_attr_companion);
542 return i;
542} 543}
543 544
544static inline void remove_companion_file(struct ehci_hcd *ehci) 545static inline void remove_companion_file(struct ehci_hcd *ehci)