diff options
author | Matthieu Baerts <[email protected]> | 2023-04-03 18:23:47 +0200 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2023-04-18 16:39:32 -0700 |
commit | c917a872cee480d1fc8461da9be93e27e7977877 (patch) | |
tree | b8391a8ecb9f6f71d7166e1546a5f7eda52f0d53 | |
parent | 0d828200ad56505a827610af876ca0b138b943a6 (diff) |
checkpatch: don't print the next line if not defined
When checking if "Reported-by" tag is followed by "Link:", there is no
need to print the next line if there is no next line.
While at it, also mention in this case that the "Link:" tag should be
followed by a URL, similar to the next warning.
By doing that, the code is now similar to what is done above when checking
if the Co-developed-by tag is properly used.
Link: https://lkml.kernel.org/r/20230314-doc-checkpatch-closes-tag-v4-2-d26d1fa66f9f@tessares.net
Fixes: d7f1d71e5ef6 ("checkpatch: warn when Reported-by: is not followed by Link:")
Signed-off-by: Matthieu Baerts <[email protected]>
Acked-by: Joe Perches <[email protected]>
Cc: Andy Whitcroft <[email protected]>
Cc: Bagas Sanjaya <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Dwaipayan Ray <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Kai Wasserbäch <[email protected]>
Cc: Konstantin Ryabitsev <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Lukas Bulwahn <[email protected]>
Cc: Thorsten Leemhuis <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
-rwxr-xr-x | scripts/checkpatch.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index c7cd0750b41e..8e22eb45ab2d 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3162,7 +3162,7 @@ sub process { if ($sign_off =~ /^reported(?:|-and-tested)-by:$/i) { if (!defined $lines[$linenr]) { WARN("BAD_REPORTED_BY_LINK", - "Reported-by: should be immediately followed by Link: to the report\n" . $herecurr . $rawlines[$linenr] . "\n"); + "Reported-by: should be immediately followed by Link: with a URL to the report\n" . $herecurr . "\n"); } elsif ($rawlines[$linenr] !~ m{^link:\s*https?://}i) { WARN("BAD_REPORTED_BY_LINK", "Reported-by: should be immediately followed by Link: with a URL to the report\n" . $herecurr . $rawlines[$linenr] . "\n"); |