smatch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: smatch@vger.kernel.org
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: [PATCH] test_bit: Report the correct function name that triggered the warning
Date: Sat, 21 May 2022 11:49:20 +0200	[thread overview]
Message-ID: <901c0689f8bca129102ffa3394648b14afe7e3e8.1653126103.git.christophe.jaillet@wanadoo.fr> (raw)

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 <christophe.jaillet@wanadoo.fr>
---
 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

                 reply	other threads:[~2022-05-21  9:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=901c0689f8bca129102ffa3394648b14afe7e3e8.1653126103.git.christophe.jaillet@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=smatch@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).