On 3 April 2013 22:57, Naveen Krishna Ch <naveenkrishna.ch@xxxxxxxxx> wrote: > 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/ Thanks for pointing this out. I had not seen this earlier. My patch was to fix an obvious issue with the existing code. However, since you have more elaborate plans about handling this, please go ahead with that. -- With warm regards, Sachin -- 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