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: <aQx-BlL9PjHeR7Dy@smile.fi.intel.com>
Date: Thu, 6 Nov 2025 12:52:54 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc: Jan Dabros <jsd@...ihalf.com>, Andi Shyti <andi.shyti@...nel.org>,
	linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] i2c: designware: Replace magic numbers with named
 constants

On Thu, Nov 06, 2025 at 11:42:28AM +0100, Mika Westerberg wrote:
> On Wed, Nov 05, 2025 at 07:18:44PM +0300, Artem Shimko wrote:

...

> /* Timeouts in us */
> #define DW_IC_BUSY_POLL_TIMEOUT		1100
> #define DW_IC_BUSY_TOTAL_TIMEOUT	20000
> #define DW_IC_FOO_TIMEOUT		1234

It's in-kernel practice to add units to the definitions and avoid unneeded
comments. Also it will be clearer to the reader without looking back for any
comments like above.

...

> All the register offsets, shifts and masks should be in
> drivers/i2c/busses/i2c-designware-core.h and you don't need to "document"
> them because all this is available in the datasheet.

Also the benefit could be switch to use bitfield.h.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ