Commit 921e0f2f authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Greg Kroah-Hartman

w1: use octal for file permissions

Improve code readability and checkpatch warnings:

  WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230415104304.104134-6-krzysztof.kozlowski@linaro.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ad9c36be
...@@ -36,7 +36,7 @@ MODULE_PARM_DESC(active_pullup, "Active pullup (apply to all buses): " \ ...@@ -36,7 +36,7 @@ MODULE_PARM_DESC(active_pullup, "Active pullup (apply to all buses): " \
/* extra configurations - e.g. 1WS */ /* extra configurations - e.g. 1WS */
static int extra_config; static int extra_config;
module_param(extra_config, int, S_IRUGO | S_IWUSR); module_param(extra_config, int, 0644);
MODULE_PARM_DESC(extra_config, "Extra Configuration settings 1=APU,2=PPM,3=SPU,8=1WS"); MODULE_PARM_DESC(extra_config, "Extra Configuration settings 1=APU,2=PPM,3=SPU,8=1WS");
/* /*
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
static DECLARE_WAIT_QUEUE_HEAD(hdq_wait_queue); static DECLARE_WAIT_QUEUE_HEAD(hdq_wait_queue);
static int w1_id; static int w1_id;
module_param(w1_id, int, S_IRUSR); module_param(w1_id, int, 0400);
MODULE_PARM_DESC(w1_id, "1-wire id for the slave detection in HDQ mode"); MODULE_PARM_DESC(w1_id, "1-wire id for the slave detection in HDQ mode");
struct hdq_data { struct hdq_data {
......
...@@ -99,7 +99,7 @@ static struct bin_attribute w1_f12_sysfs_bin_files[NB_SYSFS_BIN_FILES] = { ...@@ -99,7 +99,7 @@ static struct bin_attribute w1_f12_sysfs_bin_files[NB_SYSFS_BIN_FILES] = {
{ {
.attr = { .attr = {
.name = "state", .name = "state",
.mode = S_IRUGO, .mode = 0444,
}, },
.size = 1, .size = 1,
.read = w1_f12_read_state, .read = w1_f12_read_state,
...@@ -107,7 +107,7 @@ static struct bin_attribute w1_f12_sysfs_bin_files[NB_SYSFS_BIN_FILES] = { ...@@ -107,7 +107,7 @@ static struct bin_attribute w1_f12_sysfs_bin_files[NB_SYSFS_BIN_FILES] = {
{ {
.attr = { .attr = {
.name = "output", .name = "output",
.mode = S_IRUGO | S_IWUSR | S_IWGRP, .mode = 0664,
}, },
.size = 1, .size = 1,
.write = w1_f12_write_output, .write = w1_f12_write_output,
......
...@@ -128,7 +128,7 @@ static ssize_t output_write(struct file *filp, struct kobject *kobj, ...@@ -128,7 +128,7 @@ static ssize_t output_write(struct file *filp, struct kobject *kobj,
return bytes_written; return bytes_written;
} }
static BIN_ATTR(output, S_IRUGO | S_IWUSR | S_IWGRP, NULL, output_write, 1); static BIN_ATTR(output, 0664, NULL, output_write, 1);
static struct bin_attribute *w1_f3a_bin_attrs[] = { static struct bin_attribute *w1_f3a_bin_attrs[] = {
&bin_attr_state, &bin_attr_state,
......
...@@ -264,7 +264,7 @@ static ssize_t w1_f0d_write_bin(struct file *filp, struct kobject *kobj, ...@@ -264,7 +264,7 @@ static ssize_t w1_f0d_write_bin(struct file *filp, struct kobject *kobj,
static struct bin_attribute w1_f0d_bin_attr = { static struct bin_attribute w1_f0d_bin_attr = {
.attr = { .attr = {
.name = "eeprom", .name = "eeprom",
.mode = S_IRUGO | S_IWUSR, .mode = 0644,
}, },
.size = W1_F0D_EEPROM_SIZE, .size = W1_F0D_EEPROM_SIZE,
.read = w1_f0d_read_bin, .read = w1_f0d_read_bin,
......
...@@ -31,12 +31,12 @@ MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_DS28E17)); ...@@ -31,12 +31,12 @@ MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_DS28E17));
/* Default I2C speed to be set when a DS28E17 is detected. */ /* Default I2C speed to be set when a DS28E17 is detected. */
static int i2c_speed = 100; static int i2c_speed = 100;
module_param_named(speed, i2c_speed, int, (S_IRUSR | S_IWUSR)); module_param_named(speed, i2c_speed, int, 0600);
MODULE_PARM_DESC(speed, "Default I2C speed to be set when a DS28E17 is detected"); MODULE_PARM_DESC(speed, "Default I2C speed to be set when a DS28E17 is detected");
/* Default I2C stretch value to be set when a DS28E17 is detected. */ /* Default I2C stretch value to be set when a DS28E17 is detected. */
static char i2c_stretch = 1; static char i2c_stretch = 1;
module_param_named(stretch, i2c_stretch, byte, (S_IRUSR | S_IWUSR)); module_param_named(stretch, i2c_stretch, byte, 0600);
MODULE_PARM_DESC(stretch, "Default I2C stretch value to be set when a DS28E17 is detected"); MODULE_PARM_DESC(stretch, "Default I2C stretch value to be set when a DS28E17 is detected");
/* DS28E17 device command codes. */ /* DS28E17 device command codes. */
......
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