* [PATCH] iio: humidity: htu21: Fix SYMBOLIC_PERMS chekcpatch warning
@ 2026-08-02 1:23 Adi Nata
2026-08-02 12:38 ` Uwe Kleine-König
2026-08-02 16:56 ` Jonathan Cameron
0 siblings, 2 replies; 3+ messages in thread
From: Adi Nata @ 2026-08-02 1:23 UTC (permalink / raw)
To: jic23, dlechner, nuno.sa, andy, u.kleine-koenig,
adinata.softwareengineer, dakr, bhelgaas, mazziesaccount,
linux-iio, linux-kernel
Cc: linux-kernel-mentees
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,
Signed-off-by: Adi Nata <adinata.softwareengineer@gmail.com>
---
drivers/iio/humidity/htu21.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/humidity/htu21.c b/drivers/iio/humidity/htu21.c
index a9dbf08b4f1a..fe7192d142ec 100644
--- a/drivers/iio/humidity/htu21.c
+++ b/drivers/iio/humidity/htu21.c
@@ -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[] = {
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] iio: humidity: htu21: Fix SYMBOLIC_PERMS chekcpatch warning
2026-08-02 1:23 [PATCH] iio: humidity: htu21: Fix SYMBOLIC_PERMS chekcpatch warning Adi Nata
@ 2026-08-02 12:38 ` Uwe Kleine-König
2026-08-02 16:56 ` Jonathan Cameron
1 sibling, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2026-08-02 12:38 UTC (permalink / raw)
To: Adi Nata
Cc: jic23, dlechner, nuno.sa, andy, dakr, bhelgaas, mazziesaccount,
linux-iio, linux-kernel, linux-kernel-mentees
[-- Attachment #1: Type: text/plain, Size: 53 bytes --]
Hello,
$Subject ~= s/chekc/check/
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: humidity: htu21: Fix SYMBOLIC_PERMS chekcpatch warning
2026-08-02 1:23 [PATCH] iio: humidity: htu21: Fix SYMBOLIC_PERMS chekcpatch warning Adi Nata
2026-08-02 12:38 ` Uwe Kleine-König
@ 2026-08-02 16:56 ` Jonathan Cameron
1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2026-08-02 16:56 UTC (permalink / raw)
To: Adi Nata
Cc: dlechner, nuno.sa, andy, u.kleine-koenig, dakr, bhelgaas,
mazziesaccount, linux-iio, linux-kernel, linux-kernel-mentees
On Sun, 2 Aug 2026 09:23:26 +0800
Adi Nata <adinata.softwareengineer@gmail.com> wrote:
> 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.
>
> Signed-off-by: Adi Nata <adinata.softwareengineer@gmail.com>
> ---
> drivers/iio/humidity/htu21.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/humidity/htu21.c b/drivers/iio/humidity/htu21.c
> index a9dbf08b4f1a..fe7192d142ec 100644
> --- a/drivers/iio/humidity/htu21.c
> +++ b/drivers/iio/humidity/htu21.c
> @@ -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.
> -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);
>
> static struct attribute *htu21_attributes[] = {
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-02 16:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-02 1:23 [PATCH] iio: humidity: htu21: Fix SYMBOLIC_PERMS chekcpatch warning Adi Nata
2026-08-02 12:38 ` Uwe Kleine-König
2026-08-02 16:56 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox