lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141001125000.GC21733@ulmo>
Date:	Wed, 1 Oct 2014 14:50:01 +0200
From:	Thierry Reding <thierry.reding@...il.com>
To:	Fabio Estevam <festevam@...il.com>
Cc:	"David S. Miller" <davem@...emloft.net>,
	Florian Fainelli <f.fainelli@...il.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net: dsa: Fix build warning for !PM_SLEEP

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@...il.com> wrote:
> > From: Thierry Reding <treding@...dia.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@...dia.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

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ