]> git.karo-electronics.de Git - karo-tx-linux.git/commit
hwmon: (lm90) Fix warnings
authorJean Delvare <khali@linux-fr.org>
Tue, 30 Aug 2011 01:16:56 +0000 (11:16 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 30 Aug 2011 01:16:56 +0000 (11:16 +1000)
commitd6b244e8e23f180401682e59ad2c4fb2ad8c479a
treeff84887887bb0733fe93f78df0f1eda8c7f8e0de
parent2ffebecacd16ee186fb44005bd3349a3528f171b
hwmon: (lm90) Fix warnings

With some configuration option combinations, we get the following
warnings:

drivers/hwmon/lm90.c: In function 'lm90_detect':
drivers/hwmon/lm90.c:1114: warning: 'chip_id' may be used uninitialized
in this function
drivers/hwmon/lm90.c:1114: warning: 'reg_config1' may be used
uninitialized in this function
drivers/hwmon/lm90.c:1114: warning: 'reg_convrate' may be used
uninitialized in this function
drivers/hwmon/lm90.c:1187: warning: 'reg_emerg2' may be used
uninitialized in this function
drivers/hwmon/lm90.c:1187: warning: 'reg_status2' may be used
uninitialized in this function

We can solve these easily by reading the register values first and
checking for errors later. These errors should be very rare, even in
the case of failed detection, so this change has no impact on
performance. And this makes checkpatch.pl happier.

Reported-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
drivers/hwmon/lm90.c