Re: [PATCH 2/2] adc: exynos_adc: Fix incorrect variable type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2 April 2013 23:23, Sachin Kamat <sachin.kamat@xxxxxxxxxx> wrote:
> wait_for_completion_interruptible_timeout() returns negative value on error
> but is assigned to an unsigned variable. Though this might not matter much
> as the return value is only tested for '0', for the sake of code correctness
> modify the variable type suitably. Without this patch we get the following
> smatch error:
> drivers/iio/adc/exynos_adc.c:147 exynos_read_raw() error:
> 'wait_for_completion_interruptible_timeout()' returns negative and
> 'timeout' is unsigned
>
> Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx>
> ---
>  drivers/iio/adc/exynos_adc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
> index 22d034a..3bf5132 100644
> --- a/drivers/iio/adc/exynos_adc.c
> +++ b/drivers/iio/adc/exynos_adc.c
> @@ -118,7 +118,7 @@ static int exynos_read_raw(struct iio_dev *indio_dev,
>                                 long mask)
>  {
>         struct exynos_adc *info = iio_priv(indio_dev);
> -       unsigned long timeout;
> +       long timeout;
Sachin thank you for your efforts.

Apart from just changing it to long. we seem to have other corner cases
and a CL is under discussion https://patchwork.kernel.org/patch/2279591/

Doug, has replied on it as of today. We will come back with that CL soon.
>         u32 con1, con2;
>
>         if (mask != IIO_CHAN_INFO_RAW)
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
Shine bright,
(: Nav :)
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux