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]
Date:   Wed, 8 Aug 2018 12:24:51 +0000
From:   Ben Whitten <Ben.Whitten@...rdtech.com>
To:     Andreas Färber <afaerber@...e.de>,
        Ben Whitten <ben.whitten@...il.com>
CC:     "starnight@...cu.edu.tw" <starnight@...cu.edu.tw>,
        "hasnain.virk@....com" <hasnain.virk@....com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH lora-next 01/10] net: lora: sx1301: add register,
 bit-fields, and helpers for regmap

> Subject: Re: [PATCH lora-next 01/10] net: lora: sx1301: add
> register, bit-fields, and helpers for regmap
> 
> Am 07.08.2018 um 19:32 schrieb Ben Whitten:
> > diff --git a/drivers/net/lora/sx1301.c
> b/drivers/net/lora/sx1301.c
> > index 5342b61..49958f0 100644
> > --- a/drivers/net/lora/sx1301.c
> > +++ b/drivers/net/lora/sx1301.c
> [...]
> > @@ -76,8 +287,29 @@ struct sx1301_priv {
> >  	struct gpio_desc *rst_gpio;
> >  	u8 cur_page;
> >  	struct spi_controller *radio_a_ctrl, *radio_b_ctrl;
> > +	struct regmap		*regmap;
> > +	struct regmap_field
> 	*regmap_fields[ARRAY_SIZE(sx1301_reg_fields)];
> >  };
> >
> > +static int sx1301_field_read(struct sx1301_priv *priv,
> > +		enum sx1301_fields field_id)
> > +{
> > +	int ret;
> > +	int val;
> > +
> > +	ret = regmap_field_read(priv-
> >regmap_fields[field_id], &val);
> > +	if (ret)
> > +		return ret;
> > +
> > +	return val;
> 
> This strikes me as a bad idea. Please keep returning the
> value by
> pointer, so that we can clearly distinguish from error values.

Good point, will change it.

> > +}
> > +
> > +static int sx1301_field_write(struct sx1301_priv *priv,
> > +		enum sx1301_fields field_id, u8 val)
> > +{
> > +	return regmap_field_write(priv-
> >regmap_fields[field_id], val);
> > +}
> > +
> >  static int sx1301_read_burst(struct spi_device *spi, u8
> reg, u8 *val, size_t len)
> >  {
> >  	u8 addr = reg & 0x7f;
> [snip]
> 
> It looks to me as if both of those static functions are unused
> in this
> patch? Please keep things bisectable.

Sure, it was a prep patch bit I can include these functions in the
next one along where they are actually used.

Thanks,
Ben

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ