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: <aQta01b_PyeHirxu@smile.fi.intel.com>
Date: Wed, 5 Nov 2025 16:10:27 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Linus Walleij <linus.walleij@...aro.org>,
	Daniel Scally <djrscally@...il.com>,
	Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
	Sakari Ailus <sakari.ailus@...ux.intel.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"Rafael J. Wysocki" <rafael@...nel.org>,
	Danilo Krummrich <dakr@...nel.org>,
	Philipp Zabel <p.zabel@...gutronix.de>,
	Krzysztof Kozlowski <krzk@...nel.org>, linux-gpio@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH v5 8/8] reset: gpio: use software nodes to setup the GPIO
 lookup

On Wed, Nov 05, 2025 at 09:47:39AM +0100, Bartosz Golaszewski wrote:
> 
> GPIO machine lookup is a nice mechanism for associating GPIOs with
> consumers if we don't know what kind of device the GPIO provider is or
> when it will become available. However in the case of the reset-gpio, we
> are already holding a reference to the device and so can reference its
> firmware node. Let's setup a software node that references the relevant
> GPIO and attach it to the auxiliary device we're creating.

...

>  static int __reset_add_reset_gpio_device(const struct of_phandle_args *args)
>  {
> +	struct property_entry properties[] = { {}, {} };

It's an interesting way of saying this?

	struct property_entry properties[2] = { };

>  	struct reset_gpio_lookup *rgpio_dev;
> +	unsigned int offset, of_flags;
> +	struct device *parent;
> +	int id, ret, lflags;

I assumed that lflags shouldn't be signed. And IIRC they are unsigned long
elsewhere (yes, just confirmed).

...

> +	rgpio_dev->swnode = fwnode_create_software_node(properties, NULL);
> +	if (IS_ERR(rgpio_dev->swnode)) {
> +		ret = PTR_ERR(rgpio_dev->swnode);
> +		goto err_put_of_node;
> +	}

Can save 1 LoC?

	rgpio_dev->swnode = fwnode_create_software_node(properties, NULL);
	ret = PTR_ERR_OR_ZERO(rgpio_dev->swnode);
	if (ret)
		goto err_put_of_node;

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ