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]
Message-ID: <20160217221132.GE25818@lunn.ch>
Date:	Wed, 17 Feb 2016 23:11:32 +0100
From:	Andrew Lunn <andrew@...n.ch>
To:	Joachim Eastwood <manabian@...il.com>
Cc:	Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
	GregKH <greg@...ah.com>,
	Maxime Ripard <maxime.ripard@...e-electrons.com>,
	Wolfram Sang <wsa@...-dreams.de>,
	Mark Brown <broonie@...nel.org>,
	Vladimir Zapolskiy <vz@...ia.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Pantelis Antoniou <pantelis.antoniou@...sulko.com>,
	bgolaszewski@...libre.com
Subject: Re: [PATCHv5 6/7] eeprom: 93xx46: extend driver to plug into the
 NVMEM framework

On Wed, Feb 17, 2016 at 11:02:56PM +0100, Joachim Eastwood wrote:
> Hi Andrew,
> 
> On 17 February 2016 at 21:07, Andrew Lunn <andrew@...n.ch> wrote:
> > Add a regmap for accessing the EEPROM, and then use that with the
> > NVMEM framework. Enable backward compatibility in the MVMEM config
> 
> typo: MVMEM

Thanks

> > +/*
> > + * Provide a regmap interface, which is registered with the NVMEM
> > + * framework
> > +*/
> > +static int eeprom_93xx46_regmap_read(void *context, const void *reg,
> > +                                    size_t reg_size, void *val,
> > +                                    size_t val_size)
> > +{
> > +       struct eeprom_93xx46_dev *eeprom_93xx46 = context;
> > +       off_t offset = *(u32 *)reg;
> > +       int err;
> > +
> > +       err = eeprom_93xx46_read(eeprom_93xx46, val, offset, val_size);
> > +       if (err)
> > +               return err;
> > +       return 0;
> 
> Can be:
> return eeprom_93xx46_read(eeprom_93xx46, val, offset, val_size);
> 
> Allows you to remove the 'err' variable also.

Nope. regmap wants a return value of 0 or error. eeprom_93xx46_read()
returns how many bytes where actually read. So we either need this
code here, or we change the return from eeprom_93xx46_read().

     Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ