From: Cosmin Tanislav <demonsingur@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "cosmin.tanislav@analog.com" <cosmin.tanislav@analog.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Rob Herring <robh+dt@kernel.org>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH v2 3/3] iio: addac: ad74413r: correct comparator gpio getters mask usage
Date: Tue, 11 Jan 2022 09:29:15 +0200 [thread overview]
Message-ID: <9d98ad20-617d-b57f-3b87-e001b6999fba@gmail.com> (raw)
In-Reply-To: <CAHp75VckhARFUX3F0F7MLiHzpdqgKiVpDxoYNZVwSsB7ZK2=hQ@mail.gmail.com>
On 1/11/22 01:14, Andy Shevchenko wrote:
>
>
> On Tuesday, January 11, 2022, Cosmin Tanislav <demonsingur@gmail.com
> <mailto:demonsingur@gmail.com>> wrote:
>
> The value of the GPIOs is currently altered using offsets rather
> than masks. Make use of __assign_bit and the BIT macro to turn
> the offsets into masks.
>
> Fixes: fea251b6a5db ("iio: addac: add AD74413R driver")
> Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com
> <mailto:cosmin.tanislav@analog.com>>
> ---
> V1 -> V2
> * add Fixes tag
> * use __assign_bit
> * remove bitmap_zero
> ---
> drivers/iio/addac/ad74413r.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/addac/ad74413r.c b/drivers/iio/addac/ad74413r.c
> index 3d089c0b6f7a..8a8d60e592a8 100644
> --- a/drivers/iio/addac/ad74413r.c
> +++ b/drivers/iio/addac/ad74413r.c
> @@ -134,7 +134,6 @@ struct ad74413r_state {
> #define AD74413R_CH_EN_MASK(x) BIT(x)
>
> #define AD74413R_REG_DIN_COMP_OUT 0x25
> -#define AD74413R_DIN_COMP_OUT_SHIFT_X(x) x
>
> #define AD74413R_REG_ADC_RESULT_X(x) (0x26 + (x))
> #define AD74413R_ADC_RESULT_MAX GENMASK(15, 0)
> @@ -316,7 +315,7 @@ static int ad74413r_gpio_get(struct gpio_chip
> *chip, unsigned int offset)
> if (ret)
> return ret;
>
> - status &= AD74413R_DIN_COMP_OUT_SHIFT_X(real_offset);
> + status &= BIT(real_offset);
>
> return status ? 1 : 0;
> }
> @@ -336,9 +335,7 @@ static int ad74413r_gpio_get_multiple(struct
> gpio_chip *chip,
>
> for_each_set_bit(offset, mask, chip->ngpio) {
> unsigned int real_offset =
> st->comp_gpio_offsets[offset];
>
> -
>
>
> This blank line should be kept. Isn’t checkpatch complaining about?
Nope, doesn't seem to, even with the --strict option.
>
> - if (val & BIT(real_offset))
> - *bits |= offset;
> + __assign_bit(offset, bits, val & BIT(real_offset));
> }
>
> return ret;
> --
> 2.34.1
>
>
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
prev parent reply other threads:[~2022-01-11 7:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-10 22:05 [PATCH v2 1/3] iio: addac: ad74413r: use ngpio size when iterating over mask Cosmin Tanislav
2022-01-10 22:05 ` [PATCH v2 2/3] iio: addac: ad74413r: for_each_set_bit_from -> for_each_set_bit Cosmin Tanislav
2022-01-10 22:05 ` [PATCH v2 3/3] iio: addac: ad74413r: correct comparator gpio getters mask usage Cosmin Tanislav
[not found] ` <CAHp75VezW0DTvjLb6wOOf+skCv5-bDV38ozNaCq1wX+Oekarfw@mail.gmail.com>
2022-01-11 7:26 ` Cosmin Tanislav
[not found] ` <CAHp75VckhARFUX3F0F7MLiHzpdqgKiVpDxoYNZVwSsB7ZK2=hQ@mail.gmail.com>
2022-01-11 7:29 ` Cosmin Tanislav [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=9d98ad20-617d-b57f-3b87-e001b6999fba@gmail.com \
--to=demonsingur@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy.shevchenko@gmail.com \
--cc=brgl@bgdev.pl \
--cc=cosmin.tanislav@analog.com \
--cc=devicetree@vger.kernel.org \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
/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
all inboxes | Powered by JetHome®