Re: [ovs-dev] [PATCH] checkpatch: Don't warn on pointer to pointer.
On Wed, Jun 05, 2024 at 12:25:21PM GMT, Ilya Maximets wrote: > On 6/5/24 10:18, Adrian Moreno wrote: > > Current regexp used to check whitespaces around operators does not > > consider that there can be more than one "*" together to express pointer > > to pointer. As a result, false positive warnings are raised [1]. > > > > Fix the regexp to allow more than one consecutive "+" characters. > > > > Signed-off-by: Adrian Moreno > > > > [1] Example of patch triggering false positives: > >> cat < > diff --git a/test.c b/test.c > > --- a/test.c > > +++ b/test.c > > @@ -1 +1,2 @@ > > +static void foo(struct oftable ***list, char **errorp); > > EOF > > Hi, Adrian. Please, don't include diffs like that in the commit > message. It is not possible to apply the patch formatted like this. > > If you need to add a diff - indent it and also better prefix each > line with something, e.g. ' | diff --git a/test.c b/test.c'. > Yep, I see robot failed. I will just remove the diff and use the unit test as an example :-). > > > > WARNING: Line lacks whitespace around operator > > static void foo(struct oftable ***list, char **errorp); > > > > Lines checked: 6, Warnings: 1, Errors: 0 > > --- > > utilities/checkpatch.py | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py > > index 6b293770d..891b24dcf 100755 > > --- a/utilities/checkpatch.py > > +++ b/utilities/checkpatch.py > > @@ -739,7 +739,7 @@ infix_operators = \ > > '&=', '^=', '|=', '<<=', '>>=']] \ > > + [r'[^<" ]<[^=" ]', > > r'[^\->" ]>[^=" ]', > > - r'[^ !()/"]\*[^/]', > > + r'[^ !()/"\*]\*[^/]', > > r'[^ !&()"]&', > > r'[^" +(]\+[^"+;]', > > r'[^" \-(]\-[^"\->;]', > > Please, add a unit test for this issue. > I tend to forget we have unit tests for checkpatch. Sure, I'll add one. > Best regards, Ilya Maximets. > ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] checkpatch: Don't warn on pointer to pointer.
On 6/5/24 10:18, Adrian Moreno wrote: > Current regexp used to check whitespaces around operators does not > consider that there can be more than one "*" together to express pointer > to pointer. As a result, false positive warnings are raised [1]. > > Fix the regexp to allow more than one consecutive "+" characters. > > Signed-off-by: Adrian Moreno > > [1] Example of patch triggering false positives: >> cat < diff --git a/test.c b/test.c > --- a/test.c > +++ b/test.c > @@ -1 +1,2 @@ > +static void foo(struct oftable ***list, char **errorp); > EOF Hi, Adrian. Please, don't include diffs like that in the commit message. It is not possible to apply the patch formatted like this. If you need to add a diff - indent it and also better prefix each line with something, e.g. ' | diff --git a/test.c b/test.c'. > > WARNING: Line lacks whitespace around operator > static void foo(struct oftable ***list, char **errorp); > > Lines checked: 6, Warnings: 1, Errors: 0 > --- > utilities/checkpatch.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py > index 6b293770d..891b24dcf 100755 > --- a/utilities/checkpatch.py > +++ b/utilities/checkpatch.py > @@ -739,7 +739,7 @@ infix_operators = \ > '&=', '^=', '|=', '<<=', '>>=']] \ > + [r'[^<" ]<[^=" ]', > r'[^\->" ]>[^=" ]', > - r'[^ !()/"]\*[^/]', > + r'[^ !()/"\*]\*[^/]', > r'[^ !&()"]&', > r'[^" +(]\+[^"+;]', > r'[^" \-(]\-[^"\->;]', Please, add a unit test for this issue. Best regards, Ilya Maximets. ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH] checkpatch: Don't warn on pointer to pointer.
Bleep bloop. Greetings Adrian Moreno, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. git-am: error: corrupt patch at line 6 error: could not build fake ancestor hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 checkpatch: Don't warn on pointer to pointer. When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". Patch skipped due to previous failure. Please check this out. If you feel there has been an error, please email acon...@redhat.com Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH] checkpatch: Don't warn on pointer to pointer.
Current regexp used to check whitespaces around operators does not consider that there can be more than one "*" together to express pointer to pointer. As a result, false positive warnings are raised [1]. Fix the regexp to allow more than one consecutive "+" characters. Signed-off-by: Adrian Moreno [1] Example of patch triggering false positives: > cat <>=']] \ + [r'[^<" ]<[^=" ]', r'[^\->" ]>[^=" ]', - r'[^ !()/"]\*[^/]', + r'[^ !()/"\*]\*[^/]', r'[^ !&()"]&', r'[^" +(]\+[^"+;]', r'[^" \-(]\-[^"\->;]', -- 2.45.1 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev