Re: [PATCH v2 1/1] hwmon:max6697: Allow max6581 to create tempX_offset
From: Guenter Roeck
Date: Mon Jul 06 2020 - 19:16:38 EST
On Mon, Jul 06, 2020 at 03:46:20PM -0700, Chu Lin wrote:
> On Mon, Jul 6, 2020 at 3:10 PM Chu Lin <linchuyuan@xxxxxxxxxx> wrote:
> >
> > ---
> > drivers/hwmon/max6697.c | 100 ++++++++++++++++++++++++++++++++++++++--
> > 1 file changed, 96 insertions(+), 4 deletions(-)
> >
[ ... ]
> >
> > +static ssize_t offset_store(struct device *dev,
> > + struct device_attribute *devattr, const char *buf,
> > + size_t count)
> > +{
> > + long temp;
> > + u8 val, select;
> > + int ret, index;
> > + struct max6697_data *data;
> > +
Where possible, use reverse christmas tree order (longer lines first)
> > + index = to_sensor_dev_attr(devattr)->index;
> > + data = dev_get_drvdata(dev);
> > + select = i2c_smbus_read_byte_data(data->client,
> > + MAX6581_REG_OFFSET_SELECT);
> > + if (select < 0)
> > + return select;
> This is always false due to its type. This error is caught by the
> kernel test robot.
> I will submit a new version to address this issue.
>
While at it, watch out for new line length limits; the limit is now 100
characters. Line splits like the one above are no longer necessary.
Guenter