Re: [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header

2 messages, 2 authors, 2013-08-09 · open the first message on its own page

Re: [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header

From: Eric Dumazet <hidden>
Date: 2013-08-09 17:50:36

On Fri, 2013-08-09 at 10:40 -0700, Stephen Hemminger wrote:
On Fri, 9 Aug 2013 14:39:06 -0300
Fabio Estevam [off-list ref] wrote:
quoted
On Fri, Aug 9, 2013 at 2:31 PM, Mark Brown [off-list ref] wrote:
quoted
From: Mark Brown <redacted>

Ensure that the definition of ax88172a_info matches the declaration seen
by users and silence sparse warnings about symbols without declarations
in the global namespace by moving the declaration into the shared header
asix.h.

Signed-off-by: Mark Brown <redacted>
---
 drivers/net/usb/asix.h         | 2 ++
 drivers/net/usb/asix_devices.c | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/asix.h b/drivers/net/usb/asix.h
index 346c032..bdaa12d 100644
--- a/drivers/net/usb/asix.h
+++ b/drivers/net/usb/asix.h
@@ -178,6 +178,8 @@ struct asix_common_private {
        struct asix_rx_fixup_info rx_fixup_info;
 };

+extern const struct driver_info ax88172a_info;
You could drop the 'extern' here.

All other function prototypes in this header file do not use 'extern'.
That is data, not function prototype, so yes extern is needed.

And this kind of contradictions show why extern declarations make sense
in include files, for text or/and data.

Some compiler folk decided 'extern' were not mandatory for code, but its
really adding confusion and endless discussions.



--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header

From: David Miller <davem@davemloft.net>
Date: 2013-08-09 18:04:10

From: Eric Dumazet <redacted>
Date: Fri, 09 Aug 2013 10:50:36 -0700
Some compiler folk decided 'extern' were not mandatory for code, but its
really adding confusion and endless discussions.
I certainly stopped talking about it, you could too :-)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help