From 67a76894b70f73c62b7eb2d05a02ef282c16ec82 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sun, 21 Jul 2024 12:19:44 -0700 Subject: [PATCH] tools/checkpatch: recognize `+` as unary operator Allow using "+1" when meaningful (i.e. cmd_graph_merge wants -1 or +1) Signed-off-by: David Lamparter --- tools/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/checkpatch.pl b/tools/checkpatch.pl index 3e7abeda39..2c773f7fbc 100755 --- a/tools/checkpatch.pl +++ b/tools/checkpatch.pl @@ -5150,7 +5150,7 @@ sub process { # none after. May be left adjacent to another # unary operator, or a cast } elsif ($op eq '!' || $op eq '~' || - $opv eq '*U' || $opv eq '-U' || + $opv eq '*U' || $opv eq '-U' || $opv eq '+U' || $opv eq '&U' || $opv eq '&&U') { if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) { if (ERROR("SPACING", -- 2.39.5