I2C: Do not init global variables to 0
PATCH 1/1 I2C: Do not init global variables to 0
Hi Greg,
This trivial patch enforces the rule that global variables should not be explicitely initialized to 0 for all i2c chip drivers.
Thanks.
Signed-off-by Jean Delvare <khali at linux-fr dot org>
drivers/i2c/chips/adm1021.c renamed from drivers/i2c/chips.orig/adm1021.c +1 -1
@@ -148,7 +148,7 @@ .detach_client = adm1021_detach_client, }; -static int adm1021_id =0 ; +static int adm1021_id;#define show (value) \ static ssize_t show_##value(struct device *dev, char *buf) \
drivers/i2c/chips/adm1025.c renamed from drivers/i2c/chips.orig/adm1025.c +1 -1
@@ -153,7 +153,7 @@* Internal variables */ -static int adm1025_id =0 ; +static int adm1025_id;/* * Sysfs stuff
drivers/i2c/chips/ds1621.c renamed from drivers/i2c/chips.orig/ds1621.c +1 -1
@@ -96,7 +96,7 @@ .detach_client = ds1621_detach_client, }; -static int ds1621_id =0 ; +static int ds1621_id;/* All registers are word-sized, except for the configuration register. DS1621 uses a high-byte first convention, which is exactly opposite to
drivers/i2c/chips/eeprom.c renamed from drivers/i2c/chips.orig/eeprom.c +1 -1
@@ -86,7 +86,7 @@ .detach_client = eeprom_detach_client, }; -static int eeprom_id =0 ; +static int eeprom_id;static void eeprom_update_client (struct i2c_client *client,u8 slice) {
drivers/i2c/chips/fscher.c renamed from drivers/i2c/chips.orig/fscher.c +1 -1
@@ -156,7 +156,7 @@* Internal variables */ -static int fscher_id =0 ; +static int fscher_id;/* * Sysfs stuff
drivers/i2c/chips/gl518sm.c renamed from drivers/i2c/chips.orig/gl518sm.c +1 -1
@@ -164,7 +164,7 @@* Internal variables */ -static int gl518_id =0 ; +static int gl518_id;/* * Sysfs stuff
drivers/i2c/chips/it87.c renamed from drivers/i2c/chips.orig/it87.c +1 -1
@@ -226,7 +226,7 @@ .detach_client = it87_detach_client, }; -static int it87_id =0 ; +static int it87_id;static ssize_t show_in (struct device *dev,char *buf,int nr) {
drivers/i2c/chips/lm75.c renamed from drivers/i2c/chips.orig/lm75.c +1 -1
@@ -74,7 +74,7 @@ .detach_client = lm75_detach_client, }; -static int lm75_id =0 ; +static int lm75_id;#define show (value) \ static ssize_t show_##value(struct device *dev, char *buf) \
drivers/i2c/chips/lm77.c renamed from drivers/i2c/chips.orig/lm77.c +1 -1
@@ -83,7 +83,7 @@ .detach_client = lm77_detach_client, }; -static int lm77_id =0 ; +static int lm77_id;/* straight from the datasheet */ #define LM77_TEMP_MIN (-55000)
drivers/i2c/chips/lm80.c renamed from drivers/i2c/chips.orig/lm80.c +1 -1
@@ -145,7 +145,7 @@* Internal variables */ -static int lm80_id =0 ; +static int lm80_id;/* * Driver data (common to all clients)
drivers/i2c/chips/lm83.c renamed from drivers/i2c/chips.orig/lm83.c +1 -1
@@ -152,7 +152,7 @@* Internal variables */ -static int lm83_id =0 ; +static int lm83_id;/* * Sysfs stuff
drivers/i2c/chips/lm85.c renamed from drivers/i2c/chips.orig/lm85.c +1 -1
@@ -405,7 +405,7 @@ };/* Unique ID assigned to each LM85 detected */ -static int lm85_id =0 ; +static int lm85_id;/* 4 Fans */
drivers/i2c/chips/lm90.c renamed from drivers/i2c/chips.orig/lm90.c +1 -1
@@ -187,7 +187,7 @@* Internal variables */ -static int lm90_id =0 ; +static int lm90_id;/* * Sysfs stuff
drivers/i2c/chips/max1619.c renamed from drivers/i2c/chips.orig/max1619.c +1 -1
@@ -120,7 +120,7 @@* Internal variables */ -static int max1619_id =0 ; +static int max1619_id;/* * Sysfs stuff
drivers/i2c/chips/pcf8574.c renamed from drivers/i2c/chips.orig/pcf8574.c +1 -1
@@ -77,7 +77,7 @@ .detach_client = pcf8574_detach_client, }; -static int pcf8574_id =0 ; +static int pcf8574_id;/* following are the sysfs callback functions */ static ssize_t show_read (struct device *dev,char *buf)
drivers/i2c/chips/pcf8591.c renamed from drivers/i2c/chips.orig/pcf8591.c +1 -1
@@ -99,7 +99,7 @@ .detach_client = pcf8591_detach_client, }; -static int pcf8591_id =0 ; +static int pcf8591_id;/* following are the sysfs callback functions */ #define show_in_channel (channel) \
Signature · 2 lines
Jean "Khali" Delvare http://khali.linux-fr.org/
Greg KH
AppliedPATCH 1/1 I2C: Do not init global variables to 0
Quoted 4 lines · Jean Delvare
Hi Greg,
This trivial patch enforces the rule that global variables should not be explicitely initialized to 0 for all i2c chip drivers.
Applied, thanks.
greg k-h