From: Peter Huewe <peterhuewe@gmx.de>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Jean Delvare <jdelvare@suse.com>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
Peter Huewe <peterhuewe@gmx.de>
Subject: [PATCH 2/5] w83627ehf: Use octal values for access rights of sysfs files
Date: Thu, 23 Mar 2017 14:03:05 +0100 [thread overview]
Message-ID: <20170323130308.29166-2-peterhuewe@gmx.de> (raw)
In-Reply-To: <20170323130308.29166-1-peterhuewe@gmx.de>
As indicated by checkpatch, use the octal representation for the access
rights.
S_IWUSR | S_IRUGO => 0644
S_IRUGO => 0444
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
drivers/hwmon/w83627ehf.c | 52 ++++++++++++++++++++---------------------------
1 file changed, 22 insertions(+), 30 deletions(-)
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index f2f33dd35fd4..0acadeece509 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -1098,25 +1098,17 @@ store_tolerance(struct device *dev, struct device_attribute *attr,
}
static struct sensor_device_attribute sda_target_temp[] = {
- SENSOR_ATTR(pwm1_target, S_IWUSR | S_IRUGO, show_target_temp,
- store_target_temp, 0),
- SENSOR_ATTR(pwm2_target, S_IWUSR | S_IRUGO, show_target_temp,
- store_target_temp, 1),
- SENSOR_ATTR(pwm3_target, S_IWUSR | S_IRUGO, show_target_temp,
- store_target_temp, 2),
- SENSOR_ATTR(pwm4_target, S_IWUSR | S_IRUGO, show_target_temp,
- store_target_temp, 3),
+ SENSOR_ATTR(pwm1_target, 0644, show_target_temp, store_target_temp, 0),
+ SENSOR_ATTR(pwm2_target, 0644, show_target_temp, store_target_temp, 1),
+ SENSOR_ATTR(pwm3_target, 0644, show_target_temp, store_target_temp, 2),
+ SENSOR_ATTR(pwm4_target, 0644, show_target_temp, store_target_temp, 3),
};
static struct sensor_device_attribute sda_tolerance[] = {
- SENSOR_ATTR(pwm1_tolerance, S_IWUSR | S_IRUGO, show_tolerance,
- store_tolerance, 0),
- SENSOR_ATTR(pwm2_tolerance, S_IWUSR | S_IRUGO, show_tolerance,
- store_tolerance, 1),
- SENSOR_ATTR(pwm3_tolerance, S_IWUSR | S_IRUGO, show_tolerance,
- store_tolerance, 2),
- SENSOR_ATTR(pwm4_tolerance, S_IWUSR | S_IRUGO, show_tolerance,
- store_tolerance, 3),
+ SENSOR_ATTR(pwm1_tolerance, 0644, show_tolerance, store_tolerance, 0),
+ SENSOR_ATTR(pwm2_tolerance, 0644, show_tolerance, store_tolerance, 1),
+ SENSOR_ATTR(pwm3_tolerance, 0644, show_tolerance, store_tolerance, 2),
+ SENSOR_ATTR(pwm4_tolerance, 0644, show_tolerance, store_tolerance, 3),
};
/* Smart Fan registers */
@@ -1194,24 +1186,24 @@ store_##reg(struct device *dev, struct device_attribute *attr, \
fan_time_functions(fan_stop_time, FAN_STOP_TIME)
static struct sensor_device_attribute sda_sf3_arrays_fan4[] = {
- SENSOR_ATTR(pwm4_stop_time, S_IWUSR | S_IRUGO, show_fan_stop_time,
+ SENSOR_ATTR(pwm4_stop_time, 0644, show_fan_stop_time,
store_fan_stop_time, 3),
- SENSOR_ATTR(pwm4_start_output, S_IWUSR | S_IRUGO, show_fan_start_output,
+ SENSOR_ATTR(pwm4_start_output, 0644, show_fan_start_output,
store_fan_start_output, 3),
- SENSOR_ATTR(pwm4_stop_output, S_IWUSR | S_IRUGO, show_fan_stop_output,
+ SENSOR_ATTR(pwm4_stop_output, 0644, show_fan_stop_output,
store_fan_stop_output, 3),
- SENSOR_ATTR(pwm4_max_output, S_IWUSR | S_IRUGO, show_fan_max_output,
+ SENSOR_ATTR(pwm4_max_output, 0644, show_fan_max_output,
store_fan_max_output, 3),
- SENSOR_ATTR(pwm4_step_output, S_IWUSR | S_IRUGO, show_fan_step_output,
+ SENSOR_ATTR(pwm4_step_output, 0644, show_fan_step_output,
store_fan_step_output, 3),
};
static struct sensor_device_attribute sda_sf3_arrays_fan3[] = {
- SENSOR_ATTR(pwm3_stop_time, S_IWUSR | S_IRUGO, show_fan_stop_time,
+ SENSOR_ATTR(pwm3_stop_time, 0644, show_fan_stop_time,
store_fan_stop_time, 2),
- SENSOR_ATTR(pwm3_start_output, S_IWUSR | S_IRUGO, show_fan_start_output,
+ SENSOR_ATTR(pwm3_start_output, 0644, show_fan_start_output,
store_fan_start_output, 2),
- SENSOR_ATTR(pwm3_stop_output, S_IWUSR | S_IRUGO, show_fan_stop_output,
+ SENSOR_ATTR(pwm3_stop_output, 0644, show_fan_stop_output,
store_fan_stop_output, 2),
};
@@ -1233,17 +1225,17 @@ static SENSOR_DEVICE_ATTR(pwm2_stop_output, 0644, show_fan_stop_output,
* Need to check support while generating/removing attribute files.
*/
static struct sensor_device_attribute sda_sf3_max_step_arrays[] = {
- SENSOR_ATTR(pwm1_max_output, S_IWUSR | S_IRUGO, show_fan_max_output,
+ SENSOR_ATTR(pwm1_max_output, 0644, show_fan_max_output,
store_fan_max_output, 0),
- SENSOR_ATTR(pwm1_step_output, S_IWUSR | S_IRUGO, show_fan_step_output,
+ SENSOR_ATTR(pwm1_step_output, 0644, show_fan_step_output,
store_fan_step_output, 0),
- SENSOR_ATTR(pwm2_max_output, S_IWUSR | S_IRUGO, show_fan_max_output,
+ SENSOR_ATTR(pwm2_max_output, 0644, show_fan_max_output,
store_fan_max_output, 1),
- SENSOR_ATTR(pwm2_step_output, S_IWUSR | S_IRUGO, show_fan_step_output,
+ SENSOR_ATTR(pwm2_step_output, 0644, show_fan_step_output,
store_fan_step_output, 1),
- SENSOR_ATTR(pwm3_max_output, S_IWUSR | S_IRUGO, show_fan_max_output,
+ SENSOR_ATTR(pwm3_max_output, 0644, show_fan_max_output,
store_fan_max_output, 2),
- SENSOR_ATTR(pwm3_step_output, S_IWUSR | S_IRUGO, show_fan_step_output,
+ SENSOR_ATTR(pwm3_step_output, 0644, show_fan_step_output,
store_fan_step_output, 2),
};
--
2.10.2
next prev parent reply other threads:[~2017-03-23 13:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-23 13:03 [PATCH 1/5] w83627ehf: Use hwmon_device_register_with_info and sensor groups Peter Huewe
2017-03-23 13:03 ` Peter Huewe [this message]
2017-03-23 13:03 ` [PATCH 3/5] w83627ehf: Minor readability fixes Peter Huewe
2017-03-23 13:03 ` [PATCH 4/5] w83627ehf: Drop FSFE template and replace with SPDX License information Peter Huewe
2017-03-23 13:03 ` [PATCH 5/5] w83627ehf: Drop support for nct6775/nct6776 Peter Huewe
2017-03-23 13:05 ` [PATCH 1/5] w83627ehf: Use hwmon_device_register_with_info and sensor groups Peter Hüwe
2017-03-23 13:11 ` Guenter Roeck
2017-03-23 18:43 ` Guenter Roeck
2017-03-23 18:55 ` Peter Huewe
2017-03-23 19:07 ` Guenter Roeck
2017-05-17 19:34 ` [1/5] " Alexander Sverdlin
2017-05-17 19:35 ` Alexander Sverdlin
2017-05-17 20:35 ` Peter Huewe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170323130308.29166-2-peterhuewe@gmx.de \
--to=peterhuewe@gmx.de \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®