Skip to content

Commit

Permalink
usb: g_ffs: fix compilation warning
Browse files Browse the repository at this point in the history
If USB_FUNCTIONFS is selected without USB_FUNCTIONFS_ETH and
USB_FUNCTIONFS_RNIS, u_ether.h won't be included and then
USB_ETHERNET_MODULE_PARAMAETERS macro won't be available causing the
following warning compilation:

drivers/usb/gadget/g_ffs.c:81:1: warning: data definition has no type or
storage class [enabled by default]
drivers/usb/gadget/g_ffs.c:81:1: warning: type defaults to ‘int’ in
declaration of ‘USB_ETHERNET_MODULE_PARAMETERS’ [-Wimplicit-int]
drivers/usb/gadget/g_ffs.c:81:1: warning: function declaration isn’t a
prototype [-Wstrict-prototypes]

This patch fixes the warning by making USB_ETHERNET_MODULE_PARAMETERS to
be used iff u_ether.h is included, otherwise it is not needed.

Signed-off-by: David Cohen <david.a.cohen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
David Cohen authored and Greg Kroah-Hartman committed Oct 6, 2013
1 parent 7a32d9b commit e81b1a6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/gadget/g_ffs.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ struct gfs_ffs_obj {

USB_GADGET_COMPOSITE_OPTIONS();

#if defined CONFIG_USB_FUNCTIONFS_ETH || defined CONFIG_USB_FUNCTIONFS_RNDIS
USB_ETHERNET_MODULE_PARAMETERS();
#endif

static struct usb_device_descriptor gfs_dev_desc = {
.bLength = sizeof gfs_dev_desc,
Expand Down

0 comments on commit e81b1a6

Please sign in to comment.