linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: dsa: Fix build warning for !PM_SLEEP
@ 2014-10-01 11:59 Thierry Reding
  2014-10-01 12:19 ` Fabio Estevam
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Thierry Reding @ 2014-10-01 11:59 UTC (permalink / raw)
  To: David S. Miller; +Cc: Florian Fainelli, netdev, linux-kernel

From: Thierry Reding <treding@nvidia.com>

The dsa_switch_suspend() and dsa_switch_resume() functions are only used
when PM_SLEEP is enabled, so they need #ifdef CONFIG_PM_SLEEP protection
to avoid a compiler warning.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 net/dsa/dsa.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 6905f2d84c44..22f34cf4cb27 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -238,6 +238,7 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
 {
 }
 
+#ifdef CONFIG_PM_SLEEP
 static int dsa_switch_suspend(struct dsa_switch *ds)
 {
 	int i, ret = 0;
@@ -280,6 +281,7 @@ static int dsa_switch_resume(struct dsa_switch *ds)
 
 	return 0;
 }
+#endif
 
 
 /* link polling *************************************************************/
-- 
2.1.0


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

* Re: [PATCH] net: dsa: Fix build warning for !PM_SLEEP
  2014-10-01 11:59 [PATCH] net: dsa: Fix build warning for !PM_SLEEP Thierry Reding
@ 2014-10-01 12:19 ` Fabio Estevam
  2014-10-01 12:50   ` Thierry Reding
  2014-10-01 18:13 ` Florian Fainelli
  2014-10-01 19:24 ` David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2014-10-01 12:19 UTC (permalink / raw)
  To: Thierry Reding; +Cc: David S. Miller, Florian Fainelli, netdev, linux-kernel

On Wed, Oct 1, 2014 at 8:59 AM, Thierry Reding <thierry.reding@gmail.com> wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> The dsa_switch_suspend() and dsa_switch_resume() functions are only used
> when PM_SLEEP is enabled, so they need #ifdef CONFIG_PM_SLEEP protection
> to avoid a compiler warning.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  net/dsa/dsa.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
> index 6905f2d84c44..22f34cf4cb27 100644
> --- a/net/dsa/dsa.c
> +++ b/net/dsa/dsa.c
> @@ -238,6 +238,7 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
>  {
>  }
>
> +#ifdef CONFIG_PM_SLEEP
>  static int dsa_switch_suspend(struct dsa_switch *ds)
>  {
>         int i, ret = 0;
> @@ -280,6 +281,7 @@ static int dsa_switch_resume(struct dsa_switch *ds)
>
>         return 0;
>  }
> +#endif

You could also mark them as __maybe_unused and avoid the ifdef.

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

* Re: [PATCH] net: dsa: Fix build warning for !PM_SLEEP
  2014-10-01 12:19 ` Fabio Estevam
@ 2014-10-01 12:50   ` Thierry Reding
  0 siblings, 0 replies; 6+ messages in thread
From: Thierry Reding @ 2014-10-01 12:50 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: David S. Miller, Florian Fainelli, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1245 bytes --]

On Wed, Oct 01, 2014 at 09:19:24AM -0300, Fabio Estevam wrote:
> On Wed, Oct 1, 2014 at 8:59 AM, Thierry Reding <thierry.reding@gmail.com> wrote:
> > From: Thierry Reding <treding@nvidia.com>
> >
> > The dsa_switch_suspend() and dsa_switch_resume() functions are only used
> > when PM_SLEEP is enabled, so they need #ifdef CONFIG_PM_SLEEP protection
> > to avoid a compiler warning.
> >
> > Signed-off-by: Thierry Reding <treding@nvidia.com>
> > ---
> >  net/dsa/dsa.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
> > index 6905f2d84c44..22f34cf4cb27 100644
> > --- a/net/dsa/dsa.c
> > +++ b/net/dsa/dsa.c
> > @@ -238,6 +238,7 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
> >  {
> >  }
> >
> > +#ifdef CONFIG_PM_SLEEP
> >  static int dsa_switch_suspend(struct dsa_switch *ds)
> >  {
> >         int i, ret = 0;
> > @@ -280,6 +281,7 @@ static int dsa_switch_resume(struct dsa_switch *ds)
> >
> >         return 0;
> >  }
> > +#endif
> 
> You could also mark them as __maybe_unused and avoid the ifdef.

The users of these functions, dsa_suspend() and dsa_resume(), also use
the CONFIG_PM_SLEEP protection, so this way is more consistent.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] net: dsa: Fix build warning for !PM_SLEEP
  2014-10-01 11:59 [PATCH] net: dsa: Fix build warning for !PM_SLEEP Thierry Reding
  2014-10-01 12:19 ` Fabio Estevam
@ 2014-10-01 18:13 ` Florian Fainelli
  2014-10-01 19:24 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2014-10-01 18:13 UTC (permalink / raw)
  To: Thierry Reding, David S. Miller; +Cc: netdev, linux-kernel

On 10/01/2014 04:59 AM, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> The dsa_switch_suspend() and dsa_switch_resume() functions are only used
> when PM_SLEEP is enabled, so they need #ifdef CONFIG_PM_SLEEP protection
> to avoid a compiler warning.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

Thanks Thierry!

> ---
>  net/dsa/dsa.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
> index 6905f2d84c44..22f34cf4cb27 100644
> --- a/net/dsa/dsa.c
> +++ b/net/dsa/dsa.c
> @@ -238,6 +238,7 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
>  {
>  }
>  
> +#ifdef CONFIG_PM_SLEEP
>  static int dsa_switch_suspend(struct dsa_switch *ds)
>  {
>  	int i, ret = 0;
> @@ -280,6 +281,7 @@ static int dsa_switch_resume(struct dsa_switch *ds)
>  
>  	return 0;
>  }
> +#endif
>  
>  
>  /* link polling *************************************************************/
> 


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

* Re: [PATCH] net: dsa: Fix build warning for !PM_SLEEP
  2014-10-01 11:59 [PATCH] net: dsa: Fix build warning for !PM_SLEEP Thierry Reding
  2014-10-01 12:19 ` Fabio Estevam
  2014-10-01 18:13 ` Florian Fainelli
@ 2014-10-01 19:24 ` David Miller
  2014-10-02  8:35   ` Thierry Reding
  2 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2014-10-01 19:24 UTC (permalink / raw)
  To: thierry.reding; +Cc: f.fainelli, netdev, linux-kernel

From: Thierry Reding <thierry.reding@gmail.com>
Date: Wed,  1 Oct 2014 13:59:00 +0200

> From: Thierry Reding <treding@nvidia.com>
> 
> The dsa_switch_suspend() and dsa_switch_resume() functions are only used
> when PM_SLEEP is enabled, so they need #ifdef CONFIG_PM_SLEEP protection
> to avoid a compiler warning.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Applied.

Please, in the future, explicitly indicate what tree your changes
are against.  Through trial and error I figured out that this could
only apply to net-next, but that's not a good use of my time.

Thanks.

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

* Re: [PATCH] net: dsa: Fix build warning for !PM_SLEEP
  2014-10-01 19:24 ` David Miller
@ 2014-10-02  8:35   ` Thierry Reding
  0 siblings, 0 replies; 6+ messages in thread
From: Thierry Reding @ 2014-10-02  8:35 UTC (permalink / raw)
  To: David Miller; +Cc: f.fainelli, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 992 bytes --]

On Wed, Oct 01, 2014 at 03:24:52PM -0400, David Miller wrote:
> From: Thierry Reding <thierry.reding@gmail.com>
> Date: Wed,  1 Oct 2014 13:59:00 +0200
> 
> > From: Thierry Reding <treding@nvidia.com>
> > 
> > The dsa_switch_suspend() and dsa_switch_resume() functions are only used
> > when PM_SLEEP is enabled, so they need #ifdef CONFIG_PM_SLEEP protection
> > to avoid a compiler warning.
> > 
> > Signed-off-by: Thierry Reding <treding@nvidia.com>
> 
> Applied.
> 
> Please, in the future, explicitly indicate what tree your changes
> are against.  Through trial and error I figured out that this could
> only apply to net-next, but that's not a good use of my time.

I had assumed that working on top of linux-next is what most people were
doing anyway therefore net-next would be the default to apply patches to
unless otherwise stated.

But if this inconveniences you I'll try to remember to explicitly state
which tree it's based on in the future.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2014-10-02  8:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-01 11:59 [PATCH] net: dsa: Fix build warning for !PM_SLEEP Thierry Reding
2014-10-01 12:19 ` Fabio Estevam
2014-10-01 12:50   ` Thierry Reding
2014-10-01 18:13 ` Florian Fainelli
2014-10-01 19:24 ` David Miller
2014-10-02  8:35   ` Thierry Reding

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