net: asix: Staticise non-exported symbols
Subsystems (3)
PATCH 1/2 net: asix: Staticise non-exported symbols
From: Mark Brown <[email protected]>
Make functions that are only referenced from ops structures static, they do not need to be in the global namespace and sparse complains about this.
--- drivers/net/usb/ax88172a.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/usb/ax88172a.c +5 -3
@@ -161,7 +161,8 @@ static const struct net_device_ops ax88172a_netdev_ops = { .ndo_set_rx_mode = asix_set_multicast, }; -int ax88172a_get_settings (struct net_device *net,struct ethtool_cmd *cmd) +static int ax88172a_get_settings (struct net_device *net, +struct ethtool_cmd *cmd) {if (!net->phydev)return -ENODEV ;
@@ -169,7 +170,8 @@ int ax88172a_get_settings(struct net_device *net, struct ethtool_cmd *cmd)return phy_ethtool_gset (net->phydev, cmd); } -int ax88172a_set_settings (struct net_device *net,struct ethtool_cmd *cmd) +static int ax88172a_set_settings (struct net_device *net, +struct ethtool_cmd *cmd) {if (!net->phydev)return -ENODEV ;
@@ -177,7 +179,7 @@ int ax88172a_set_settings(struct net_device *net, struct ethtool_cmd *cmd)return phy_ethtool_sset (net->phydev, cmd); } -int ax88172a_nway_reset (struct net_device *net) +static int ax88172a_nway_reset (struct net_device *net) {if (!net->phydev)return -ENODEV ;
Signature · 1 line
1.8.4.rc1
PATCH 2/2 net: asix: Move declaration of ax88172a_info to shared header
From: Mark Brown <[email protected]>
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.
--- drivers/net/usb/asix.h | 2 ++ drivers/net/usb/asix_devices.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/usb/asix.h +2 -0
@@ -178,6 +178,8 @@ struct asix_common_private {struct asix_rx_fixup_info rx_fixup_info; }; +extern const struct driver_info ax88172a_info; +/* ASIX specific flags */ #define FLAG_EEPROM_MAC (1UL << 0)/* init device MAC from eeprom */
drivers/net/usb/asix_devices.c +0 -2
@@ -946,8 +946,6 @@ static const struct driver_info hg20f9_info = { .data = FLAG_EEPROM_MAC, }; -extern const struct driver_info ax88172a_info; -static const struct usb_device_id products [] = { {// Linksys USB200M
Signature · 1 line
1.8.4.rc1
Re: [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header
In reply to a message not in the archiveQuoted 18 lines · Mark Brown
From: Mark Brown <[email protected]>
Ensure that the definition of
ax88172a_infomatches the declaration seen by users and silence sparse warnings about symbols without declarations in the global namespace by moving the declaration into the shared headerasix.h.Signed-off-by Mark Brown <[email protected]>--- drivers/net/usb/asix.h | 2 ++ drivers/net/usb/asix_devices.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/net/usb/asix.h +0
-0
drivers/net/usb/asix.h struct asix_common_private { · line 181
Quoted 4 lines
drivers/net/usb/asix.h +1
-0@@ -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'. --
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] 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
Quoted 22 lines · On Fri, 9 Aug 2013 14:39:06 -0300 Fabio Estevam <[email protected]> wrote:
Quoted 21 lines · Mark Brown
From: Mark Brown <[email protected]>
Ensure that the definition of
ax88172a_infomatches the declaration seen by users and silence sparse warnings about symbols without declarations in the global namespace by moving the declaration into the shared headerasix.h.Signed-off-by Mark Brown <[email protected]>--- drivers/net/usb/asix.h | 2 ++ drivers/net/usb/asix_devices.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/net/usb/asix.h +0
-0@@ -178,6 +178,8 @@ struct asix_common_private {struct asix_rx_fixup_info rx_fixup_info; };
Quoted 5 lines
drivers/net/usb/asix.h struct asix_common_private { · line 181
Quoted 1 line
drivers/net/usb/asix.h +1
-0+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.
Re: [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header
In reply to a message not in the archiveQuoted 25 lines · Stephen Hemminger
Quoted 22 lines · On Fri, 9 Aug 2013 14:39:06 -0300 Fabio Estevam…
Quoted 21 lines · Mark Brown
From: Mark Brown <[email protected]>
Ensure that the definition of
ax88172a_infomatches the declaration seen by users and silence sparse warnings about symbols without declarations in the global namespace by moving the declaration into the shared headerasix.h.Signed-off-by Mark Brown <[email protected]>--- drivers/net/usb/asix.h | 2 ++ drivers/net/usb/asix_devices.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/net/usb/asix.h +0
-0@@ -178,6 +178,8 @@ struct asix_common_private {struct asix_rx_fixup_info rx_fixup_info; };
Quoted 7 lines
Quoted 5 lines
drivers/net/usb/asix.h struct asix_common_private { · line 181
Quoted 1 line
drivers/net/usb/asix.h +1
-0+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 [email protected] 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
In reply to Stephen HemmingerQuoted 7 lines · Stephen Hemminger
Quoted 5 lines
Quoted 1 line
+extern const struct
driver_infoax88172a_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.
You are right, sorry for the noise.
David Miller
maintainerRe: [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header
In reply to Eric DumazetFrom: Eric Dumazet <[email protected]>
Date: Fri, 09 Aug 2013 10:50:36 -0700
Quoted 2 lines
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 :-)
From: Mark Brown <[email protected]>
Date: Fri, 9 Aug 2013 18:31:21 +0100
Quoted 6 lines
From: Mark Brown <[email protected]>
Make functions that are only referenced from ops structures static, they do not need to be in the global namespace and sparse complains about this.
Signed-off-by Mark Brown <[email protected]>
Applied.
Re: [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header
In reply to Mark BrownFrom: Mark Brown <[email protected]>
Date: Fri, 9 Aug 2013 18:31:22 +0100
Quoted 8 lines
From: Mark Brown <[email protected]>
Ensure that the definition of
ax88172a_infomatches the declaration seen by users and silence sparse warnings about symbols without declarations in the global namespace by moving the declaration into the shared headerasix.h.Signed-off-by Mark Brown <[email protected]>
Applied.