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: <20260115100645.GE2275908@black.igk.intel.com>
Date: Thu, 15 Jan 2026 11:06:45 +0100
From: Mika Westerberg <mika.westerberg@...ux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
	Andi Shyti <andi.shyti@...nel.org>, Jan Dabros <jsd@...ihalf.com>
Subject: Re: [PATCH v1 2/2] i2c: designware: Use device_is_compatible()
 instead of custom approach

On Thu, Jan 15, 2026 at 09:41:26AM +0200, Andy Shevchenko wrote:
> On Thu, Jan 15, 2026 at 06:39:59AM +0100, Mika Westerberg wrote:
> > On Wed, Jan 14, 2026 at 06:09:09PM +0200, Andy Shevchenko wrote:
> > > On Wed, Jan 14, 2026 at 12:53:04PM +0100, Mika Westerberg wrote:
> > > > On Wed, Jan 14, 2026 at 09:17:51AM +0100, Andy Shevchenko wrote:
> > > > > We use MODEL_MSCC_OCELOT effectively is a flag for comparing against
> > > > 
> > > > as a flag?
> > > 
> > > Yes, sorry for the typo.
> > > 
> > > > > "compatible" property. Use device_is_compatible() directly to make it
> > > > > clear.
> > > > 
> > > > Okay but if something else ever needs this same quirk then we would need to
> > > > add new entry here and also to the IDs list.
> > > 
> > > Yes, that's how DT works and there are, of course, examples all over
> > > the kernel, first that comes to my mind: drivers/mmc/host/sdhci-pltfm.c.
> > > 
> > > > With the flag you can have the IDs in a single place not all over the
> > > > driver.
> > > 
> > > Makes the reality harder to read. If I know that the same quirk is used by
> > > different platform (in terms of compatible string) I will see it immediately
> > > from the code. Flag is meaningless.
> > 
> > Well with the flag you get the help from the compiler if you typo it but
> > with the string comparison you are on your own.
> 
> It only affects the development cycle, isn't it obvious that any quirk should
> be tested by the author, otherwise it won't work.

Of course but then are these "cleanups" that probably will not be tested
that well if at all. If it is possible to take advantage of the compiler
then I prefer that.

> > Therefore I prefer the flag and as I said it also avoid duplicating the
> > compatible string.
> 
> Duplicating compatible string is not a problem, linker nowadays combines
> the same strings into one. In case you are worrying about the space, it's
> not a problem.

I don't care about the space but just duplication.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ