Skip to contentSkip to conversation

hwmon: I2C addresses are constant

PATCH In review Jean Delvare 2 participants 2 messages Oct 8, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: I2C addresses are constant

We can mark normal_i2c const. Almost all drivers do that already, so fix the 3 remaining ones before they are used as (bad) examples for new drivers.

---
 drivers/hwmon/adt7475.c |    2 +-
 drivers/hwmon/asc7621.c |    4 ++--
 drivers/hwmon/tmp421.c  |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/hwmon/adt7475.c +1 -1
@@ -146,7 +146,7 @@
 #define TEMP_OFFSET_REG(idx) (REG_TEMP_OFFSET_BASE + (idx))
 #define TEMP_TRANGE_REG(idx) (REG_TEMP_TRANGE_BASE + (idx))
 
-static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
+static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
 
 enum chips { adt7473, adt7475, adt7476, adt7490 };
 
drivers/hwmon/asc7621.c +2 -2
@@ -28,7 +28,7 @@
 #include <linux/mutex.h>
 
 /* Addresses to scan */
-static unsigned short normal_i2c[] = {
+static const unsigned short normal_i2c[] = {
 	0x2c, 0x2d, 0x2e, I2C_CLIENT_END
 };
 
@@ -52,7 +52,7 @@ struct asc7621_chip {
 	u8 company_id;
 	u8 verstep_reg;
 	u8 verstep_id;
-	unsigned short *addresses;
+	const unsigned short *addresses;
 };
 
 static struct asc7621_chip asc7621_chips[] = {
drivers/hwmon/tmp421.c +2 -2
@@ -36,8 +36,8 @@
 #include <linux/sysfs.h>
 
 /* Addresses to scan */
-static unsigned short normal_i2c[] = { 0x2a, 0x4c, 0x4d, 0x4e, 0x4f,
-				       I2C_CLIENT_END };
+static const unsigned short normal_i2c[] = { 0x2a, 0x4c, 0x4d, 0x4e, 0x4f,
+					     I2C_CLIENT_END };
 
 enum chips { tmp421, tmp422, tmp423 };
 
Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jean Delvare

We can mark normal_i2c const. Almost all drivers do that already, so fix the 3 remaining ones before they are used as (bad) examples for new drivers.

Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors