mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aldo Conte <aldocontelk@gmail.com>
To: Javier Carrasco <javier.carrasco.cruz@gmail.com>,
	Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>
Subject: Re: [PATCH] iio: light: veml6070: fix veml6070_read() return value
Date: Thu, 26 Mar 2026 14:14:16 +0100	[thread overview]
Message-ID: <9f81cdd6-7f20-45fe-a431-78d75016f7a0@gmail.com> (raw)
In-Reply-To: <DHC96AXSNFEZ.121C1XIAZNAMZ@gmail.com>

On 3/26/26 00:30, Javier Carrasco wrote:
> Hi Aldo,
> 
> On Wed Mar 25, 2026 at 10:32 PM AEDT, Aldo Conte wrote:
>> veml6070_read() computes the sensor value in ret but
>> returns 0 instead of the actual result. This causes
>> veml6070_read_raw() to always report 0.
>>
>> Return the computed value instead of 0.
>>
>> Running make W=1 returns no errors. I was unable
>> to test the patch because I do not have the hardware.
>> Found by code inspection.
>>
> 
> The fix is correct, but not the commit it addresses.
> This bug was introduced when the guard to handle the mutex was added.
> 
> It should be:
> 
> Fixes: fc38525135dd ("iio: light: veml6070: use guard to handle mutex")
> 
>> Fixes: bb18885ed823 ("iio: light: veml6070: add support for integration time")
>> Signed-off-by: Aldo Conte <aldocontelk@gmail.com>
>> ---
>>   drivers/iio/light/veml6070.c | 4 +---
>>   1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/iio/light/veml6070.c b/drivers/iio/light/veml6070.c
>> index 6d4483c85f30..74d7246e5225 100644
>> --- a/drivers/iio/light/veml6070.c
>> +++ b/drivers/iio/light/veml6070.c
>> @@ -134,9 +134,7 @@ static int veml6070_read(struct veml6070_data *data)
>>   	if (ret < 0)
>>   		return ret;
>>
>> -	ret = (msb << 8) | lsb;
>> -
>> -	return 0;
>> +	return (msb << 8) | lsb;
>>   }
>>
>>   static const struct iio_chan_spec veml6070_channels[] = {
> 
> Best regards,
> Javier
Hi Javier,Thank you for your correction.
I got the wrong result from the grep command.
Do I need to do a review, or is Jonathan's correction enough?

Thanks,
Aldo

  parent reply	other threads:[~2026-03-26 13:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-25 11:32 Aldo Conte
2026-03-25 12:31 ` Nuno Sá
2026-03-25 16:35   ` Jonathan Cameron
2026-03-25 23:30 ` Javier Carrasco
2026-03-26  8:23   ` Jonathan Cameron
2026-03-26 13:14   ` Aldo Conte [this message]
2026-03-26 20:23     ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9f81cdd6-7f20-45fe-a431-78d75016f7a0@gmail.com \
    --to=aldocontelk@gmail.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®