> Operating on values before you check for errors is wrong. I'd rather do: > > ret = tsl2550_calculate_lux(ch0, ch1); > if (ret < 0) > return ret; > if (data->operating_mode == 1) /* extended mode */ > ret *= 5; I just wanted to suggest the same :) Pity that "operating_mode" is exported to sysfs, "extended_mode" would have been a better name, me thinks... Regards, Wolfram -- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Attachment:
signature.asc
Description: Digital signature