hwmon: (w83795) temp4_type has writable permission
Subsystems (2)
PATCH 1/1 hwmon: (w83795) temp4_type has writable permission
Signed-off-by Yao Wang <[email protected]>
Signed-off-by Huacai Chen <[email protected]>
--- drivers/hwmon/w83795.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/w83795.c +1 -1
@@ -1691,7 +1691,7 @@ store_sf_setup(struct device *dev, struct device_attribute *attr,* somewhere else in the code */ #define SENSOR_ATTR_TEMP (index) { \ - SENSOR_ATTR_2(temp##index##_type, S_IRUGO | (index < 4 ? S_IWUSR : 0), \ + SENSOR_ATTR_2(temp##index##_type, S_IRUGO | (index < 5 ? S_IWUSR : 0), \ show_temp_mode, store_temp_mode, NOT_USED, index - 1), \ SENSOR_ATTR_2(temp##index##_input, S_IRUGO, show_temp, \ NULL, TEMP_READ, index - 1), \
Signature · 1 line
2.7.0
Guenter Roeck
maintainerQuoted 2 lines · Huacai Chen
Signed-off-by Yao Wang <[email protected]>Signed-off-by Huacai Chen <[email protected]>
Sorry, that really lacks context. Please add some details.
Guenter
Quoted 20 lines
--- drivers/hwmon/w83795.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hwmon/w83795.c +1
-1@@ -1691,7 +1691,7 @@ store_sf_setup(struct device *dev, struct device_attribute *attr,* somewhere else in the code */ #define SENSOR_ATTR_TEMP (index) { \ - SENSOR_ATTR_2(temp##index##_type, S_IRUGO | (index < 4 ? S_IWUSR : 0), \ + SENSOR_ATTR_2(temp##index##_type, S_IRUGO | (index < 5 ? S_IWUSR : 0), \ show_temp_mode, store_temp_mode, NOT_USED, index - 1), \ SENSOR_ATTR_2(temp##index##_input, S_IRUGO, show_temp, \ NULL, TEMP_READ, index - 1), \Signature · 1 line
2.7.0
Both datasheet and the comments of store_temp_mode() tell us that temp1~4 is writable, so fix it.
Huacai
------------------ Original ------------------
From: "Guenter Roeck"<[email protected]>; Date: Thu, Nov 15, 2018 01:23 PM To: "Huacai Chen"<[email protected]>;
Cc: "Jean Delvare"<[email protected]>; "linux-hwmon"<[email protected]>; "Fuxin Zhang"<[email protected]>; "Yao Wang"<[email protected]>;
Subject: Re: [PATCH] hwmon: (w83795) temp4_type has writable permission
Quoted 2 lines · Huacai Chen
Signed-off-by Yao Wang <[email protected]>Signed-off-by Huacai Chen <[email protected]>
Sorry, that really lacks context. Please add some details.
Guenter
Quoted 20 lines
--- drivers/hwmon/w83795.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hwmon/w83795.c +1
-1@@ -1691,7 +1691,7 @@ store_sf_setup(struct device *dev, struct device_attribute *attr,* somewhere else in the code */ #define SENSOR_ATTR_TEMP (index) { \ - SENSOR_ATTR_2(temp##index##_type, S_IRUGO | (index < 4 ? S_IWUSR : 0), \ + SENSOR_ATTR_2(temp##index##_type, S_IRUGO | (index < 5 ? S_IWUSR : 0), \ show_temp_mode, store_temp_mode, NOT_USED, index - 1), \ SENSOR_ATTR_2(temp##index##_input, S_IRUGO, show_temp, \ NULL, TEMP_READ, index - 1), \Signature · 1 line
2.7.0
Quoted 2 lines · Huacai Chen
Signed-off-by Yao Wang <[email protected]>Signed-off-by Huacai Chen <[email protected]>
Applied, after adding separately sent description / rationale.
For future submission I would kindly suggest to send patches with complete descriptions.
Thanks,
Guenter
Quoted 17 lines
--- drivers/hwmon/w83795.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hwmon/w83795.c +1
-1@@ -1691,7 +1691,7 @@ store_sf_setup(struct device *dev, struct device_attribute *attr,* somewhere else in the code */ #define SENSOR_ATTR_TEMP (index) { \ - SENSOR_ATTR_2(temp##index##_type, S_IRUGO | (index < 4 ? S_IWUSR : 0), \ + SENSOR_ATTR_2(temp##index##_type, S_IRUGO | (index < 5 ? S_IWUSR : 0), \ show_temp_mode, store_temp_mode, NOT_USED, index - 1), \ SENSOR_ATTR_2(temp##index##_input, S_IRUGO, show_temp, \ NULL, TEMP_READ, index - 1), \