* [PATCH] iio: humidity: hts221: Fix checkpatch symbolic perms warning
@ 2026-08-02 1:49 Adi Nata
2026-08-02 17:14 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Adi Nata @ 2026-08-02 1:49 UTC (permalink / raw)
To: lorenzo, jic23, dlechner, nuno.sa, andy, linux-iio, linux-kernel
Cc: linux-kernel-mentees, Adi Nata
Checkpatch warning:
WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
+static IIO_DEVICE_ATTR(in_humidity_oversampling_ratio_available, S_IRUGO,
WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
+static IIO_DEVICE_ATTR(in_temp_oversampling_ratio_available, S_IRUGO,
Signed-off-by: Adi Nata <adinata.softwareengineer@gmail.com>
---
drivers/iio/humidity/hts221_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/humidity/hts221_core.c b/drivers/iio/humidity/hts221_core.c
index bfeb0a60d3af..bad98da100bd 100644
--- a/drivers/iio/humidity/hts221_core.c
+++ b/drivers/iio/humidity/hts221_core.c
@@ -521,9 +521,9 @@ static int hts221_validate_trigger(struct iio_dev *iio_dev,
return hw->trig == trig ? 0 : -EINVAL;
}
-static IIO_DEVICE_ATTR(in_humidity_oversampling_ratio_available, S_IRUGO,
+static IIO_DEVICE_ATTR(in_humidity_oversampling_ratio_available, 0444,
hts221_sysfs_rh_oversampling_avail, NULL, 0);
-static IIO_DEVICE_ATTR(in_temp_oversampling_ratio_available, S_IRUGO,
+static IIO_DEVICE_ATTR(in_temp_oversampling_ratio_available, 0444,
hts221_sysfs_temp_oversampling_avail, NULL, 0);
static IIO_DEV_ATTR_SAMP_FREQ_AVAIL(hts221_sysfs_sampling_freq);
--
2.47.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iio: humidity: hts221: Fix checkpatch symbolic perms warning
2026-08-02 1:49 [PATCH] iio: humidity: hts221: Fix checkpatch symbolic perms warning Adi Nata
@ 2026-08-02 17:14 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2026-08-02 17:14 UTC (permalink / raw)
To: Adi Nata
Cc: lorenzo, dlechner, nuno.sa, andy, linux-iio, linux-kernel,
linux-kernel-mentees
On Sun, 2 Aug 2026 09:49:45 +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(in_humidity_oversampling_ratio_available, S_IRUGO,
>
> WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
> +static IIO_DEVICE_ATTR(in_temp_oversampling_ratio_available, S_IRUGO,
>
> Signed-off-by: Adi Nata <adinata.softwareengineer@gmail.com>
Hi Adi,
Rather than doing this minor change please take on making these
report via the read_avail() callback.
This is a reasonably old driver, so some of that infrastructure may
not have existed back then. Moving to the callback makes the
available info accessible to in kernel consumers and ensures correct
formatting etc.
To make that sort of change you'll need to work out how to test it.
Probably just commenting out accesses to the device and reading only
the files you are affecting will be enough here.
Thanks,
Jonathan
> ---
> drivers/iio/humidity/hts221_core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/humidity/hts221_core.c b/drivers/iio/humidity/hts221_core.c
> index bfeb0a60d3af..bad98da100bd 100644
> --- a/drivers/iio/humidity/hts221_core.c
> +++ b/drivers/iio/humidity/hts221_core.c
> @@ -521,9 +521,9 @@ static int hts221_validate_trigger(struct iio_dev *iio_dev,
> return hw->trig == trig ? 0 : -EINVAL;
> }
>
> -static IIO_DEVICE_ATTR(in_humidity_oversampling_ratio_available, S_IRUGO,
> +static IIO_DEVICE_ATTR(in_humidity_oversampling_ratio_available, 0444,
> hts221_sysfs_rh_oversampling_avail, NULL, 0);
> -static IIO_DEVICE_ATTR(in_temp_oversampling_ratio_available, S_IRUGO,
> +static IIO_DEVICE_ATTR(in_temp_oversampling_ratio_available, 0444,
> hts221_sysfs_temp_oversampling_avail, NULL, 0);
> static IIO_DEV_ATTR_SAMP_FREQ_AVAIL(hts221_sysfs_sampling_freq);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-02 17:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-02 1:49 [PATCH] iio: humidity: hts221: Fix checkpatch symbolic perms warning Adi Nata
2026-08-02 17:14 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox