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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zg3GdUtBUKzB6NNZ@surfacebook.localdomain>
Date: Thu, 4 Apr 2024 00:13:25 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Cc: Mark Brown <broonie@...nel.org>, Arnd Bergmann <arnd@...nel.org>,
	linux-kernel@...r.kernel.org,
	Neil Armstrong <neil.armstrong@...aro.org>,
	Kevin Hilman <khilman@...libre.com>,
	Heiko Stuebner <heiko@...ech.de>,
	Andi Shyti <andi.shyti@...nel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
	Arnd Bergmann <arnd@...db.de>, Jerome Brunet <jbrunet@...libre.com>,
	Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
	Alim Akhtar <alim.akhtar@...sung.com>,
	Li Zetao <lizetao1@...wei.com>,
	Jonathan Cameron <Jonathan.Cameron@...wei.com>,
	Rob Herring <robh@...nel.org>,
	Yang Yingliang <yangyingliang@...wei.com>,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	Luis de Arquer <luis.dearquer@...rtim.com>,
	Tudor Ambarus <tudor.ambarus@...aro.org>,
	Sam Protsenko <semen.protsenko@...aro.org>,
	Peter Griffin <peter.griffin@...aro.org>,
	Jaewon Kim <jaewon02.kim@...sung.com>, linux-spi@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-amlogic@...ts.infradead.org,
	linux-rockchip@...ts.infradead.org,
	linux-samsung-soc@...r.kernel.org
Subject: Re: [PATCH 31/34] spi: remove incorrect of_match_ptr annotations

Wed, Apr 03, 2024 at 11:05:51PM +0200, Uwe Kleine-König kirjoitti:
> On Wed, Apr 03, 2024 at 10:56:58AM +0100, Mark Brown wrote:
> > On Wed, Apr 03, 2024 at 10:06:49AM +0200, Arnd Bergmann wrote:
> > 
> > > These appear to all be copied from the same original driver, so fix them at the
> > > same time by removing the unnecessary of_match_ptr() annotation. As far as I
> > > can tell, all these drivers are only actually used on configurations that
> > > have CONFIG_OF enabled.
> > 
> > Why are we not fixing of_match_ptr() here, or at least adding the ifdefs
> > in case someone does end up wanting to run without OF?
> 
> Fixing of_match_ptr =
> 
> diff --git a/include/linux/of.h b/include/linux/of.h
> index a0bedd038a05..d980bccffda0 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -890,7 +890,7 @@ static inline const void *of_device_get_match_data(const struct device *dev)
>  	return NULL;
>  }
>  
> -#define of_match_ptr(_ptr)	NULL
> +#define of_match_ptr(_ptr)	(0 ? (_ptr) : NULL)

FWIW, we have PTR_IF() (with a side note to split it from kernel.h in a
separate header or less twisted one).

>  #define of_match_node(_matches, _node)	NULL
>  #endif /* CONFIG_OF */
>  
> ?
> 
> Assuming this helps, I agree this would be the better fix.

Why? I mean why do we need to even have this API? It's always
good to know which devices are supported by the module even
if you have no need in such support or it's not compiled in.
One of the reasons why is to be able to google for compatible hardware,
for example.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ