[Linux-kernel-mentees] [PATCH] checkpatch: add --fix option for OPEN_BRACE issues

Dwaipayan Ray dwaipayanray1 at gmail.com
Tue Nov 17 09:11:08 UTC 2020


On Tue, Nov 17, 2020 at 2:32 PM Lukas Bulwahn <lukas.bulwahn at gmail.com> wrote:
>
> On Tue, Nov 17, 2020 at 9:56 AM Dwaipayan Ray <dwaipayanray1 at gmail.com> wrote:
> >
> > Brace style misuses of the following types are now
> > corrected:
> >
> > int foo(int bar,
> >         int baz) { bar++;
> >     return bar + baz;
> > }
> >
> > int foo(int bar,
> >         int baz) {
> >     return bar + baz;
> > }
> >
> > if (bar &&
> >     baz)
> > {   bar++;
> >     baz++;
> > }
> >
> > if (bar &&
> >     baz)
> > {
> >     bar++;
> >     baz++;
> > }
> >
> > Signed-off-by: Dwaipayan Ray <dwaipayanray1 at gmail.com>
>
> Looks good to me. How did you test this? Did you run on a couple of
> files in the kernel repository?
>

I have only run on some test cases I made, which also included the
style misuses above. Finding files in the kernel for this exact check
might take a bit work. Should I do that? I think these custom examples
pretty much handles all the cases.

Thanks,
Dwaipayan.


More information about the Linux-kernel-mentees mailing list