<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 14, 2020 at 11:18 AM Lukas Bulwahn <<a href="mailto:lukas.bulwahn@gmail.com">lukas.bulwahn@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
On Tue, 14 Jul 2020, Mrinal Pandey wrote:<br>
<br>
> The usage of "capture group (...)" in the immediate condition after `&&`<br>
> results in `$1` being uninitialized. This issues a warning "Use of<br>
> uninitialized value $1 in regexp compilation at ./scripts/<a href="http://checkpatch.pl" rel="noreferrer" target="_blank">checkpatch.pl</a><br>
> line 2638".<br>
> <br>
> I noticed this bug while running checkpatch on the set of commits from<br>
> v5.7 to v5.8-rc1 of the kernel on the commits with a diff content in<br>
> their commit message.<br>
> <br>
> This bug was introduced in the script by commit e518e9a59ec3<br>
> ("checkpatch: emit an error when there's a diff in a changelog"). It has<br>
> been in the script since then.<br>
> <br>
> The author intended to store the match made by capture group in variable<br>
> `$1`. This should have contained the name of the file as `[\w/]+` matched.<br>
> However, this couldn't be accomplished due to usage of capture group and<br>
> `$1` in the same regular expression.<br>
> <br>
> Fix this by placing the capture group in the condition before `&&`.<br>
> Thus, `$1` can be initialized to the text that capture group matches<br>
> thereby setting it to the desired and required value.<br>
> <br>
> Reviewed-by: Lukas Bulwahn <<a href="mailto:lukas.bulwahn@gmail.com" target="_blank">lukas.bulwahn@gmail.com</a>><br>
> Tested-by: Lukas Bulwahn <<a href="mailto:lukas.bulwahn@gmail.com" target="_blank">lukas.bulwahn@gmail.com</a>><br>
> Signed-off-by: Mrinal Pandey <<a href="mailto:mrinalmni@gmail.com" target="_blank">mrinalmni@gmail.com</a>><br>
> ---<br>
> Changes since v1:<br>
> Add Reviewed-by and Tested-by tag<br>
><br>
<br>
<br>
Usually, the maintainers pick up those tags when they apply a patch to <br>
their tree, and the patch authors do not need to add those tags and resend <br>
the patch as a new version on the mailing list.<br></blockquote><div><br></div><div><div>Sir,</div><div><br></div><div>Thank you for your insight. I'll keep this in mind.</div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Mrinal, can you please go through and check the kernel documentation on <br>
submitting patches and find the places where it is pointed out that the <br>
maintainers usually apply those tags and the authors usually do not need <br>
to resend a new version of the patch with the tags applied?<br></blockquote><div><br></div><div>I read through <a href="https://www.kernel.org/doc/html/latest/process/submitting-patches.html" target="_blank">Submitting patches</a> and a few related pieces of documentation but<div>couldn't infer this information.</div><div><br></div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
If you cannot find such a statement in the documentation, please let us <br>
know where it would ideally added in the documentation. We can then create <br>
a patch for that together.<br></blockquote><div><br></div><div><div>The statement might be placed under <a href="https://www.kernel.org/doc/html/latest/process/submitting-patches.html#respond-to-review-comments" target="_blank">Respond to review comments</a> and maybe</div><div>it could further contain some information about how to send a new version of the patch.<br></div><div><br></div><div>Thank you.</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
Lukas<br>
</blockquote></div></div>