* [PATCH] iio: adc: nxp-sar-adc: Remove unnecessary type casting
@ 2026-02-21 18:09 Felix Gu
2026-02-22 16:03 ` Jonathan Cameron
0 siblings, 1 reply; 4+ messages in thread
From: Felix Gu @ 2026-02-21 18:09 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko
Cc: linux-iio, linux-kernel, Felix Gu
The readl_poll_timeout() macro returns a signed integer error code.
In nxp_sar_adc_calibration_wait(), the return value is casted to u32
before being returned as int, which is unnecessary.
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
drivers/iio/adc/nxp-sar-adc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/adc/nxp-sar-adc.c b/drivers/iio/adc/nxp-sar-adc.c
index 9efa883c277d..a6e4888a8464 100644
--- a/drivers/iio/adc/nxp-sar-adc.c
+++ b/drivers/iio/adc/nxp-sar-adc.c
@@ -247,7 +247,8 @@ static inline void nxp_sar_adc_calibration_start(void __iomem *base)
static inline int nxp_sar_adc_calibration_wait(void __iomem *base)
{
- u32 msr, ret;
+ u32 msr;
+ int ret;
ret = readl_poll_timeout(NXP_SAR_ADC_MSR(base), msr,
!FIELD_GET(NXP_SAR_ADC_MSR_CALBUSY, msr),
---
base-commit: d4906ae14a5f136ceb671bb14cedbf13fa560da6
change-id: 20260222-nxp-sar-adc-1906a65ce5b6
Best regards,
--
Felix Gu <ustc.gu@gmail.com>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: adc: nxp-sar-adc: Remove unnecessary type casting
2026-02-21 18:09 [PATCH] iio: adc: nxp-sar-adc: Remove unnecessary type casting Felix Gu
@ 2026-02-22 16:03 ` Jonathan Cameron
2026-02-22 16:38 ` Felix Gu
0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2026-02-22 16:03 UTC (permalink / raw)
To: Felix Gu
Cc: David Lechner, Nuno Sá, Andy Shevchenko, linux-iio,
linux-kernel, Daniel Lezcano
On Sun, 22 Feb 2026 02:09:08 +0800
Felix Gu <ustc.gu@gmail.com> wrote:
> The readl_poll_timeout() macro returns a signed integer error code.
>
> In nxp_sar_adc_calibration_wait(), the return value is casted to u32
> before being returned as int, which is unnecessary.
>
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Hi Felix,
Make sure to include the author of the code you are touching in the +CC list.
Added Daniel.
I think this is simple enough, so I've picked it up now but I'm fine adding
tags or indeed dropping it if other reviews come in. I'll be rebasing
or rc1 later in the week.
Applied to the testing branch of iio.git
Thanks,
Jonathan
> ---
> drivers/iio/adc/nxp-sar-adc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/nxp-sar-adc.c b/drivers/iio/adc/nxp-sar-adc.c
> index 9efa883c277d..a6e4888a8464 100644
> --- a/drivers/iio/adc/nxp-sar-adc.c
> +++ b/drivers/iio/adc/nxp-sar-adc.c
> @@ -247,7 +247,8 @@ static inline void nxp_sar_adc_calibration_start(void __iomem *base)
>
> static inline int nxp_sar_adc_calibration_wait(void __iomem *base)
> {
> - u32 msr, ret;
> + u32 msr;
> + int ret;
>
> ret = readl_poll_timeout(NXP_SAR_ADC_MSR(base), msr,
> !FIELD_GET(NXP_SAR_ADC_MSR_CALBUSY, msr),
>
> ---
> base-commit: d4906ae14a5f136ceb671bb14cedbf13fa560da6
> change-id: 20260222-nxp-sar-adc-1906a65ce5b6
>
> Best regards,
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: adc: nxp-sar-adc: Remove unnecessary type casting
2026-02-22 16:03 ` Jonathan Cameron
@ 2026-02-22 16:38 ` Felix Gu
2026-02-23 8:49 ` Andy Shevchenko
0 siblings, 1 reply; 4+ messages in thread
From: Felix Gu @ 2026-02-22 16:38 UTC (permalink / raw)
To: Jonathan Cameron
Cc: David Lechner, Nuno Sá, Andy Shevchenko, linux-iio,
linux-kernel, Daniel Lezcano
On Mon, Feb 23, 2026 at 12:03 AM Jonathan Cameron <jic23@kernel.org> wrote:
>
> On Sun, 22 Feb 2026 02:09:08 +0800
> Felix Gu <ustc.gu@gmail.com> wrote:
>
> > The readl_poll_timeout() macro returns a signed integer error code.
> >
> > In nxp_sar_adc_calibration_wait(), the return value is casted to u32
> > before being returned as int, which is unnecessary.
> >
> > Signed-off-by: Felix Gu <ustc.gu@gmail.com>
> Hi Felix,
>
> Make sure to include the author of the code you are touching in the +CC list.
> Added Daniel.
>
> I think this is simple enough, so I've picked it up now but I'm fine adding
> tags or indeed dropping it if other reviews come in. I'll be rebasing
> or rc1 later in the week.
>
> Applied to the testing branch of iio.git
>
> Thanks,
>
> Jonathan
>
> > ---
> > drivers/iio/adc/nxp-sar-adc.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/adc/nxp-sar-adc.c b/drivers/iio/adc/nxp-sar-adc.c
> > index 9efa883c277d..a6e4888a8464 100644
> > --- a/drivers/iio/adc/nxp-sar-adc.c
> > +++ b/drivers/iio/adc/nxp-sar-adc.c
> > @@ -247,7 +247,8 @@ static inline void nxp_sar_adc_calibration_start(void __iomem *base)
> >
> > static inline int nxp_sar_adc_calibration_wait(void __iomem *base)
> > {
> > - u32 msr, ret;
> > + u32 msr;
> > + int ret;
> >
> > ret = readl_poll_timeout(NXP_SAR_ADC_MSR(base), msr,
> > !FIELD_GET(NXP_SAR_ADC_MSR_CALBUSY, msr),
> >
> > ---
> > base-commit: d4906ae14a5f136ceb671bb14cedbf13fa560da6
> > change-id: 20260222-nxp-sar-adc-1906a65ce5b6
> >
> > Best regards,
>
Hi Jonathan,
Thank you for the reminder.
I used b4 prep --auto-to-cc and am not sure why Daniel's email was
missed in this patch, as it was correctly included in another patch.
Best regards,
Felix
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: adc: nxp-sar-adc: Remove unnecessary type casting
2026-02-22 16:38 ` Felix Gu
@ 2026-02-23 8:49 ` Andy Shevchenko
0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2026-02-23 8:49 UTC (permalink / raw)
To: Felix Gu
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
linux-iio, linux-kernel, Daniel Lezcano
On Mon, Feb 23, 2026 at 12:38:58AM +0800, Felix Gu wrote:
> On Mon, Feb 23, 2026 at 12:03 AM Jonathan Cameron <jic23@kernel.org> wrote:
> > On Sun, 22 Feb 2026 02:09:08 +0800
> > Felix Gu <ustc.gu@gmail.com> wrote:
> > Make sure to include the author of the code you are touching in the +CC list.
> > Added Daniel.
> >
> > I think this is simple enough, so I've picked it up now but I'm fine adding
> > tags or indeed dropping it if other reviews come in. I'll be rebasing
> > or rc1 later in the week.
> >
> > Applied to the testing branch of iio.git
> Thank you for the reminder.
>
> I used b4 prep --auto-to-cc and am not sure why Daniel's email was
> missed in this patch, as it was correctly included in another patch.
Please, do *remove* the context that is unrelated to the reply. See this email
as an example. Do not waste others' time on this.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-02-23 8:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-21 18:09 [PATCH] iio: adc: nxp-sar-adc: Remove unnecessary type casting Felix Gu
2026-02-22 16:03 ` Jonathan Cameron
2026-02-22 16:38 ` Felix Gu
2026-02-23 8:49 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox