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

Christophe JAILLET <[email protected]> Thu, 26 May 2022 07:02:49 +0200
Newsgroups org.kernel.vger.smatch
Message-ID <6ad9570f2f3231fca7b515e9e3d79cb8bbbd7f6c.1653541351.git.christophe.jaillet@wanadoo.fr>
The warning message has a hard-coded 'kvmalloc' 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_kvmalloc_NOFS.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/check_kvmalloc_NOFS.c b/check_kvmalloc_NOFS.c
index c32f6805b78e..fba9564e84fa 100644
--- a/check_kvmalloc_NOFS.c
+++ b/check_kvmalloc_NOFS.c
@@ -33,7 +33,7 @@ static void match_alloc(const char *fn, struct expression *expr, void *_arg)
 	    !(sval.uvalue & GFP_ATOMIC()))
 		return;
 
-	sm_error("kvmalloc() does not make sense for no sleep code");
+	sm_error("%s() does not make sense for no sleep code", fn);
 }
 
 void check_kvmalloc_NOFS(int id)
-- 
2.34.1