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: <20170304060010.GC6948@Socrates-UM>
Date:   Sat, 4 Mar 2017 14:00:12 +0800
From:   Eva Rachel Retuya <eraretuya@...il.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Jonathan Cameron <jic23@...nel.org>, linux-iio@...r.kernel.org,
        Hartmut Knaack <knaack.h@....de>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Peter Meerwald <pmeerw@...erw.net>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Michael Hennerich <michael.hennerich@...log.com>,
        Daniel Baluta <daniel.baluta@...il.com>,
        Alison Schofield <amsfield22@...il.com>,
        Florian Vaussard <florian.vaussard@...g-vd.ch>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        devicetree <devicetree@...r.kernel.org>
Subject: Re: [PATCH v5 4/4] iio: accel: adxl345: Add SPI support

On Fri, Mar 03, 2017 at 06:55:26PM +0200, Andy Shevchenko wrote:
> On Tue, Feb 28, 2017 at 4:37 AM, Eva Rachel Retuya <eraretuya@...il.com> wrote:
> > Add SPI driver that initializes SPI regmap for the adxl345 core driver.
> > The driver supports the same functionality as I2C namely the x, y, z and
> > scale readings.
> 
> Portion of minor comments.
> 
> > +config ADXL345_SPI
> > +       tristate "Analog Devices ADXL345 3-Axis Digital Accelerometer SPI Driver"
> 
> > +       depends on !(INPUT_ADXL34X=y || INPUT_ADXL34X=m)
> 
> Same question. Would it be just
> 
> depends on INPUT_ADXL34X=n
> 
> ?
> 
> > +        /* Setting bits 7 and 6 enables multiple-byte read */
> > +       .read_flag_mask = BIT(7) | BIT(6),
> 
> GENMASK(7, 6) ?
> 

True, but I would like to keep this as is. It is more readable and
obvious than GENMASK().

> > +static int adxl345_spi_probe(struct spi_device *spi)
> > +{
> 
> > +       struct regmap *regmap;
> > +       const struct spi_device_id *id = spi_get_device_id(spi);
> 
> Reverse order.
> 
> And usually we do assignments from function parameters first.

Ack.

Thanks,
Eva
> 
> > +               dev_err(&spi->dev, "Error initializing spi regmap: %d\n",
> > +                       (int)PTR_ERR(regmap));
> 
> Ugly casting!
> 
> -- 
> With Best Regards,
> Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ