[PATCH] test_bit: Report the correct function name that triggered the warning

Christophe JAILLET <[email protected]> Sat, 21 May 2022 11:49:20 +0200
Newsgroups org.kernel.vger.smatch
Message-ID <901c0689f8bca129102ffa3394648b14afe7e3e8.1653126103.git.christophe.jaillet@wanadoo.fr>
The warning message has a hard-coded 'test_bit' but several other functions
can trigger this warning.
So, report the correct function name to be less puzzling.

Signed-off-by: Christophe JAILLET <[email protected]>
---
 check_test_bit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/check_test_bit.c b/check_test_bit.c
index a26a12ab643c..b09139aa89bb 100644
--- a/check_test_bit.c
+++ b/check_test_bit.c
@@ -35,7 +35,7 @@ static void match_test_bit(const char *fn, struct expression *expr, void *data)
 	macro = get_macro_name(arg->pos);
 	if (macro && strstr(macro, "cpu_has"))
 		return;
-	sm_warning("test_bit() takes a bit number");
+	sm_warning("%s() takes a bit number", fn);
 }
 
 void check_test_bit(int id)
-- 
2.34.1