* [PATCH v2 0/2] iio: use int type to store negative error codes
@ 2025-09-01 13:57 Qianfeng Rong
2025-09-01 13:57 ` [PATCH v2 1/2] iio: dac: ad5360: " Qianfeng Rong
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Qianfeng Rong @ 2025-09-01 13:57 UTC (permalink / raw)
To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
David Lechner, Nuno Sá, Andy Shevchenko, Greg Kroah-Hartman,
open list:IIO SUBSYSTEM AND DRIVERS, open list
Cc: Qianfeng Rong
Use int instead of unsigned int for 'ret' variable in ad5360_update_ctrl()
and ad5421_update_ctrl() to store negative error codes or zero returned by
other functions.
Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
v2: Split each driver into a separate patch.
---
Qianfeng Rong (2):
iio: dac: ad5360: use int type to store negative error codes
iio: dac: ad5421: use int type to store negative error codes
drivers/iio/dac/ad5360.c | 2 +-
drivers/iio/dac/ad5421.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/2] iio: dac: ad5360: use int type to store negative error codes
2025-09-01 13:57 [PATCH v2 0/2] iio: use int type to store negative error codes Qianfeng Rong
@ 2025-09-01 13:57 ` Qianfeng Rong
2025-09-01 13:57 ` [PATCH v2 2/2] iio: dac: ad5421: " Qianfeng Rong
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Qianfeng Rong @ 2025-09-01 13:57 UTC (permalink / raw)
To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
David Lechner, Nuno Sá, Andy Shevchenko, Greg Kroah-Hartman,
open list:IIO SUBSYSTEM AND DRIVERS, open list
Cc: Qianfeng Rong
Change the 'ret' variable in ad5360_update_ctrl() from unsigned int to
int, as it needs to store either negative error codes or zero returned
by ad5360_write_unlocked().
Fixes: a3e2940c24d3 ("staging:iio:dac: Add AD5360 driver")
Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
drivers/iio/dac/ad5360.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/dac/ad5360.c b/drivers/iio/dac/ad5360.c
index a57b0a093112..8271849b1c83 100644
--- a/drivers/iio/dac/ad5360.c
+++ b/drivers/iio/dac/ad5360.c
@@ -262,7 +262,7 @@ static int ad5360_update_ctrl(struct iio_dev *indio_dev, unsigned int set,
unsigned int clr)
{
struct ad5360_state *st = iio_priv(indio_dev);
- unsigned int ret;
+ int ret;
mutex_lock(&st->lock);
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] iio: dac: ad5421: use int type to store negative error codes
2025-09-01 13:57 [PATCH v2 0/2] iio: use int type to store negative error codes Qianfeng Rong
2025-09-01 13:57 ` [PATCH v2 1/2] iio: dac: ad5360: " Qianfeng Rong
@ 2025-09-01 13:57 ` Qianfeng Rong
2025-09-01 15:46 ` [PATCH v2 0/2] iio: " Andy Shevchenko
2025-09-01 16:40 ` Jonathan Cameron
3 siblings, 0 replies; 5+ messages in thread
From: Qianfeng Rong @ 2025-09-01 13:57 UTC (permalink / raw)
To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
David Lechner, Nuno Sá, Andy Shevchenko, Greg Kroah-Hartman,
open list:IIO SUBSYSTEM AND DRIVERS, open list
Cc: Qianfeng Rong
Change the 'ret' variable in ad5421_update_ctrl() from unsigned int to
int, as it needs to store either negative error codes or zero returned
by ad5421_write_unlocked().
Fixes: 5691b23489db ("staging:iio:dac: Add AD5421 driver")
Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
drivers/iio/dac/ad5421.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/dac/ad5421.c b/drivers/iio/dac/ad5421.c
index 1462ee640b16..d9d7031c4432 100644
--- a/drivers/iio/dac/ad5421.c
+++ b/drivers/iio/dac/ad5421.c
@@ -186,7 +186,7 @@ static int ad5421_update_ctrl(struct iio_dev *indio_dev, unsigned int set,
unsigned int clr)
{
struct ad5421_state *st = iio_priv(indio_dev);
- unsigned int ret;
+ int ret;
mutex_lock(&st->lock);
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/2] iio: use int type to store negative error codes
2025-09-01 13:57 [PATCH v2 0/2] iio: use int type to store negative error codes Qianfeng Rong
2025-09-01 13:57 ` [PATCH v2 1/2] iio: dac: ad5360: " Qianfeng Rong
2025-09-01 13:57 ` [PATCH v2 2/2] iio: dac: ad5421: " Qianfeng Rong
@ 2025-09-01 15:46 ` Andy Shevchenko
2025-09-01 16:40 ` Jonathan Cameron
3 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2025-09-01 15:46 UTC (permalink / raw)
To: Qianfeng Rong
Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
David Lechner, Nuno Sá, Andy Shevchenko, Greg Kroah-Hartman,
open list:IIO SUBSYSTEM AND DRIVERS, open list
On Mon, Sep 01, 2025 at 09:57:24PM +0800, Qianfeng Rong wrote:
> Use int instead of unsigned int for 'ret' variable in ad5360_update_ctrl()
> and ad5421_update_ctrl() to store negative error codes or zero returned by
> other functions.
Both LGTM
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/2] iio: use int type to store negative error codes
2025-09-01 13:57 [PATCH v2 0/2] iio: use int type to store negative error codes Qianfeng Rong
` (2 preceding siblings ...)
2025-09-01 15:46 ` [PATCH v2 0/2] iio: " Andy Shevchenko
@ 2025-09-01 16:40 ` Jonathan Cameron
3 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2025-09-01 16:40 UTC (permalink / raw)
To: Qianfeng Rong
Cc: Lars-Peter Clausen, Michael Hennerich, David Lechner,
Nuno Sá, Andy Shevchenko, Greg Kroah-Hartman,
open list:IIO SUBSYSTEM AND DRIVERS, open list
On Mon, 1 Sep 2025 21:57:24 +0800
Qianfeng Rong <rongqianfeng@vivo.com> wrote:
> Use int instead of unsigned int for 'ret' variable in ad5360_update_ctrl()
> and ad5421_update_ctrl() to store negative error codes or zero returned by
> other functions.
>
> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
> ---
> v2: Split each driver into a separate patch.
Thanks for doing that.
Applied to the fixes-togreg branch of iio.git and marked for stable inclusion.
Thanks,
Jonathan
> ---
> Qianfeng Rong (2):
> iio: dac: ad5360: use int type to store negative error codes
> iio: dac: ad5421: use int type to store negative error codes
>
> drivers/iio/dac/ad5360.c | 2 +-
> drivers/iio/dac/ad5421.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-09-01 16:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-01 13:57 [PATCH v2 0/2] iio: use int type to store negative error codes Qianfeng Rong
2025-09-01 13:57 ` [PATCH v2 1/2] iio: dac: ad5360: " Qianfeng Rong
2025-09-01 13:57 ` [PATCH v2 2/2] iio: dac: ad5421: " Qianfeng Rong
2025-09-01 15:46 ` [PATCH v2 0/2] iio: " Andy Shevchenko
2025-09-01 16:40 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).