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] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZQBIi3OsUUe+JcoB@smile.fi.intel.com>
Date:   Tue, 12 Sep 2023 14:16:27 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Bartosz Golaszewski <brgl@...ev.pl>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        Mika Westerberg <mika.westerberg@...ux.intel.com>,
        linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-acpi@...r.kernel.org,
        Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH v2 07/11] gpiolib: replace find_chip_by_name() with
 gpio_device_find_by_label()

On Tue, Sep 12, 2023 at 12:07:23PM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> 
> Remove all remaining uses of find_chip_by_name() (and subsequently:
> gpiochip_find()) from gpiolib.c and use the new
> gpio_device_find_by_label() instead.

...

>  	for (p = &table->table[0]; p->key; p++) {
> -		struct gpio_chip *gc;
> +		struct gpio_device *gdev __free(gpio_device_put) = NULL;

> +		gc = gpio_device_get_chip(gdev);

What the heck is this, btw? You have gdev NULL here.

>  		/* idx must always match exactly */
>  		if (p->idx != idx)
> @@ -4004,9 +3996,8 @@ static struct gpio_desc *gpiod_find(struct device *dev, const char *con_id,
>  			return ERR_PTR(-EPROBE_DEFER);
>  		}
>  
> -		gc = find_chip_by_name(p->key);
> -
> -		if (!gc) {
> +		gdev = gpio_device_find_by_label(p->key);
> +		if (!gdev) {

...

>  		if (gc->ngpio <= p->chip_hwnum) {
>  			dev_err(dev,
>  				"requested GPIO %u (%u) is out of range [0..%u] for chip %s\n",
> -				idx, p->chip_hwnum, gc->ngpio - 1,
> +				idx, p->chip_hwnum, gdev->chip->ngpio - 1,

In other patch you use wrapper to get gdev->chip, why not here?

>  				gc->label);

Is this gc is different to gdev->chip?

>  			return ERR_PTR(-EINVAL);
>  		}

...

Sorry, but this patch seems to me as WIP. Please, revisit it, make sure all
things are done consistently.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ