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]
Date:   Mon, 31 Dec 2018 10:13:17 +1100 (AEDT)
From:   Finn Thain <fthain@...egraphics.com.au>
To:     Arnd Bergmann <arnd@...db.de>
cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-m68k <linux-m68k@...ts.linux-m68k.org>,
        linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>
Subject: Re: [PATCH v8 18/25] powerpc: Implement nvram sync ioctl

On Sun, 30 Dec 2018, Finn Thain wrote:

> > > diff --git a/include/linux/nvram.h b/include/linux/nvram.h
> > > index b7bfaec60a43..24a57675dba1 100644
> > > --- a/include/linux/nvram.h
> > > +++ b/include/linux/nvram.h
> > > @@ -18,8 +18,12 @@ struct nvram_ops {
> > >         unsigned char   (*read_byte)(int);
> > >         void            (*write_byte)(unsigned char, int);
> > >         ssize_t         (*get_size)(void);
> > > +#ifdef CONFIG_PPC
> > > +       long            (*sync)(void);
> > > +#else
> > >         long            (*set_checksum)(void);
> > >         long            (*initialize)(void);
> > > +#endif
> > >  };
> > 
> > Maybe just leave all entries visible here, and avoid the above #ifdef 
> > checks.
> > 
> 
> The #ifdef isn't there just to save a few bytes, though it does do that. 
> It's really meant to cause a build failure when I mess up somewhere. But 
> I'm happy to change it if you can see a reason to do so (?)
> 

I think the problem with these #ifdef conditionals is that they don't 
express the correct constraints. So, at the end of this series I'd prefer 
to see,

struct nvram_ops {
       ssize_t         (*read)(char *, size_t, loff_t *);
       ssize_t         (*write)(char *, size_t, loff_t *);
       unsigned char   (*read_byte)(int);
       void            (*write_byte)(unsigned char, int);
       ssize_t         (*get_size)(void);
#if defined(CONFIG_PPC)
       long            (*sync)(void);
       int             (*get_partition)(int);
#elif defined(CONFIG_X86) || defined(CONFIG_M68K)
       long            (*set_checksum)(void);
       long            (*initialize)(void);
#endif
};

Is that okay with you?

-- 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ