linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Johannes Berg <johannes@sipsolutions.net>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch: don't warn on every struct without const_structs file
Date: Tue, 10 Jan 2017 08:50:05 -0800	[thread overview]
Message-ID: <1484067005.12006.5.camel@perches.com> (raw)
In-Reply-To: <1484065886.1014.3.camel@sipsolutions.net>

On Tue, 2017-01-10 at 17:31 +0100, Johannes Berg wrote:
> > > I copied checkpatch elsewhere and ran it.
> > 
> > Why do you want to copy checkpatch "someplace else"?
> > Instead of copy, I think you should soft link it.
> 
> Well, no, I have to distribute it with that.
> 
> > > Regardless, the current code is utterly stupid - it prints a
> > > warning that it won't flag any structs, and then proceeds to flag
> > > all structs.
> > > 
> > > If you must, send a patch to abort() [whatever the perl equivalent
> > > is] when the file can't be found, but as it is, the code is just
> > > idiotic.
> > 
> > Maybe so.
> > 
> > As is, your patch description is incomplete because
> > it doesn't mention your use case.
> 
> I don't think that's relevant.

I do.  checkpatch is a script written for linux patches.

You are making use of the script outside of the linux tree.
You could just as well keep a local copy of this patch instead.

Your patch allows you to avoid this and the patch description
is relevant to why this is useful.

So your patch description is simply incorrect/incomplete:

---------------------------------------------------------------
The script says that it won't warn:
"No structs that should be const will be found [...]"

but then that doesn't work and it warns on every single struct
instead, since the regular expression ends up empty. Fix that
by checking that it's not empty first.
---------------------------------------------------------------

When used for linux, checkpatch works just fine and your
patch description describes a condition that doesn't happen.

> The script is internally inconsistent,
> as I do mention in the commit log, which is worth fixing.

Yeah, I think it's useful to fix.

Just make the commit message describe why the patch is
appropriate for non-linux uses.

      reply	other threads:[~2017-01-10 16:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10 14:03 [PATCH] checkpatch: don't warn on every struct without const_structs file Johannes Berg
2017-01-10 15:01 ` Joe Perches
2017-01-10 15:04   ` Johannes Berg
2017-01-10 16:27     ` Joe Perches
2017-01-10 16:31       ` Johannes Berg
2017-01-10 16:50         ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1484067005.12006.5.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).