[lm-sensors] [PATCH 06/79] hwmon: (lm87) Fix: do not use assignment in if condition

Guenter Roeck guenter.roeck at ericsson.com
Thu Jan 26 18:17:21 CET 2012


On Thu, 2012-01-26 at 09:28 -0500, Jean Delvare wrote:
> On Mon, 23 Jan 2012 18:48:45 -0800, Guenter Roeck wrote:
> > From: Guenter Roeck <linux at roeck-us.net>
> > 
> > Fix checkpatch issue:
> > ERROR: do not use assignment in if condition
> > 
> > Replace repeated calls to device_create_file() with calls to sysfs_create_group.
> > 
> > Cc: Jean Delvare <khali at linux-fr.org>
> > Signed-off-by: Guenter Roeck <linux at roeck-us.net>
> > ---
> >  drivers/hwmon/lm87.c |  152 ++++++++++++++++++++++++++------------------------
> >  1 files changed, 80 insertions(+), 72 deletions(-)
> 
> Overall I like it. Just one suggestion:
> 
> > +static void lm87_remove_files(struct i2c_client *client)
> > +{
> 
> I think it makes sense to introduce
> 	struct device *dev = &client->dev;
> to make the rest of the function easier to read. The binary code
> generated is unchanged.
> 
Good idea; I'll make that change.

> The same might be a good idea in the probe function, for the same
> reason.
> 
Possibly. Not now, though; it interferes with your other patches.

Thanks,
Guenter






More information about the lm-sensors mailing list