Skip to content

Commit

Permalink
USB: EHCI: Rearrange create_companion_file() to avoid GCC-4.6 warnings.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Daney authored and Greg Kroah-Hartman committed Feb 4, 2011
1 parent eb34a90 commit ac8d674
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/usb/host/ehci-hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,14 +531,15 @@ static ssize_t store_companion(struct device *dev,
}
static DEVICE_ATTR(companion, 0644, show_companion, store_companion);

static inline void create_companion_file(struct ehci_hcd *ehci)
static inline int create_companion_file(struct ehci_hcd *ehci)
{
int i;
int i = 0;

/* with integrated TT there is no companion! */
if (!ehci_is_TDI(ehci))
i = device_create_file(ehci_to_hcd(ehci)->self.controller,
&dev_attr_companion);
return i;
}

static inline void remove_companion_file(struct ehci_hcd *ehci)
Expand Down

0 comments on commit ac8d674

Please sign in to comment.