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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 2 Oct 2018 13:59:18 +0200
From:   Bartosz Golaszewski <bgolaszewski@...libre.com>
To:     Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc:     Bartosz Golaszewski <brgl@...ev.pl>, Arnd Bergmann <arnd@...db.de>,
        GregKH <greg@...ah.com>, sfr@...b.auug.org.au,
        arm-soc <linux-arm-kernel@...ts.infradead.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] nvmem: only build nvmem_find_cell_by_index() if OF is enabled

wt., 2 paź 2018 o 13:49 Srinivas Kandagatla
<srinivas.kandagatla@...aro.org> napisał(a):
>
>
>
> On 02/10/18 12:02, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bgolaszewski@...libre.com>
> >
> > The following warning is produced when building nvmem core if
> > CONFIG_OF is disabled:
> >
> > drivers/nvmem/core.c:496:1: warning: 'nvmem_find_cell_by_index' defined but not used [-Wunused-function]
> >   nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index)
> >   ^~~~~~~~~~~~~~~~~~~~~~~~
> >
> > This is caused by the fact that the only caller of this routine is
> > under an ifdef depending on this option. Fix it by adding a relevant
> > ifdef to the function in question as well.
> >
> > Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
> > ---
> >   drivers/nvmem/core.c | 2 ++
> >   1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
> > index cc815bb2eebd..65f61cd0a687 100644
> > --- a/drivers/nvmem/core.c
> > +++ b/drivers/nvmem/core.c
> > @@ -492,6 +492,7 @@ static int nvmem_add_cells_from_table(struct nvmem_device *nvmem)
> >       return rval;
> >   }
> >
> > +#if IS_ENABLED(CONFIG_OF)
>
> You should probably attribute the function with "__maybe_unused"
> Instead of adding this condition.
>

Sounds better indeed. I'll resend tomorrow to avoid spamming.

Bart

> --srini
>
>
> >   static struct nvmem_cell *
> >   nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index)
> >   {
> > @@ -507,6 +508,7 @@ nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index)
> >
> >       return cell;
> >   }
> > +#endif
> >
> >   static struct nvmem_cell *
> >   nvmem_find_cell_by_name(struct nvmem_device *nvmem, const char *cell_id)
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ