]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
misc: nct1008: use signed long for temp
authorDiwakar Tundlam <dtundlam@nvidia.com>
Thu, 20 Mar 2014 22:33:31 +0000 (15:33 -0700)
committerDiwakar Tundlam <dtundlam@nvidia.com>
Fri, 21 Mar 2014 21:50:34 +0000 (14:50 -0700)
Avoid setting signed temperature value into unsigned long pointer

Bug 1454792

Change-Id: I583f2296c294b6d499fcdf8e1b9338cce5b8344d
Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-on: http://git-master/r/384655
Reviewed-by: Automatic_Commit_Validation_User
drivers/misc/nct1008.c

index 5cd03c3488d94e0c98fe76e8346fff89d85e4a5e..aea28c14ff5e3855ef3abeaf3d2ba6866d4ccb7f 100644 (file)
@@ -216,7 +216,7 @@ static int nct1008_read_reg(struct i2c_client *client, u8 reg)
 
 static int nct1008_get_temp_common(int sensor,
                                        struct nct1008_data *data,
-                                       unsigned long *temp)
+                                       long *temp)
 {
        struct i2c_client *client = data->client;
        struct nct1008_platform_data *pdata = client->dev.platform_data;
@@ -670,7 +670,7 @@ static int nct1008_shutdown_warning_get_cur_state(
 {
        struct nct1008_data *data = cdev->devdata;
        long limit = data->plat_data.sensors[EXT].shutdown_limit * 1000;
-       unsigned long temp;
+       long temp;
 
        if (nct1008_get_temp_common(EXT, data, &temp))
                return -1;
@@ -690,7 +690,7 @@ static int nct1008_shutdown_warning_set_cur_state(
        static long temp_sav;
        struct nct1008_data *data = cdev->devdata;
        long limit = data->plat_data.sensors[EXT].shutdown_limit * 1000;
-       unsigned long temp;
+       long temp;
 
        if (nct1008_get_temp_common(EXT, data, &temp))
                return -1;