linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] usb: g_ffs: fix compilation warning
@ 2013-10-04 22:30 David Cohen
  2013-10-04 22:39 ` David Cohen
  2013-10-06 22:02 ` Sergei Shtylyov
  0 siblings, 2 replies; 4+ messages in thread
From: David Cohen @ 2013-10-04 22:30 UTC (permalink / raw)
  To: gregkh, balbi; +Cc: linux-usb, linux-kernel, David Cohen

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>
---
 drivers/usb/gadget/g_ffs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/g_ffs.c b/drivers/usb/gadget/g_ffs.c
index 5327c82..2344efe 100644
--- a/drivers/usb/gadget/g_ffs.c
+++ b/drivers/usb/gadget/g_ffs.c
@@ -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,
-- 
1.8.4.rc3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] usb: g_ffs: fix compilation warning
  2013-10-04 22:30 [PATCH v2] usb: g_ffs: fix compilation warning David Cohen
@ 2013-10-04 22:39 ` David Cohen
  2013-10-06 22:02 ` Sergei Shtylyov
  1 sibling, 0 replies; 4+ messages in thread
From: David Cohen @ 2013-10-04 22:39 UTC (permalink / raw)
  To: David Cohen; +Cc: gregkh, balbi, linux-usb, linux-kernel

Hi Greg,

On 10/04/2013 03:30 PM, David Cohen wrote:
> 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>
> ---
>   drivers/usb/gadget/g_ffs.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/gadget/g_ffs.c b/drivers/usb/gadget/g_ffs.c
> index 5327c82..2344efe 100644
> --- a/drivers/usb/gadget/g_ffs.c
> +++ b/drivers/usb/gadget/g_ffs.c
> @@ -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();

This warning happens on kernel v3.11+
But luckily it has no real effect on kernel despite the warning, so no 
tests would report it.

Br, David Cohen

> +#endif
>
>   static struct usb_device_descriptor gfs_dev_desc = {
>   	.bLength		= sizeof gfs_dev_desc,
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] usb: g_ffs: fix compilation warning
  2013-10-04 22:30 [PATCH v2] usb: g_ffs: fix compilation warning David Cohen
  2013-10-04 22:39 ` David Cohen
@ 2013-10-06 22:02 ` Sergei Shtylyov
  2013-10-07  2:41   ` David Cohen
  1 sibling, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2013-10-06 22:02 UTC (permalink / raw)
  To: David Cohen; +Cc: gregkh, balbi, linux-usb, linux-kernel

Hello.

On 05-10-2013 0:30, David Cohen wrote:

> 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>
> ---
>   drivers/usb/gadget/g_ffs.c | 2 ++
>   1 file changed, 2 insertions(+)

> diff --git a/drivers/usb/gadget/g_ffs.c b/drivers/usb/gadget/g_ffs.c
> index 5327c82..2344efe 100644
> --- a/drivers/usb/gadget/g_ffs.c
> +++ b/drivers/usb/gadget/g_ffs.c
> @@ -76,7 +76,9 @@ struct gfs_ffs_obj {
>
>   USB_GADGET_COMPOSITE_OPTIONS();
>
> +#if defined CONFIG_USB_FUNCTIONFS_ETH || defined CONFIG_USB_FUNCTIONFS_RNDIS

    I thought the 'defined' operator requires ()?

WBR, Sergei


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] usb: g_ffs: fix compilation warning
  2013-10-06 22:02 ` Sergei Shtylyov
@ 2013-10-07  2:41   ` David Cohen
  0 siblings, 0 replies; 4+ messages in thread
From: David Cohen @ 2013-10-07  2:41 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: David Cohen, gregkh, Felipe Balbi, linux-usb, Linux Kernel Mailing List

Hi Sergei,

(replying from my personal e-mail)

On Sun, Oct 6, 2013 at 3:02 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
>
> Hello.
>
> On 05-10-2013 0:30, David Cohen wrote:
>
>> 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>
>> ---
>>   drivers/usb/gadget/g_ffs.c | 2 ++
>>   1 file changed, 2 insertions(+)
>
>
>> diff --git a/drivers/usb/gadget/g_ffs.c b/drivers/usb/gadget/g_ffs.c
>> index 5327c82..2344efe 100644
>> --- a/drivers/usb/gadget/g_ffs.c
>> +++ b/drivers/usb/gadget/g_ffs.c
>> @@ -76,7 +76,9 @@ struct gfs_ffs_obj {
>>
>>   USB_GADGET_COMPOSITE_OPTIONS();
>>
>> +#if defined CONFIG_USB_FUNCTIONFS_ETH || defined CONFIG_USB_FUNCTIONFS_RNDIS
>
>
>    I thought the 'defined' operator requires ()?

I though the same. But I copied this line from this same file when
it's deciding whether to include u_ether.h or not.

BR, David Cohen

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-07  2:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-04 22:30 [PATCH v2] usb: g_ffs: fix compilation warning David Cohen
2013-10-04 22:39 ` David Cohen
2013-10-06 22:02 ` Sergei Shtylyov
2013-10-07  2:41   ` David Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).