Re: adm1026 driver port for kernel 2.6.10-rc2 [RE-REVISED DRIVER]

From: Jean Delvare
Date: Tue Nov 23 2004 - 13:03:51 EST


> > > int adm1026_attach_adapter(struct i2c_adapter *adapter)
> > > {
> > > if (!(adapter->class & I2C_CLASS_HWMON)) {
> > > return 0;
> > > }
> >
> > no need for extra { }'s in such a case
>
> Of course there's no _need_. But I find the result stylistically
> easier to read. Is there any real objection?

There isn't as far as I can tell. The CodingStyle document doesn't
mention a preference for any form or the other, nor does Greg's talk
about coding style. This means that you are free. If anyone wants it the
other way and is brave enough, he/she can submit an incremental patch
for Greg to consider and see how Greg receives it ;)

> > > static ssize_t show_in(struct device *dev, char *buf, int nr)
> > > {
> > > struct adm1026_data *data = adm1026_update_device(dev);
> > > return sprintf(buf,"%d\n", INS_FROM_REG(nr, data->in[nr]));
> > > }
> >
> > any chance you could make this use snprintf instead ?
>
> I'll defer to Jean's response...

And I'll defer to Arjan's myself. As said in another post, no other i2c
client driver does use snprintf. If there is no good reason for them to
do (and actually I don't see any) let's stick to sprintf for everyone.
If there is, then we shall fix all drivers, not only adm1026.

Thanks,
--
Jean Delvare
http://khali.linux-fr.org/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/