Skip to contentSkip to conversation

iio: humidity: htu21: Fix SYMBOLIC_PERMS chekcpatch warning

PATCH In review Adi Nata 4 participants 4 messages Aug 2 – Aug 8 IIO

lore
Share & tools
lore

Adi Nata

author
#0 lore raw

PATCH 1/1 iio: humidity: htu21: Fix SYMBOLIC_PERMS chekcpatch warning

Checkpatch warning:

WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. +static IIO_DEVICE_ATTR(battery_low, S_IRUGO,

WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'. +static IIO_DEVICE_ATTR(heater_enable, S_IRUGO | S_IWUSR,

---
 drivers/iio/humidity/htu21.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/humidity/htu21.c +2 -2
index a9dbf08b4f1a..fe7192d142ec 100644
@@ -154,9 +154,9 @@ static ssize_t htu21_write_heater(struct device *dev,
 }
 
 static IIO_CONST_ATTR_SAMP_FREQ_AVAIL(htu21_show_samp_freq);
-static IIO_DEVICE_ATTR(battery_low, S_IRUGO,
+static IIO_DEVICE_ATTR(battery_low, 0444,
 		       htu21_show_battery_low, NULL, 0);
-static IIO_DEVICE_ATTR(heater_enable, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(heater_enable, 0644,
 		       htu21_show_heater, htu21_write_heater, 0);
 
 static struct attribute *htu21_attributes[] = {
Signature · 1 line
2.47.3
maintainer
#2 lore raw
In reply to Adi Nata
Quoted 7 lines · On Sun, 2 Aug 2026 09:23:26 +0800 Adi Nata…

Checkpatch warning:

WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. +static IIO_DEVICE_ATTR(battery_low, S_IRUGO,

WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'. +static IIO_DEVICE_ATTR(heater_enable, S_IRUGO | S_IWUSR,

Would be nice to have some information on why they are not preferred as part of the patch description.

Quoted 11 lines
---
 drivers/iio/humidity/htu21.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/humidity/htu21.c +0 -0
index a9dbf08b4f1a..fe7192d142ec 100644

drivers/iio/humidity/htu21.c static ssize_t htu21_write_heater(struct device *dev, · line 158

Quoted 6 lines
drivers/iio/humidity/htu21.c +1 -1
@@ -154,9 +154,9 @@ static ssize_t htu21_write_heater(struct device *dev,
 }
 
 static IIO_CONST_ATTR_SAMP_FREQ_AVAIL(htu21_show_samp_freq);
-static IIO_DEVICE_ATTR(battery_low, S_IRUGO,
+static IIO_DEVICE_ATTR(battery_low, 0444,
 		       htu21_show_battery_low, NULL, 0);

Now fits on one line.

drivers/iio/humidity/htu21.c static ssize_t htu21_write_heater(struct device *dev, · line 160

Quoted 3 lines
drivers/iio/humidity/htu21.c +1 -1
-static IIO_DEVICE_ATTR(heater_enable, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(heater_enable, 0644,
 		       htu21_show_heater, htu21_write_heater, 0);

I don't mind having this one on a single line as well even though it is a bit over the 80 chars soft limit at around 84 chars.

static IIO_DEVICE_ATTR(heater_enable, 0644, htu21_show_heater, htu21_write_heater, 0);

Quoted 2 lines
drivers/iio/humidity/htu21.c +0 -0
 static struct attribute *htu21_attributes[] = {
#3 lore raw
In reply to Adi Nata
Quoted 6 lines · Adi Nata

Checkpatch warning:

WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. +static IIO_DEVICE_ATTR(battery_low, S_IRUGO,

WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'.

drivers/iio/humidity/htu21.c static ssize_t htu21_write_heater(struct device *dev, · line 160

Quoted 9 lines
drivers/iio/humidity/htu21.c +3 -2
+static IIO_DEVICE_ATTR(heater_enable, S_IRUGO | S_IWUSR,
 
 static IIO_CONST_ATTR_SAMP_FREQ_AVAIL(htu21_show_samp_freq);
-static IIO_DEVICE_ATTR(battery_low, S_IRUGO,
+static IIO_DEVICE_ATTR(battery_low, 0444,
 		       htu21_show_battery_low, NULL, 0);
-static IIO_DEVICE_ATTR(heater_enable, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(heater_enable, 0644,
 		       htu21_show_heater, htu21_write_heater, 0);

What's wrong with IIO_DEVICE_ATTR_RW()?

Same comment to all patches of a kind from you.

Signature · 2 lines
With Best Regards,
Andy Shevchenko