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]
Date:	Fri, 25 Oct 2013 16:44:28 +0200
From:	Sebastian Reichel <sre@...ian.org>
To:	Peter Ujfalusi <peter.ujfalusi@...com>
Cc:	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Grant Likely <grant.likely@...aro.org>,
	Rob Herring <rob.herring@...xeda.com>,
	Sachin Kamat <sachin.kamat@...aro.org>,
	Florian Vaussard <florian.vaussard@...l.ch>,
	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
	devicetree@...r.kernel.org
Subject: Re: [PATCHv6 1/3] Input: twl4030-pwrbutton - add device tree support

Hi Péter,

On Fri, Oct 25, 2013 at 03:46:02PM +0300, Peter Ujfalusi wrote:
> > [...]
> > +#if IS_ENABLED(CONFIG_OF)
> 
> You don't need to do this.

It's done like this in all the other drivers.

> > +static const struct of_device_id twl4030_pwrbutton_dt_match_table[] = {
> > +       { .compatible = "ti,twl4030-pwrbutton" },
> > +       {},
> > +};
> > +MODULE_DEVICE_TABLE(of, twl4030_pwrbutton_dt_match_table);
> > +#endif
> > +
> >  static struct platform_driver twl4030_pwrbutton_driver = {
> > +	.probe		= twl4030_pwrbutton_probe,
> >  	.remove		= __exit_p(twl4030_pwrbutton_remove),
> >  	.driver		= {
> >  		.name	= "twl4030_pwrbutton",
> >  		.owner	= THIS_MODULE,
> > +		.of_match_table = of_match_ptr(twl4030_pwrbutton_dt_match_table),
> 
> If you try to compile this driver with config !CONFIG_OF it will not work in
> this way.

For !CONFIG_OF of_match_ptr is defined as follows (in "include/linux/of.h"):

#define of_match_ptr(_ptr)  NULL

So the preprocessor will remove the undefined symbol.

-- Sebastian

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ