Commit b65626b6 authored by Guenter Roeck's avatar Guenter Roeck

hwmon: (k8temp) Use permission specific SENSOR[_DEVICE]_ATTR variants

Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code,
to improve readability, and to reduce the chance of inconsistencies.

Also replace any remaining S_<PERMS> in the driver with octal values.

The conversion was done automatically with coccinelle. The semantic patches
and the scripts used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches/hwmon/.

This patch does not introduce functional changes. It was verified by
compiling the old and new files and comparing text and data sizes.

Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 4820d511
...@@ -109,8 +109,8 @@ static ssize_t name_show(struct device *dev, struct device_attribute ...@@ -109,8 +109,8 @@ static ssize_t name_show(struct device *dev, struct device_attribute
} }
static ssize_t show_temp(struct device *dev, static ssize_t temp_show(struct device *dev, struct device_attribute *devattr,
struct device_attribute *devattr, char *buf) char *buf)
{ {
struct sensor_device_attribute_2 *attr = struct sensor_device_attribute_2 *attr =
to_sensor_dev_attr_2(devattr); to_sensor_dev_attr_2(devattr);
...@@ -129,10 +129,10 @@ static ssize_t show_temp(struct device *dev, ...@@ -129,10 +129,10 @@ static ssize_t show_temp(struct device *dev,
/* core, place */ /* core, place */
static SENSOR_DEVICE_ATTR_2(temp1_input, S_IRUGO, show_temp, NULL, 0, 0); static SENSOR_DEVICE_ATTR_2_RO(temp1_input, temp, 0, 0);
static SENSOR_DEVICE_ATTR_2(temp2_input, S_IRUGO, show_temp, NULL, 0, 1); static SENSOR_DEVICE_ATTR_2_RO(temp2_input, temp, 0, 1);
static SENSOR_DEVICE_ATTR_2(temp3_input, S_IRUGO, show_temp, NULL, 1, 0); static SENSOR_DEVICE_ATTR_2_RO(temp3_input, temp, 1, 0);
static SENSOR_DEVICE_ATTR_2(temp4_input, S_IRUGO, show_temp, NULL, 1, 1); static SENSOR_DEVICE_ATTR_2_RO(temp4_input, temp, 1, 1);
static DEVICE_ATTR_RO(name); static DEVICE_ATTR_RO(name);
static const struct pci_device_id k8temp_ids[] = { static const struct pci_device_id k8temp_ids[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment