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:   Fri, 18 Aug 2023 18:57:17 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Angel Iglesias <ang.iglesiasg@...il.com>
Cc:     linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>
Subject: Re: [PATCH 1/2] iio: pressure: bmp280: Allow multiple chips id per
 family of devices

On Fri, Aug 18, 2023 at 05:52:07PM +0200, Angel Iglesias wrote:
> On Fri, 2023-08-18 at 14:19 +0300, Andy Shevchenko wrote:
> > On Thu, Aug 17, 2023 at 11:05:21PM +0200, Angel Iglesias wrote:

...

> > > -       const unsigned int chip_id;
> > 
> > Yeah, this const makes a little sense...
> > 
> > > +       const unsigned int *chip_id;
> > 
> > ...but not this :-)
> 
> Isn't the same case as "const struct iio_chan_spec *channels" or "const int
> *oversampling_temp_avail". I thoght that this meant a pointer to a constant
> integer. On bmp280-core I declare the arrays with the modifiers static const.

Yes, and that is my point:
- old code makes a little sense
- new code makes a lot of sense

> > What I'm wondering is why it's int and not u8 / u16
> > (as it seems only a byte value there).
> 
> Yeah, can be u8, as the reg width is 1 byte and this IDs are stored on one reg.
> I just carried over the int type from previous versions, but it's just wasting
> space :/

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ