Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1562872

Re: [PATCH v4 2/2] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation

From Greg KH <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH v4 2/2] firmware: add DECLARE_FW_CUSTOM_FALLBACK() annotation
Date 2017-01-19 17:20 +0100
Message-ID <t1nBp-3Mq-47@gated-at.bofh.it> (permalink)
References <sNLDz-4f3-1@gated-at.bofh.it> <sYORr-58s-3@gated-at.bofh.it> <sYORr-58s-7@gated-at.bofh.it> <t1jeq-X3-9@gated-at.bofh.it> <t1nBp-3Mq-49@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Jan 19, 2017 at 05:08:25PM +0100, Luis R. Rodriguez wrote:
> On Thu, Jan 19, 2017 at 12:31:11PM +0100, Greg KH wrote:
> > On Thu, Jan 12, 2017 at 06:42:50AM -0800, Luis R. Rodriguez wrote:
> > > +Invalid users of the custom fallback mechanism can be policed using::
> > 
> > Ick, no, why?  Why not just add a checkpatch rule instead?
> 
> If its easy to do, how would we do that?

You just patch checkpatch.pl to test for the apis you don't want used
anymore.

> > >          $ export COCCI=scripts/coccinelle/api/request_firmware-avoid-init-probe-init.cocci
> > >          $ make coccicheck MODE=report
> > > diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c
> > > index 2f452f1f7c8a..3f2aa35bc54d 100644
> > > --- a/drivers/firmware/dell_rbu.c
> > > +++ b/drivers/firmware/dell_rbu.c
> > > @@ -586,6 +586,7 @@ static ssize_t read_rbu_image_type(struct file *filp, struct kobject *kobj,
> > >  	return size;
> > >  }
> > >  
> > > +DECLARE_FW_CUSTOM_FALLBACK("Documentation/dell_rbu.txt");
> > 
> > That's a pain.
> 
> It is easier with checkpatch?

Yes.  You are modifying the .c code just to "whitelist" an api you want
to check for.  What's the odds that someone who wants to use that api
just cargo-cult-copies this line as well, to prevent the strange warning
they are getting from the build system?  :)

In short, don't worry about this, it's not a big deal nor really worth
the effort.

thanks,

greg k-h

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v4 2/2] firmware: add DECLARE_FW_CUSTOM_FALLBACK()  annotation Greg KH <gregkh@linuxfoundation.org> - 2017-01-19 12:40 +0100
  Re: [PATCH v4 2/2] firmware: add DECLARE_FW_CUSTOM_FALLBACK()  annotation Greg KH <gregkh@linuxfoundation.org> - 2017-01-19 17:20 +0100
    Re: [PATCH v4 2/2] firmware: add DECLARE_FW_CUSTOM_FALLBACK()  annotation "Luis R. Rodriguez" <mcgrof@kernel.org> - 2017-01-19 22:40 +0100
  Re: [PATCH v4 2/2] firmware: add DECLARE_FW_CUSTOM_FALLBACK()  annotation "Luis R. Rodriguez" <mcgrof@kernel.org> - 2017-01-19 17:50 +0100

csiph-web