All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Jonathan Corbet <corbet@lwn.net>,
	Utkarsh Verma <utkarshverma294@gmail.com>,
	Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Documentation: checkpatch: Document some more message types
Date: Mon, 27 Sep 2021 10:53:05 -0700	[thread overview]
Message-ID: <06f4c72fefeedb5145a940e5a78d50e610acdcc4.camel@perches.com> (raw)
In-Reply-To: <875yulj4m8.fsf@meer.lwn.net>

On Mon, 2021-09-27 at 11:43 -0600, Jonathan Corbet wrote:
> Utkarsh Verma <utkarshverma294@gmail.com> writes:
> 
> > Added and documented 3 new message types:
> > - UNNECESSARY_INT
> > - UNSPECIFIED_INT
> > - UNNECESSARY_ELSE
> > 
> > Signed-off-by: Utkarsh Verma <utkarshverma294@gmail.com>
> > ---
> >  Documentation/dev-tools/checkpatch.rst | 47 ++++++++++++++++++++++++++
> >  1 file changed, 47 insertions(+)
> 
> So...when you send multiple patches with the same subject line that's
> always a bad sign.  We really want a "git --oneline" listing to give a
> good idea of what the patch does, and that depends on more descriptive
> subject lines.
> 
> In this case, something like:
> 
>   docs: checkpatch: add UNNECESSARY/UNSPECIFIED_INT and UNNECESSARY_ELSE
> 
> I can fix up these two patches, but please try to keep this in mind for
> future work.
> 
> (applying the patches now).

The unnecessary_else description isn't particularly good as the
checkpatch output doesn't describe multiple if/else if/else if type
returns where the message should not apply.

For this type of use, the checkpatch message is not necessarily correct
and because it could be a patch context, there's no way for checkpatch
to know if it's correct or not.

	if (foo) {
		...
	} else if (bar) {
		...
		return [val];
	} else {
		...
	}




  parent reply	other threads:[~2021-09-27 17:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-25 20:17 [PATCH] Documentation: checkpatch: Document some more message types Utkarsh Verma
2021-09-27 17:43 ` Jonathan Corbet
2021-09-27 17:47   ` Utkarsh Verma
2021-09-27 17:53   ` Joe Perches [this message]
2021-10-01 12:02     ` [PATCH] docs: checkpatch: add UNNECESSARY_ELSE message Utkarsh Verma
2021-10-02 14:45       ` [PATCH v2] " Utkarsh Verma
2021-10-03  4:38         ` Dwaipayan Ray
2021-10-03  5:08           ` Lukas Bulwahn
2021-10-03  5:19           ` Utkarsh Verma
2021-10-03  5:31             ` Lukas Bulwahn
2021-10-03  5:23         ` Lukas Bulwahn
2021-10-01 19:09     ` [PATCH] Documentation: checkpatch: Document some more message types Utkarsh Verma
2021-10-01 19:26       ` [PATCH] checkpatch: add check for continue statement in UNNECESSARY_ELSE Utkarsh Verma
2021-10-01 20:22         ` Joe Perches
2021-10-01 20:47           ` [PATCH v2] " Utkarsh Verma
2021-10-01 21:09             ` Joe Perches
2021-10-02 14:02               ` [PATCH v3] " Utkarsh Verma
2021-10-03  5:12                 ` Lukas Bulwahn
2021-09-29  5:28 ` [PATCH] Documentation: checkpatch: Document some more message types Lukas Bulwahn
  -- strict thread matches above, loose matches on Subject: below --
2021-09-25 16:38 Utkarsh Verma
2021-09-17 10:15 Utkarsh Verma
2021-09-17 12:39 ` Dwaipayan Ray

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=06f4c72fefeedb5145a940e5a78d50e610acdcc4.camel@perches.com \
    --to=joe@perches.com \
    --cc=corbet@lwn.net \
    --cc=dwaipayanray1@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=utkarshverma294@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.