hwmon: Avoid initializing the same field twice
authorJean Delvare <jdelvare@suse.de>
Fri, 4 Apr 2014 16:01:34 +0000 (18:01 +0200)
committerJean Delvare <jdelvare@suse.de>
Fri, 4 Apr 2014 16:01:34 +0000 (18:01 +0200)
All hwmon drivers allocate their data structure with some form of
kzalloc, so setting data fields to zero explicitly is a waste of time.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/asc7621.c
drivers/hwmon/atxp1.c
drivers/hwmon/lm77.c
drivers/hwmon/lm83.c
drivers/hwmon/lm87.c
drivers/hwmon/lm92.c
drivers/hwmon/lm93.c
drivers/hwmon/max1619.c
drivers/hwmon/w83792d.c
drivers/hwmon/w83l785ts.c

index 8d9f2a0e8efea262aaef5311133af527f66a7315..71463689d163d794916f692595475a4332baface 100644 (file)
@@ -1115,7 +1115,6 @@ asc7621_probe(struct i2c_client *client, const struct i2c_device_id *id)
                return -ENOMEM;
 
        i2c_set_clientdata(client, data);
-       data->valid = 0;
        mutex_init(&data->update_lock);
 
        /* Initialize the asc7621 chip */
index ddff02e3e66f9ad464b13261eaf0a7d0b76b9218..6edce42c61d51188df6d5e3e652125197558da9b 100644 (file)
@@ -353,8 +353,6 @@ static int atxp1_probe(struct i2c_client *new_client,
        data->vrm = vid_which_vrm();
 
        i2c_set_clientdata(new_client, data);
-       data->valid = 0;
-
        mutex_init(&data->update_lock);
 
        /* Register sysfs hooks */
index f17beb5e6dd63bd7055f35492546c452c2fedcb1..502771c06fd99e73ce6bc9b51e5d3413fdc6d95f 100644 (file)
@@ -348,7 +348,6 @@ static int lm77_probe(struct i2c_client *client, const struct i2c_device_id *id)
                return -ENOMEM;
 
        i2c_set_clientdata(client, data);
-       data->valid = 0;
        mutex_init(&data->update_lock);
 
        /* Initialize the LM77 chip */
index abd270243ba701d2332977eea1e79f485353a4c0..be02155788c3e12ea0ada37b103251c4330a8bf5 100644 (file)
@@ -349,7 +349,6 @@ static int lm83_probe(struct i2c_client *new_client,
                return -ENOMEM;
 
        i2c_set_clientdata(new_client, data);
-       data->valid = 0;
        mutex_init(&data->update_lock);
 
        /*
index 4c5f20231c1a6a71e0daa66116340dfb701ff8b5..ba1d83d480563a14c8bafae0c38df8bb6edd2740 100644 (file)
@@ -903,7 +903,6 @@ static int lm87_probe(struct i2c_client *client, const struct i2c_device_id *id)
                return -ENOMEM;
 
        i2c_set_clientdata(client, data);
-       data->valid = 0;
        mutex_init(&data->update_lock);
 
        /* Initialize the LM87 chip */
index 9d0e87a4f0cbc1226cbf8efa47d99cf62dbaa4b8..b9022db6511ae4cc8ee5851d89466725c5384d8b 100644 (file)
@@ -380,7 +380,6 @@ static int lm92_probe(struct i2c_client *new_client,
                return -ENOMEM;
 
        i2c_set_clientdata(new_client, data);
-       data->valid = 0;
        mutex_init(&data->update_lock);
 
        /* Initialize the chipset */
index 6f1c6c0dbaf56c1d019375292dfbfeefb4aef25a..adf23165a6a709ca2785cad332b8626da2a73b80 100644 (file)
@@ -2754,7 +2754,6 @@ static int lm93_probe(struct i2c_client *client,
        i2c_set_clientdata(client, data);
 
        /* housekeeping */
-       data->valid = 0;
        data->update = update;
        mutex_init(&data->update_lock);
 
index 6638e997f83fbd165ebcf019aba2b2da930b715b..4c23afe113e2f71b6d9b9356e59122abfc3484c4 100644 (file)
@@ -273,7 +273,6 @@ static int max1619_probe(struct i2c_client *new_client,
                return -ENOMEM;
 
        i2c_set_clientdata(new_client, data);
-       data->valid = 0;
        mutex_init(&data->update_lock);
 
        /* Initialize the MAX1619 chip */
index df585808adb65feb2f53c458799010f68ca4bcc2..4068db4d9580b538c70ffccc7db71d29c5515967 100644 (file)
@@ -1376,7 +1376,6 @@ w83792d_probe(struct i2c_client *client, const struct i2c_device_id *id)
                return -ENOMEM;
 
        i2c_set_clientdata(client, data);
-       data->valid = 0;
        mutex_init(&data->update_lock);
 
        err = w83792d_detect_subclients(client);
index 6384b268f59008406a3cd2789fd851978e35acd7..ac30431220115d9f5efff73288f4bb3baa1d5cf9 100644 (file)
@@ -188,12 +188,8 @@ static int w83l785ts_probe(struct i2c_client *client,
                return -ENOMEM;
 
        i2c_set_clientdata(client, data);
-       data->valid = 0;
        mutex_init(&data->update_lock);
 
-       /* Default values in case the first read fails (unlikely). */
-       data->temp[1] = data->temp[0] = 0;
-
        /*
         * Initialize the W83L785TS chip
         * Nothing yet, assume it is already started.