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: <ZtczxlCJLD3lkrkE@smile.fi.intel.com>
Date: Tue, 3 Sep 2024 19:05:26 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Ye Zhang <ye.zhang@...k-chips.com>
Cc: linus.walleij@...aro.org, brgl@...ev.pl, heiko@...ech.de,
	linux-gpio@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
	mika.westerberg@...ux.intel.com, tao.huang@...k-chips.com,
	finley.xiao@...k-chips.com, tim.chen@...k-chips.com,
	elaine.zhang@...k-chips.com
Subject: Re: [PATCH v3 09/12] gpio: rockchip: change the GPIO version
 judgment logic

On Tue, Sep 03, 2024 at 03:36:46PM +0800, Ye Zhang wrote:
> Have a list of valid V1 IDs and default to -ENODEV.

s/V1//

...

>  	id = readl(bank->reg_base + gpio_regs_v2.version_id);

>  

You may remove this blank line now...

> -	/* If not gpio v2, that is default to v1. */
> -	if (id == GPIO_TYPE_V2 || id == GPIO_TYPE_V2_1) {
> -		bank->gpio_regs = &gpio_regs_v2;
> -		bank->gpio_type = GPIO_TYPE_V2;
> -	} else {
> +	/* The GPIO version ID is incrementing. */
> +	switch (id) {

...basically to have

	/* The GPIO version ID is incrementing. */
	id = readl(bank->reg_base + gpio_regs_v2.version_id);
	switch (id) {

> +	case GPIO_TYPE_V1:
>  		bank->gpio_regs = &gpio_regs_v1;
>  		bank->gpio_type = GPIO_TYPE_V1;
> +		break;
> +	case GPIO_TYPE_V2:
> +	case GPIO_TYPE_V2_1:
> +		bank->gpio_regs = &gpio_regs_v2;
> +		bank->gpio_type = GPIO_TYPE_V2;
> +		break;
> +	default:
> +		dev_err(bank->dev, "cannot get the version ID\n");
> +		return -ENODEV;
>  	}

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ