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]
Date:   Sat, 19 Dec 2020 20:01:09 -0600
From:   Jeff LaBundy <jeff@...undy.com>
To:     Roy Im <roy.im.opensource@...semi.com>
Cc:     Dmitry Torokhov <dmitry.torokhov@...il.com>,
        "linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Input: da7280 - protect OF match table with CONFIG_OF

Hi Dmitry,

On Fri, Dec 18, 2020 at 04:49:48PM +0000, Roy Im wrote:
> On Friday, December 18, 2020 3:50 PM, Dmitry Torokhov wrote:
> 
> > The OF match table is only used when OF is enabled.
> > 
> > Fixes: cd3f609823a5 ("Input: new da7280 haptic driver")
> > Reported-by: kernel test robot <lkp@...el.com>
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
> > ---
> >  drivers/input/misc/da7280.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/input/misc/da7280.c b/drivers/input/misc/da7280.c index 2f698a8c1d65..b08610d6e575 100644
> > --- a/drivers/input/misc/da7280.c
> > +++ b/drivers/input/misc/da7280.c
> > @@ -1300,11 +1300,13 @@ static int __maybe_unused da7280_resume(struct device *dev)
> >  	return retval;
> >  }
> > 
> > +#ifdef CONFIG_OF
> >  static const struct of_device_id da7280_of_match[] = {
> >  	{ .compatible = "dlg,da7280", },
> >  	{ }
> >  };
> >  MODULE_DEVICE_TABLE(of, da7280_of_match);
> > +#endif

Just for my own understanding, would it not work just as well
to include of_device.h? This includes mod_devicetable.h which
in turn defines the of_device_id struct (even if CONFIG_OF is
not set).

The reason for asking is because it seems many drivers do not
include these guards.

> > 
> >  static const struct i2c_device_id da7280_i2c_id[] = {
> >  	{ "da7280", },
> > --
> > 2.29.2.729.g45daf8777d-goog
> > 
> > 
> > --
> > Dmitry
> 
> Thanks!
> 
> Acked-by: Roy Im <roy.im.opensource@...semi.com>
> 

Kind regards,
Jeff LaBundy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ