From df508d3a208dd381dd46e7dab1a32e91dc11b609 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 29 Feb 2024 16:57:41 +0300 Subject: [PATCH] kvmalloc_NOFS: silence "does not make sense for no sleep code" false positives The GFP flags were recently re-worked and Smatch is too stupid to figure out the current value of the __GFP_DIRECT_RECLAIM flag. Disable this check if the GFP_DIRECT_RECLAIM() function fails. Signed-off-by: Dan Carpenter --- 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 5f048228..5372c72e 100644 --- a/check_kvmalloc_NOFS.c +++ b/check_kvmalloc_NOFS.c @@ -29,7 +29,7 @@ static void match_alloc(const char *fn, struct expression *expr, void *_arg) if (!get_value(arg_expr, &sval)) return; - if (sval.value & GFP_DIRECT_RECLAIM()) + if (!GFP_DIRECT_RECLAIM() || (sval.value & GFP_DIRECT_RECLAIM())) return; sm_error("%s() does not make sense for no sleep code", fn); -- 2.11.4.GIT