Re: [PATCH v8 05/25] char/nvram: Adopt arch_nvram_ops
From: Finn Thain
Date: Fri Jan 04 2019 - 17:05:15 EST
On Fri, 4 Jan 2019, Christoph Hellwig wrote:
> On Fri, Jan 04, 2019 at 09:08:13AM +1100, Finn Thain wrote:
> > On Thu, 3 Jan 2019, Christoph Hellwig wrote:
> >
> > > > +
> > > > +const struct nvram_ops arch_nvram_ops = {
> > > > + .read_byte = nvram_read_byte,
> > > > + .write_byte = nvram_write_byte,
> > > > + .get_size = nvram_get_size,
> > > > +};
> > > > +EXPORT_SYMBOL(arch_nvram_ops);
> > >
> > > I think something this internal should always be EXPORT_SYMBOL_GPL.
> > >
> >
> > By "internal" do you mean "not involving interests outside of the Linux
> > Foundation"? TBH, I don't know who's affected.
>
> Linux Foundation doesn't matter.
>
> But as far as I can see you export the struct from arch code
> for nvram.ko to use them and no one else, which is clearly internal.
>
No, arch_nvram_ops is not "internal" in that sense. The struct is used
whereever the nvram_* exports are presently used:
$ git grep -e "EXPORT_SYMBOL.*nvram" v4.20
...
v4.20:arch/powerpc/kernel/setup_32.c:EXPORT_SYMBOL(nvram_read_byte);
v4.20:arch/powerpc/kernel/setup_32.c:EXPORT_SYMBOL(nvram_write_byte);
v4.20:arch/powerpc/kernel/setup_32.c:EXPORT_SYMBOL(nvram_get_size);
v4.20:arch/powerpc/kernel/setup_32.c:EXPORT_SYMBOL(nvram_sync);
v4.20:drivers/char/nvram.c:EXPORT_SYMBOL(__nvram_read_byte);
v4.20:drivers/char/nvram.c:EXPORT_SYMBOL(nvram_read_byte);
v4.20:drivers/char/nvram.c:EXPORT_SYMBOL(__nvram_write_byte);
v4.20:drivers/char/nvram.c:EXPORT_SYMBOL(nvram_write_byte);
v4.20:drivers/char/nvram.c:EXPORT_SYMBOL(__nvram_check_checksum);
v4.20:drivers/char/nvram.c:EXPORT_SYMBOL(nvram_check_checksum);
...
$ git grep -wle "nvram_read_byte|nvram_write_byte|nvram_get_size|nvram_sync|__nvram_read_byte|__nvram_write_byte|__nvram_check_checksum"
arch/powerpc/include/asm/machdep.h
arch/powerpc/include/asm/nvram.h
arch/powerpc/kernel/setup_32.c
arch/powerpc/platforms/powermac/nvram.c
drivers/char/generic_nvram.c
drivers/char/nvram.c
drivers/platform/x86/thinkpad_acpi.c
drivers/scsi/atari_scsi.c
drivers/video/fbdev/controlfb.c
drivers/video/fbdev/imsttfb.c
drivers/video/fbdev/matrox/matroxfb_base.c
drivers/video/fbdev/platinumfb.c
drivers/video/fbdev/valkyriefb.c
include/linux/nvram.h
sound/ppc/awacs.c
$
--