netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] net: asix: Staticise non-exported symbols
@ 2013-08-09 17:31 Mark Brown
  2013-08-09 17:31 ` [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header Mark Brown
  2013-08-13 21:14 ` [PATCH 1/2] net: asix: Staticise non-exported symbols David Miller
  0 siblings, 2 replies; 9+ messages in thread
From: Mark Brown @ 2013-08-09 17:31 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-usb, netdev, linaro-kernel, Mark Brown

From: Mark Brown <broonie@linaro.org>

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 <broonie@linaro.org>
---
 drivers/net/usb/ax88172a.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/usb/ax88172a.c b/drivers/net/usb/ax88172a.c
index d012203..723b387 100644
--- a/drivers/net/usb/ax88172a.c
+++ b/drivers/net/usb/ax88172a.c
@@ -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;
-- 
1.8.4.rc1

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

* [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header
  2013-08-09 17:31 [PATCH 1/2] net: asix: Staticise non-exported symbols Mark Brown
@ 2013-08-09 17:31 ` Mark Brown
       [not found]   ` <1376069482-16951-2-git-send-email-broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
  2013-08-13 21:14   ` David Miller
  2013-08-13 21:14 ` [PATCH 1/2] net: asix: Staticise non-exported symbols David Miller
  1 sibling, 2 replies; 9+ messages in thread
From: Mark Brown @ 2013-08-09 17:31 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-usb, netdev, linaro-kernel, Mark Brown

From: Mark Brown <broonie@linaro.org>

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 <broonie@linaro.org>
---
 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;
+
 /* ASIX specific flags */
 #define FLAG_EEPROM_MAC		(1UL << 0)  /* init device MAC from eeprom */
 
diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index b96ad4f..386a3df 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -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
-- 
1.8.4.rc1

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

* Re: [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header
       [not found]   ` <1376069482-16951-2-git-send-email-broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
@ 2013-08-09 17:39     ` Fabio Estevam
  2013-08-09 17:40       ` Stephen Hemminger
  0 siblings, 1 reply; 9+ messages in thread
From: Fabio Estevam @ 2013-08-09 17:39 UTC (permalink / raw)
  To: Mark Brown
  Cc: David S. Miller, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linaro-kernel-cunTk1MwBs8s++Sfvej+rw, Mark Brown

On Fri, Aug 9, 2013 at 2:31 PM, Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> From: Mark Brown <broonie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>
> 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 <broonie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
>  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'.
--
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

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

* Re: [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header
  2013-08-09 17:39     ` Fabio Estevam
@ 2013-08-09 17:40       ` Stephen Hemminger
       [not found]         ` <20130809104016.236fcd9d-We1ePj4FEcvRI77zikRAJc56i+j3xesD0e7PPNI6Mm0@public.gmane.org>
  2013-08-09 17:53         ` Fabio Estevam
  0 siblings, 2 replies; 9+ messages in thread
From: Stephen Hemminger @ 2013-08-09 17:40 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Mark Brown, David S. Miller, linux-usb, netdev, linaro-kernel,
	Mark Brown

On Fri, 9 Aug 2013 14:39:06 -0300
Fabio Estevam <festevam@gmail.com> wrote:

> On Fri, Aug 9, 2013 at 2:31 PM, Mark Brown <broonie@kernel.org> wrote:
> > From: Mark Brown <broonie@linaro.org>
> >
> > 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 <broonie@linaro.org>
> > ---
> >  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.

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

* Re: [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header
       [not found]         ` <20130809104016.236fcd9d-We1ePj4FEcvRI77zikRAJc56i+j3xesD0e7PPNI6Mm0@public.gmane.org>
@ 2013-08-09 17:50           ` Eric Dumazet
  2013-08-09 18:04             ` David Miller
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Dumazet @ 2013-08-09 17:50 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Fabio Estevam, Mark Brown, David S. Miller,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	linaro-kernel-cunTk1MwBs8s++Sfvej+rw, Mark Brown

On Fri, 2013-08-09 at 10:40 -0700, Stephen Hemminger wrote:
> On Fri, 9 Aug 2013 14:39:06 -0300
> Fabio Estevam <festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 
> > On Fri, Aug 9, 2013 at 2:31 PM, Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> > > From: Mark Brown <broonie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> > >
> > > 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 <broonie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> > > ---
> > >  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

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

* Re: [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header
  2013-08-09 17:40       ` Stephen Hemminger
       [not found]         ` <20130809104016.236fcd9d-We1ePj4FEcvRI77zikRAJc56i+j3xesD0e7PPNI6Mm0@public.gmane.org>
@ 2013-08-09 17:53         ` Fabio Estevam
  1 sibling, 0 replies; 9+ messages in thread
From: Fabio Estevam @ 2013-08-09 17:53 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Mark Brown, David S. Miller, linux-usb, netdev, linaro-kernel,
	Mark Brown

On Fri, Aug 9, 2013 at 2:40 PM, Stephen Hemminger
<stephen@networkplumber.org> wrote:

>> > +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.

You are right, sorry for the noise.

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

* Re: [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header
  2013-08-09 17:50           ` Eric Dumazet
@ 2013-08-09 18:04             ` David Miller
  0 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2013-08-09 18:04 UTC (permalink / raw)
  To: eric.dumazet
  Cc: stephen, festevam, broonie, linux-usb, netdev, linaro-kernel,
	broonie

From: Eric Dumazet <eric.dumazet@gmail.com>
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 :-)

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

* Re: [PATCH 1/2] net: asix: Staticise non-exported symbols
  2013-08-09 17:31 [PATCH 1/2] net: asix: Staticise non-exported symbols Mark Brown
  2013-08-09 17:31 ` [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header Mark Brown
@ 2013-08-13 21:14 ` David Miller
  1 sibling, 0 replies; 9+ messages in thread
From: David Miller @ 2013-08-13 21:14 UTC (permalink / raw)
  To: broonie; +Cc: linux-usb, netdev, linaro-kernel, broonie

From: Mark Brown <broonie@kernel.org>
Date: Fri,  9 Aug 2013 18:31:21 +0100

> From: Mark Brown <broonie@linaro.org>
> 
> 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 <broonie@linaro.org>

Applied.

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

* Re: [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header
  2013-08-09 17:31 ` [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header Mark Brown
       [not found]   ` <1376069482-16951-2-git-send-email-broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
@ 2013-08-13 21:14   ` David Miller
  1 sibling, 0 replies; 9+ messages in thread
From: David Miller @ 2013-08-13 21:14 UTC (permalink / raw)
  To: broonie; +Cc: linux-usb, netdev, linaro-kernel, broonie

From: Mark Brown <broonie@kernel.org>
Date: Fri,  9 Aug 2013 18:31:22 +0100

> From: Mark Brown <broonie@linaro.org>
> 
> 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 <broonie@linaro.org>

Applied.

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

end of thread, other threads:[~2013-08-13 21:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-09 17:31 [PATCH 1/2] net: asix: Staticise non-exported symbols Mark Brown
2013-08-09 17:31 ` [PATCH 2/2] net: asix: Move declaration of ax88172a_info to shared header Mark Brown
     [not found]   ` <1376069482-16951-2-git-send-email-broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2013-08-09 17:39     ` Fabio Estevam
2013-08-09 17:40       ` Stephen Hemminger
     [not found]         ` <20130809104016.236fcd9d-We1ePj4FEcvRI77zikRAJc56i+j3xesD0e7PPNI6Mm0@public.gmane.org>
2013-08-09 17:50           ` Eric Dumazet
2013-08-09 18:04             ` David Miller
2013-08-09 17:53         ` Fabio Estevam
2013-08-13 21:14   ` David Miller
2013-08-13 21:14 ` [PATCH 1/2] net: asix: Staticise non-exported symbols David Miller

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).