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: <64ec49f2-8c3b-4642-a910-32a656095c68@bootlin.com>
Date: Thu, 13 Feb 2025 14:42:54 +0100
From: Alexis Lothoré <alexis.lothore@...tlin.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Jiri Slaby <jirislaby@...nel.org>,
 Richard Genoud <richard.genoud@...tlin.com>,
 Nicolas Ferre <nicolas.ferre@...rochip.com>,
 Alexandre Belloni <alexandre.belloni@...tlin.com>,
 Claudiu Beznea <claudiu.beznea@...on.dev>, Shawn Guo <shawnguo@...nel.org>,
 Sascha Hauer <s.hauer@...gutronix.de>,
 Pengutronix Kernel Team <kernel@...gutronix.de>,
 Fabio Estevam <festevam@...il.com>,
 Maxime Coquelin <mcoquelin.stm32@...il.com>,
 Alexandre Torgue <alexandre.torgue@...s.st.com>,
 Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
 linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org, imx@...ts.linux.dev,
 linux-stm32@...md-mailman.stormreply.com
Subject: Re: [PATCH] serial: mctrl_gpio: add parameter to skip sync

Hello Greg,

On 2/13/25 10:58, Greg Kroah-Hartman wrote:
> On Thu, Feb 13, 2025 at 09:25:04AM +0100, Alexis Lothoré wrote:

[...]

>> -	mctrl_gpio_disable_ms(up->gpios);
>> +	mctrl_gpio_disable_ms(up->gpios, false);
> 
> This a bad api.
> 
> When you read this line in the driver, do you know what "false" means
> here?
> 
> Please make two functions, mctrl_gpio_disable_ms_sync() and
> mctrl_gpio_disable_ms_no_sync() which can internally just call
> mctrl_gpio_disable_ms() with the boolean, but no driver should have to
> call that at all.
> 
> That way, when you read driver code, you KNOW what is happening and you
> don't have to hunt around in a totally different C file to try to figure
> it out and loose your concentration.

Makes sense, I'll spin a v2 with a more explicit API.

Thanks,

Alexis
> 
> thanks,
> 
> greg k-h


-- 
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ