lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260207155400.049906f0@jic23-huawei>
Date: Sat, 7 Feb 2026 15:54:00 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Andy Shevchenko <andriy.shevchenko@...el.com>
Cc: Antoniu Miclaus <antoniu.miclaus@...log.com>, David Lechner
 <dlechner@...libre.com>, Nuno Sá <nuno.sa@...log.com>, Andy
 Shevchenko <andy@...nel.org>, Waqar Hameed <waqar.hameed@...s.com>,
 chuguangqing <chuguangqing@...pur.com>, linux-iio@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] iio: light: ltr501: return proper error code from
 ltr501_get_gain_index()

On Tue, 3 Feb 2026 10:27:23 +0200
Andy Shevchenko <andriy.shevchenko@...el.com> wrote:

> On Mon, Feb 02, 2026 at 02:07:12PM +0200, Antoniu Miclaus wrote:
> > Return -EINVAL instead of -1 when no matching gain value is found
> > in the gain table. Update the callers to propagate this error directly
> > rather than overwriting it with -EINVAL.  
> 
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@...el.com>
> 
> ...
> 
> > static int ltr501_get_gain_index(const struct ltr501_gain *gain, int size,  
> 
> >  		if (val == gain[i].scale && val2 == gain[i].uscale)
> >  			return i;
> >  
> > -	return -1;
> > +	return -EINVAL;  
> 
> I would use -ENOENT, but I'm not sure if there is any ABI involved (id est we
> return this to user space).
It will surface.  Not sure anyone would notice the change, but lets
keep things simple.

Applied.

Jonathan

> 
> >  }  
> 
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ