lkml.org 
[lkml]   [2019]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 24/25] powerpc: Adopt nvram module for PPC64
On Tue, 8 Jan 2019, Michael Ellerman wrote:

> > The reason why that doesn't work boils down to introspection. (This
> > was mentioned elsewhere in this email thread.) For example, we
> > presently have code like this,
> >
> > ssize_t nvram_get_size(void)
> > {
> > if (ppc_md.nvram_size)
> > return ppc_md.nvram_size();
> > return -1;
> > }
> > EXPORT_SYMBOL(nvram_get_size);
> >
> > This construction means we get to decide at run-time which of the NVRAM
> > functions should be used. (Whereas your example makes a build-time decision.)
>
> Right, but we only need to make a runtime decision on powerpc (right?).

It's needed in many places outside of powerpc. Otherwise the caller can't
determine at run-time which ops are implemented.

Hence you have to duplicate the caller for each supported configuration
that you build.

Already, this precludes a shared misc device implementation and belies the
"generic" in drivers/char/generic_nvram.c.

--

\
 
 \ /
  Last update: 2019-01-08 23:51    [W:0.066 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site