Skip to contentSkip to conversation

hwmon: (pmbus) Increase attribute name

PATCH Superseded Guenter Roeck 1 participant 2 messages Jul 12, 2011 – Jul 14, 2011 Hardware monitoring

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 5/15 hwmon: (pmbus) Increase attribute name

Some hwmon sysfs attributes have a length of 20 bytes (plus terminating 0). I2C_NAME_SIZE is defined as 20 and thus can not be used to define the length of hwmon sysfs attributes. Replace it with PMBUS_NAME_SIZE, set to 24.

---
 drivers/hwmon/pmbus/pmbus_core.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
drivers/hwmon/pmbus/pmbus_core.c +6 -4
index cef763c..8ff7ebf 100644
@@ -74,8 +74,10 @@
 #define PB_STATUS_INPUT_BASE	(PB_STATUS_FAN34_BASE + PMBUS_PAGES)
 #define PB_STATUS_TEMP_BASE	(PB_STATUS_INPUT_BASE + 1)
 
+#define PMBUS_NAME_SIZE		24
+
 struct pmbus_sensor {
-	char name[I2C_NAME_SIZE];	/* sysfs sensor name */
+	char name[PMBUS_NAME_SIZE];	/* sysfs sensor name */
 	struct sensor_device_attribute attribute;
 	u8 page;		/* page number */
 	u8 reg;			/* register */
@@ -86,14 +88,14 @@ struct pmbus_sensor {
 };
 
 struct pmbus_boolean {
-	char name[I2C_NAME_SIZE];	/* sysfs boolean name */
+	char name[PMBUS_NAME_SIZE];	/* sysfs boolean name */
 	struct sensor_device_attribute attribute;
 };
 
 struct pmbus_label {
-	char name[I2C_NAME_SIZE];	/* sysfs label name */
+	char name[PMBUS_NAME_SIZE];	/* sysfs label name */
 	struct sensor_device_attribute attribute;
-	char label[I2C_NAME_SIZE];	/* label */
+	char label[PMBUS_NAME_SIZE];	/* label */
 };
 
 struct pmbus_data {
Signature · 7 lines
1.7.3.1


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

PATCH 5/15 hwmon: (pmbus) Increase attribute name

Some hwmon sysfs attributes have a length of 20 bytes (plus terminating 0). I2C_NAME_SIZE is defined as 20 and thus can not be used to define the length of hwmon sysfs attributes. Replace it with PMBUS_NAME_SIZE, set to 24.

---
 drivers/hwmon/pmbus/pmbus_core.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
drivers/hwmon/pmbus/pmbus_core.c +6 -4
index cef763c..8ff7ebf 100644
@@ -74,8 +74,10 @@
 #define PB_STATUS_INPUT_BASE	(PB_STATUS_FAN34_BASE + PMBUS_PAGES)
 #define PB_STATUS_TEMP_BASE	(PB_STATUS_INPUT_BASE + 1)
 
+#define PMBUS_NAME_SIZE		24
+
 struct pmbus_sensor {
-	char name[I2C_NAME_SIZE];	/* sysfs sensor name */
+	char name[PMBUS_NAME_SIZE];	/* sysfs sensor name */
 	struct sensor_device_attribute attribute;
 	u8 page;		/* page number */
 	u8 reg;			/* register */
@@ -86,14 +88,14 @@ struct pmbus_sensor {
 };
 
 struct pmbus_boolean {
-	char name[I2C_NAME_SIZE];	/* sysfs boolean name */
+	char name[PMBUS_NAME_SIZE];	/* sysfs boolean name */
 	struct sensor_device_attribute attribute;
 };
 
 struct pmbus_label {
-	char name[I2C_NAME_SIZE];	/* sysfs label name */
+	char name[PMBUS_NAME_SIZE];	/* sysfs label name */
 	struct sensor_device_attribute attribute;
-	char label[I2C_NAME_SIZE];	/* label */
+	char label[PMBUS_NAME_SIZE];	/* label */
 };
 
 struct pmbus_data {
Signature · 7 lines
1.7.3.1


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