[Linux-kernel-mentees] [PATCH] checkpatch: fix spacing check for return with parentheses

Dwaipayan Ray dwaipayanray1 at gmail.com
Tue Nov 17 19:30:38 UTC 2020


On Wed, Nov 18, 2020 at 12:41 AM Lukas Bulwahn <lukas.bulwahn at gmail.com> wrote:
>
> On Tue, Nov 17, 2020 at 7:13 PM Dwaipayan Ray <dwaipayanray1 at gmail.com> wrote:
> >
> > The spacing check is unreachable for return statements
> > followed by an opening parentheses.
> > For example:
> >
> > int foo(int bar, int baz)
> > {
> >         return(bar+baz);
> > }
> >
> > There should be an error emitted for a space between
> > return and the opening parentheses but checkpatch doesn't
> > emit one.
> >
> > Fix the spacing check. Also add --fix option to
> > the check.
> >
>
> Looks good. How do you discover these errors?
>
> Are you creating a test suite for checkpatch?
>

Hi,
Actually not really a test suite, I was just randomly testing out
these style related checks and it was pure luck that I happened
to come across this one :)

Honestly, a proper test suite would be really cool but is it worth
the effort given that there are so many warnings in checkpatch?

Thanks,
Dwaipayan.


More information about the Linux-kernel-mentees mailing list