2009-09-02 08:47:48

by corentin.labbe

[permalink] [raw]
Subject: Re: [lm-sensors] [PATCH] hwmon: Driver for Texas Instruments amc6821 chip

[email protected] a ?crit :
> I have crafted a hwmon driver for Texas Instruments amc6821 SMB-bus 2-
> channel temperature sensor, pwm controller. This is my first linux project
> so some corrections will be necessary.
>
> T. Mertelj

Hello

I have some warnings

CC drivers/hwmon/amc6821.o
drivers/hwmon/amc6821.c: In function `set_temp1_auto_point_temp':
drivers/hwmon/amc6821.c:390: warning: comparison is always true due to limited range of data type
drivers/hwmon/amc6821.c: In function `set_temp2_auto_point_temp':
drivers/hwmon/amc6821.c:391: warning: comparison is always true due to limited range of data type
drivers/hwmon/amc6821.c: In function `set_pwm1_auto_point_pwm':
drivers/hwmon/amc6821.c:408: warning: comparison is always true due to limited range of data type
drivers/hwmon/amc6821.c:419: warning: comparison is always true due to limited range of data type

you use tmp as a unsigned 8 bit so it is always >= 0 (it can't be below 0)
Prefer use:
s8 tmp;


Cordially