Re: [PATCH v8 13/25] m68k: Dispatch nvram_ops calls to Atari or Mac functions

2018-12-31 Thread Arnd Bergmann
On Sun, Dec 30, 2018 at 11:12 PM Finn Thain wrote: > On Sun, 30 Dec 2018, LEROY Christophe wrote: > But I'm over-simplifying. Arnd's alternative actually goes like this, > > #if defined(CONFIG_MAC) && !defined(CONFIG_ATARI) > const struct nvram_ops arch_nvram_ops = { > /* ... */ > } >

Re: [PATCH v8 13/25] m68k: Dispatch nvram_ops calls to Atari or Mac functions

2018-12-30 Thread Finn Thain
On Sun, 30 Dec 2018, LEROY Christophe wrote: > > > > > > Since the operations are almost entirely distinct, why not have two > > > separate 'nvram_ops' instances here that each refer to just the set > > > they actually need? > > > > > > > The reason for that is that I am alergic to code

Re: [PATCH v8 13/25] m68k: Dispatch nvram_ops calls to Atari or Mac functions

2018-12-30 Thread LEROY Christophe
Finn Thain a écrit : On Sat, 29 Dec 2018, Arnd Bergmann wrote: On Wed, Dec 26, 2018 at 1:43 AM Finn Thain wrote: > + > +static ssize_t m68k_nvram_get_size(void) > +{ > + if (MACH_IS_ATARI) > + return atari_nvram_get_size(); > + else if (MACH_IS_MAC) > +

Re: [PATCH v8 13/25] m68k: Dispatch nvram_ops calls to Atari or Mac functions

2018-12-29 Thread Finn Thain
On Sat, 29 Dec 2018, Arnd Bergmann wrote: > On Wed, Dec 26, 2018 at 1:43 AM Finn Thain wrote: > > > + > > +static ssize_t m68k_nvram_get_size(void) > > +{ > > + if (MACH_IS_ATARI) > > + return atari_nvram_get_size(); > > + else if (MACH_IS_MAC) > > +

Re: [PATCH v8 13/25] m68k: Dispatch nvram_ops calls to Atari or Mac functions

2018-12-29 Thread Arnd Bergmann
On Wed, Dec 26, 2018 at 1:43 AM Finn Thain wrote: > + > +static ssize_t m68k_nvram_get_size(void) > +{ > + if (MACH_IS_ATARI) > + return atari_nvram_get_size(); > + else if (MACH_IS_MAC) > + return mac_pram_get_size(); > + return -ENODEV; > +} > + >

[PATCH v8 13/25] m68k: Dispatch nvram_ops calls to Atari or Mac functions

2018-12-25 Thread Finn Thain
A multi-platform kernel binary has to decide at run-time how to dispatch the arch_nvram_ops calls. Add a platform-independent arch_nvram_ops struct for this, to replace the atari-specific one. Enable CONFIG_HAVE_ARCH_NVRAM_OPS for Macs. Signed-off-by: Finn Thain Tested-by: Christian T. Steigies