From: Jonathan Cameron <jic23@kernel.org>
To: Vasileios Amoiridis <vassilisamir@gmail.com>
Cc: lars@metafoo.de, andriy.shevchenko@linux.intel.com,
ang.iglesiasg@gmail.com, mazziesaccount@gmail.com,
ak@it-klinger.de, petre.rodan@subdimension.ro,
phil@raspberrypi.com, 579lpy@gmail.com, linus.walleij@linaro.org,
semen.protsenko@linaro.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org,
Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH v3 2/6] iio: pressure: Introduce new cleanup routines to BMP280 driver *_raw() functions
Date: Sun, 24 Mar 2024 11:20:02 +0000 [thread overview]
Message-ID: <20240324112002.3173a269@jic23-huawei> (raw)
In-Reply-To: <20240319002925.2121016-3-vassilisamir@gmail.com>
On Tue, 19 Mar 2024 01:29:21 +0100
Vasileios Amoiridis <vassilisamir@gmail.com> wrote:
> Introduce the new linux/cleanup.h with the guard(mutex) functionality
> in the {read/write}_raw() functions
>
> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
> ---
> drivers/iio/pressure/bmp280-core.c | 125 +++++++++++++----------------
> 1 file changed, 58 insertions(+), 67 deletions(-)
>
> diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
> index 871b2214121b..f7a13ff6f26c 100644
> --- a/drivers/iio/pressure/bmp280-core.c
> +++ b/drivers/iio/pressure/bmp280-core.c
> @@ -460,77 +460,74 @@ static int bmp280_read_humid(struct bmp280_data *data, int *val, int *val2)
> return IIO_VAL_INT;
> }
>
> -static int bmp280_read_raw(struct iio_dev *indio_dev,
> - struct iio_chan_spec const *chan,
> - int *val, int *val2, long mask)
> +static int bmp280_read_raw_guarded(struct iio_dev *indio_dev,
Why do we need the guarded naming? It always took the lock, no
change just because we are doing that in a neater fashion.
I don't see a reason for that name. Better to use something like
_impl, or _internal as the prefix.
I don't want to see people calling every function that uses guard
_guarded().
> + struct iio_chan_spec const *chan,
> + int *val, int *val2, long mask)
Otherwise, I didn't find anything beyond what Andy already pointed out.
So looks good in general.
Jonathan
next prev parent reply other threads:[~2024-03-24 11:20 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-19 0:29 [PATCH v3 0/6] Series to add triggered buffer support to BMP280 driver Vasileios Amoiridis
2024-03-19 0:29 ` [PATCH v3 1/6] iio: pressure: BMP280 core driver headers sorting Vasileios Amoiridis
2024-03-20 11:00 ` Andy Shevchenko
2024-03-24 11:14 ` Jonathan Cameron
2024-03-19 0:29 ` [PATCH v3 2/6] iio: pressure: Introduce new cleanup routines to BMP280 driver *_raw() functions Vasileios Amoiridis
2024-03-20 11:00 ` Andy Shevchenko
2024-03-20 11:04 ` Andy Shevchenko
2024-03-24 11:20 ` Jonathan Cameron [this message]
2024-03-19 0:29 ` [PATCH v3 3/6] iio: pressure: Generalize read_{temp/press/humid}() functions Vasileios Amoiridis
2024-03-20 11:04 ` Andy Shevchenko
2024-03-24 11:36 ` Jonathan Cameron
2024-04-02 17:55 ` Vasileios Amoiridis
2024-04-06 10:02 ` Jonathan Cameron
2024-03-19 0:29 ` [PATCH v3 4/6] iio: pressure: Add SCALE and RAW values for channels Vasileios Amoiridis
2024-03-20 11:05 ` Andy Shevchenko
2024-03-19 0:29 ` [PATCH v3 5/6] iio: pressure: Add timestamp and scan_masks for BMP280 driver Vasileios Amoiridis
2024-03-20 11:07 ` Andy Shevchenko
2024-03-20 18:45 ` Vasileios Amoiridis
2024-03-20 20:38 ` Andy Shevchenko
2024-03-20 21:31 ` Vasileios Amoiridis
2024-03-21 11:22 ` Andy Shevchenko
2024-03-24 11:43 ` Jonathan Cameron
2024-03-19 0:29 ` [PATCH v3 6/6] iio: pressure: Add triggered buffer support " Vasileios Amoiridis
2024-03-20 11:16 ` Andy Shevchenko
2024-03-20 17:46 ` Vasileios Amoiridis
2024-03-20 21:25 ` Andy Shevchenko
2024-03-20 21:35 ` Vasileios Amoiridis
2024-03-24 11:55 ` Jonathan Cameron
2024-03-24 12:14 ` Jonathan Cameron
2024-04-02 18:08 ` Vasileios Amoiridis
2024-04-06 10:02 ` Jonathan Cameron
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=20240324112002.3173a269@jic23-huawei \
--to=jic23@kernel.org \
--cc=579lpy@gmail.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=ak@it-klinger.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=ang.iglesiasg@gmail.com \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mazziesaccount@gmail.com \
--cc=petre.rodan@subdimension.ro \
--cc=phil@raspberrypi.com \
--cc=semen.protsenko@linaro.org \
--cc=vassilisamir@gmail.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