mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] checkpatch: warn for p0 patch only if prefix is not b
@ 2022-01-10 20:05 Dafna Hirschfeld
  2022-01-11 10:18 ` Lukas Bulwahn
  0 siblings, 1 reply; 5+ messages in thread
From: Dafna Hirschfeld @ 2022-01-10 20:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Dafna Hirschfeld, kernel, Andy Whitcroft, Joe Perches,
	Dwaipayan Ray, Lukas Bulwahn

It might be that file 'b' happens to exit. In that
case, if the prefix is also 'b' (which is the
common case) we get the falsely warning:

patch prefix 'b' exists, appears to be a -p0 patch

So warn only if prefix is not 'b'

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 1784921c645d..72263b142e39 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2821,7 +2821,7 @@ sub process {
 			$in_commit_log = 0;
 
 			$p1_prefix = $1;
-			if (!$file && $tree && $p1_prefix ne '' &&
+			if (!$file && $tree && $p1_prefix ne '' && $p1_prefix ne 'b' &&
 			    -e "$root/$p1_prefix") {
 				WARN("PATCH_PREFIX",
 				     "patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n");
-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-11 12:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-10 20:05 [PATCH] checkpatch: warn for p0 patch only if prefix is not b Dafna Hirschfeld
2022-01-11 10:18 ` Lukas Bulwahn
2022-01-11 10:47   ` Dafna Hirschfeld
2022-01-11 11:27     ` Lukas Bulwahn
2022-01-11 12:06       ` Dafna Hirschfeld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome