* [PATCH] iio: dac: ad3552r: fix signedness bug in ad3552r_reset()
@ 2022-03-16 12:23 Dan Carpenter
2022-03-19 18:25 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2022-03-16 12:23 UTC (permalink / raw)
To: Lars-Peter Clausen, Mihail Chindris
Cc: Michael Hennerich, Jonathan Cameron, linux-iio, kernel-janitors
The "val" variable is used to store either negative error codes from
ad3552r_read_reg_wrapper() or positive u16 values on success. It needs
to be signed for the error handling to work correctly.
Fixes: 8f2b54824b28 ("drivers:iio:dac: Add AD3552R driver support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/iio/dac/ad3552r.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/dac/ad3552r.c b/drivers/iio/dac/ad3552r.c
index 97f13c0b9631..e0a93b27e0e8 100644
--- a/drivers/iio/dac/ad3552r.c
+++ b/drivers/iio/dac/ad3552r.c
@@ -656,7 +656,7 @@ static int ad3552r_reset(struct ad3552r_desc *dac)
{
struct reg_addr_pool addr;
int ret;
- u16 val;
+ int val;
dac->gpio_reset = devm_gpiod_get_optional(&dac->spi->dev, "reset",
GPIOD_OUT_LOW);
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iio: dac: ad3552r: fix signedness bug in ad3552r_reset()
2022-03-16 12:23 [PATCH] iio: dac: ad3552r: fix signedness bug in ad3552r_reset() Dan Carpenter
@ 2022-03-19 18:25 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2022-03-19 18:25 UTC (permalink / raw)
To: Dan Carpenter
Cc: Lars-Peter Clausen, Mihail Chindris, Michael Hennerich,
linux-iio, kernel-janitors
On Wed, 16 Mar 2022 15:23:54 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The "val" variable is used to store either negative error codes from
> ad3552r_read_reg_wrapper() or positive u16 values on success. It needs
> to be signed for the error handling to work correctly.
>
> Fixes: 8f2b54824b28 ("drivers:iio:dac: Add AD3552R driver support")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied to the fixes-togreg branch of iio.git, but I won't be pushing it
out publicly until I have rebased that tree on rc1 as it may make a mess
of ordering in linux-next
Thanks,
Jonathan
> ---
> drivers/iio/dac/ad3552r.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/dac/ad3552r.c b/drivers/iio/dac/ad3552r.c
> index 97f13c0b9631..e0a93b27e0e8 100644
> --- a/drivers/iio/dac/ad3552r.c
> +++ b/drivers/iio/dac/ad3552r.c
> @@ -656,7 +656,7 @@ static int ad3552r_reset(struct ad3552r_desc *dac)
> {
> struct reg_addr_pool addr;
> int ret;
> - u16 val;
> + int val;
>
> dac->gpio_reset = devm_gpiod_get_optional(&dac->spi->dev, "reset",
> GPIOD_OUT_LOW);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-19 18:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16 12:23 [PATCH] iio: dac: ad3552r: fix signedness bug in ad3552r_reset() Dan Carpenter
2022-03-19 18:25 ` Jonathan Cameron
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.