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: <aLhie72v1T9Bw1vx@black.igk.intel.com>
Date: Wed, 3 Sep 2025 17:44:59 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Linus Walleij <linus.walleij@...aro.org>,
	Yinbo Zhu <zhuyinbo@...ngson.cn>,
	Hoan Tran <hoan@...amperecomputing.com>,
	Manivannan Sadhasivam <mani@...nel.org>,
	Yang Shen <shenyang39@...wei.com>, linux-gpio@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-unisoc@...ts.infradead.org,
	Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH RESEND 07/14] gpio: ts4800: use new generic GPIO chip API

On Mon, Aug 25, 2025 at 11:48:48AM +0200, Bartosz Golaszewski wrote:
> 
> Convert the driver to using the new generic GPIO chip interfaces from
> linux/gpio/generic.h.

...

> +	config = (typeof(config)){

First of all, what's wrong with the pattern used in the kernel when we
explicitly show the compound literal? Also we put a space before {.

> +		.dev = dev,
> +		.sz = 2,
> +		.dat = base_addr + INPUT_REG_OFFSET,
> +		.set = base_addr + OUTPUT_REG_OFFSET,
> +		.dirout = base_addr + DIRECTION_REG_OFFSET,
> +	};
> +
> +	retval = gpio_generic_chip_init(chip, &config);
>  	if (retval)
> -		return dev_err_probe(dev, retval, "bgpio_init failed\n");
> +		return dev_err_probe(dev, retval,
> +				     "failed to initialize the generic GPIO chip\n");

Second, can't it all be hidden in the GPIOLIB just by passing the pointer to
the above initialised structure? Yes, it will take a pointer space in GPIO chip
for all, but I think it will reduce the burden.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ