[Linux-kernel-mentees] [PATCH v2] checkpatch: handle line break between commit and hash value

Lukas Bulwahn lukas.bulwahn at gmail.com
Sun Sep 13 18:09:53 UTC 2020



On Sun, 13 Sep 2020, Ayush wrote:

> > Did checkpatch.pl output on other types change?
> > 
> > One of the testers on this list reported that two COMMIT_LOG_LONG_LINE
> > reports disappeared. That should not have happened, right?
> > 
> > I had a look at the checkpatch.pl output for commit 0a2bd55c194a ("dm
> > integrity: document allow_discard option").
> > 
> > I think the reported line is wrong here.
> 
> After the patch, It reports the following line:
> 
> #6: 
> Add decription of the allow_discard option added in commit
> 
> Which I think is right as the author wanted to refer commit, which started from the word "commit"
> in the reported line only.
> 
> Please give your opinion on this. 
>

Well, I think the line number should point to the line where the error is 
and which needs to be fixed.

Can you point me to the error in line 6 that checkpatch.pl complains 
about?

Or is the error in line 7? :)

By that logic above, it should then point out line 7.

I have seen compiler and tool output always point to the line where the 
syntax error is, not to the line where the command might have started etc.
 
> 
> > Also, the line number for other cases have changed.
> 
> 
> Actually I am noticing a weird thing. When I run checkpacth.pl on multiple commits using v5.7..v5.8,
> It is not showing correct output, like for some commits, I can see the command when run on multiple commits
> did not report an error but when I ran on that individual commit, it's reporting an error.
> 
> 
> - Running scripts/checkpatch.pl --show-types -g v5.7..v5.8, gives (for this particular commit):
> 
> -----------------------------------------------------------------------------------------------
> Commit 3dbf1ee6abbb ("pinctrl: cherryview: Add missing spinlock usage in chv_gpio_irq_handler")
> -----------------------------------------------------------------------------------------------
> total: 0 errors, 0 warnings, 15 lines checked
> 
> Commit 3dbf1ee6abbb ("pinctrl: cherryview: Add missing spinlock usage in chv_gpio_irq_handler") has no obvious style problems and is ready for submission.
> 
> 
> 
> - Running scripts/checkpatch.pl --show-types -g 3dbf1ee6abbb, gives:
> 
> 
> ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit cdca06e4e859 ("pinctrl: baytrail: Add missing spinlock usage in byt_gpio_irq_handler")'
> #11: 
> cdca06e4e859 ("pinctrl: baytrail: Add missing spinlock usage in
> 
> total: 1 errors, 0 warnings, 15 lines checked
> 
> NOTE: For some of the reported defects, checkpatch may be able to
>       mechanically convert to the typical style using --fix or --fix-inplace.
> 
> Commit 3dbf1ee6abbb ("pinctrl: cherryview: Add missing spinlock usage in chv_gpio_irq_handler") has style problems, please review.
> 
> 
> 
> This is the reason the analysis on a large no. of commits was incorrect.
> 
> I need to investigate this more and check if it's an issue on my side or on the checkpatch.pl side.
> 

Yes, we should investigate that. If checkpatch.pl does not work properly 
with git ranges, we should fix that first. Otherwise, all our evaluations 
are broken...

> Also, I noticed one more issue with my patch, it doesn't handle cases like:
> 
> - commit
> 1234567890ab ("foo
> bar")
> 
> 
> Due to this, some new GIT_COMMIT_ID errors were also reported.
> 
> So, I will try to address this in the next version.
> 

Looking forward to your next version.

Lukas


More information about the Linux-kernel-mentees mailing list