linux-kernel-mentees.lists.linuxfoundation.org archive mirror
 help / color / mirror / Atom feed
From: Dwaipayan Ray <dwaipayanray1@gmail.com>
To: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: linux-kernel-mentees@lists.linuxfoundation.org,
	Theodoros Chatziioannidis <sdi1600197@di.uoa.gr>
Subject: Re: [Linux-kernel-mentees] [PATCH RFC 2/2] checkpatch: fix multi-statement macro checks
Date: Thu, 1 Oct 2020 15:54:36 +0530	[thread overview]
Message-ID: <CABJPP5CXxj_7uknihKU8NM295WvcVaMCtJ7hqMzWD+5XcBmR-g@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2010011014540.24571@felia>

On Thu, Oct 1, 2020 at 1:52 PM Lukas Bulwahn <lukas.bulwahn@gmail.com> wrote:
>
>
>
> On Thu, 1 Oct 2020, Dwaipayan Ray wrote:
>
> > Checkpatch.pl doesn't have a check for excluding while (...) {...}
> > blocks from MULTISTATEMENT_MACRO_USE_DO_WHILE error.
> >
> > For example, running checkpatch.pl on the file mm/access.c in the
> > kernel generates the following error:
> >
> > ERROR: Macros with complex values should be enclosed in parentheses
> > +#define copy_from_kernel_nofault_loop(dst, src, len, type, err_label)        \
> > +     while (len >= sizeof(type)) {                                   \
> > +             __get_kernel_nofault(dst, src, type, err_label);        \
> > +             dst += sizeof(type);                                    \
> > +             src += sizeof(type);                                    \
> > +             len -= sizeof(type);                                    \
> > +     }
> >
> > The error is misleading for this case. Enclosing it in a paranthesis
> > doesn't make any sense.
> >
>
> s/a paranthesis/parentheses/
>

I trusted checkpatch too much. Seems spelling.txt does not have an entry
for parentheses. (maybe not the most common spelling error).

> > Checkpatch already has an exception list for such common macro types.
> > Added a new exception for while (...) {...} style blocks to the same.
> > This effectively fixed the wrong error message.
> >
>
> This seems easier to understand and to judge than the other patch.
>
> We will still need an evaluation, though. Theodoros, maybe you can help us
> here.
>
> Dwaipayan, looks good to me. Do you fix up the spelling mistake and then
> send that patch to Joe and lkml?
>

Thanks, I will do that. Sending just this patch for now. The other one
needs more testing. I will send in the report once done.

> Is it just the tab setting in my email client or is there a tab too much
> that it does not align with the other comments?

Yes, it was an extra tab. The tabs at that particular place are too
non-uniform, causing confusion :(

Thanks,
Dwaipayan.
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

  reply	other threads:[~2020-10-01 10:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30 21:03 [Linux-kernel-mentees] [PATCH RFC 1/2] checkpatch: fix multi-statement macro checks Dwaipayan Ray
2020-09-30 21:03 ` [Linux-kernel-mentees] [PATCH RFC 2/2] " Dwaipayan Ray
2020-10-01  8:22   ` Lukas Bulwahn
2020-10-01 10:24     ` Dwaipayan Ray [this message]
2020-10-01  8:14 ` [Linux-kernel-mentees] [PATCH RFC 1/2] " Lukas Bulwahn

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=CABJPP5CXxj_7uknihKU8NM295WvcVaMCtJ7hqMzWD+5XcBmR-g@mail.gmail.com \
    --to=dwaipayanray1@gmail.com \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=sdi1600197@di.uoa.gr \
    /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).