Linux Kernel Mentees list
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Adi Nata <adinata.softwareengineer@gmail.com>
Cc: lorenzo@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
	andy@kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-kernel-mentees@lists.linux.dev
Subject: Re: [PATCH] iio: humidity: hts221: Fix checkpatch symbolic perms warning
Date: Sun, 2 Aug 2026 18:14:49 +0100	[thread overview]
Message-ID: <20260802181449.12b7e117@jic23-huawei> (raw)
In-Reply-To: <20260802014945.17221-1-adinata.softwareengineer@gmail.com>

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);
>  


      reply	other threads:[~2026-08-02 17:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-02  1:49 [PATCH] iio: humidity: hts221: Fix checkpatch symbolic perms warning Adi Nata
2026-08-02 17:14 ` Jonathan Cameron [this message]

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=20260802181449.12b7e117@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=adinata.softwareengineer@gmail.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=nuno.sa@analog.com \
    /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