[PATCH] kernel: add some more once_through macros
From: Dan Carpenter
Date: Thu Dec 18 2025 - 06:17:36 EST
These macro loops always iterate at least once.
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
check_kernel.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/check_kernel.c b/check_kernel.c
index 0db972637aa2..03d1982db49c 100644
--- a/check_kernel.c
+++ b/check_kernel.c
@@ -765,7 +765,7 @@ static bool delete_pci_error_returns(struct expression *expr)
return false;
}
-static bool match_with_intel_runtime(struct statement *stmt)
+static bool match_once_through_macros(struct statement *stmt)
{
char *macro;
@@ -774,7 +774,10 @@ static bool match_with_intel_runtime(struct statement *stmt)
return false;
if (strncmp(macro, "with_intel_runtime", 18) == 0 ||
strncmp(macro, "with_intel_display", 18) == 0 ||
- strcmp(macro, "drm_exec_until_all_locked") == 0)
+ strcmp(macro, "drm_exec_until_all_locked") == 0 ||
+ strcmp(macro, "xe_validation_guard") == 0 ||
+ strcmp(macro, "for_each_gt") == 0 ||
+ strcmp(macro, "for_each_online_cpu") ==0)
return true;
return false;
}
@@ -821,7 +824,7 @@ void check_kernel(int id)
add_function_hook("closure_call", &match_closure_call, NULL);
add_function_hook("put_device", &match_put_device, NULL);
- add_once_through_hook(&match_with_intel_runtime);
+ add_once_through_hook(&match_once_through_macros);
add_hook(fix_msecs_to_jiffies, ASSIGNMENT_HOOK_AFTER);
add_hook(&match_kernel_param, BASE_HOOK);
--
2.51.0