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: <aSWAs71tl5s9_Rup@smile.fi.intel.com>
Date: Tue, 25 Nov 2025 12:10:59 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc: Baojun Xu <baojun.xu@...com>, linux-i2c@...r.kernel.org,
	linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
	platform-driver-x86@...r.kernel.org,
	Wolfram Sang <wsa+renesas@...g-engineering.com>,
	Mika Westerberg <westeri@...nel.org>,
	Hans de Goede <hansg@...nel.org>,
	Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Subject: Re: [PATCH v1 1/2] i2c: acpi: Return -ENOENT when no resources found
 in i2c_acpi_client_count()

On Tue, Nov 25, 2025 at 10:50:46AM +0100, Mika Westerberg wrote:
> On Tue, Nov 25, 2025 at 10:40:11AM +0100, Andy Shevchenko wrote:
> > Some users want to return an error to the upper layers when
> > i2c_acpi_client_count() returns 0. Follow the common pattern
> > in such cases, i.e. return -ENOENT instead of 0.
> 
> Well what does 0 mean then?

There is no 0.

> To me it's logical that i2c_acpi_client_count() as it returns count,
> returns 0 if the count is 0. Let's not make it any more complex than that.
> ;-)

The same approach used elsewhere, e.g., gpiod_count(),
   of_reset_control_get_count() / reset_control_get_count().
And other count methods used for IRQ resource, for example.
However PCI MSI/MSI-X counters never return 0.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ