misc: nct1008: use signed long for temp
Diwakar Tundlam [Thu, 20 Mar 2014 22:33:31 +0000 (15:33 -0700)]
Avoid setting signed temperature value into unsigned long pointer

Bug 1454792

Change-Id: I583f2296c294b6d499fcdf8e1b9338cce5b8344d
Reviewed-on: http://git-master/r/384655
(cherry picked from commit 72ccbb69fcf0375ce7a26db7c32dd3dd925a6f26)
Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-on: http://git-master/r/392044
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>

drivers/misc/nct1008.c

index 140f556..f6cc442 100644 (file)
@@ -163,7 +163,7 @@ static int nct1008_read_reg(struct i2c_client *client, u8 reg)
 }
 
 static int nct1008_ext_get_temp_common(struct nct1008_data *data,
-                                       unsigned long *temp)
+                                       long *temp)
 {
        struct i2c_client *client = data->client;
        struct nct1008_platform_data *pdata = client->dev.platform_data;
@@ -572,7 +572,7 @@ static int nct1008_shutdown_warning_get_cur_state(
 {
        struct nct1008_data *data = cdev->devdata;
        long ext_limit = data->plat_data.shutdown_ext_limit * 1000;
-       unsigned long temp;
+       long temp;
 
        if (nct1008_ext_get_temp_common(data, &temp))
                return -1;
@@ -592,7 +592,7 @@ static int nct1008_shutdown_warning_set_cur_state(
        static long temp_sav;
        struct nct1008_data *data = cdev->devdata;
        long ext_limit = data->plat_data.shutdown_ext_limit * 1000;
-       unsigned long temp;
+       long temp;
 
        if (nct1008_ext_get_temp_common(data, &temp))
                return -1;