[PATCH] clang-format: Fix formatting of guard() and scoped_guard() statements

From: Bart Van Assche

Date: Mon Apr 13 2026 - 14:26:25 EST


Without this patch clang-format formats guard() and scoped_guard()
statements as follows:

guard(...)(...)
{
...
}

With this patch clang-format formats guard() and scoped_guard()
statements as follows:

guard(...)(...) {
...
}

Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
---
.clang-format | 2 ++
1 file changed, 2 insertions(+)

diff --git a/.clang-format b/.clang-format
index 1cc151e2adcc..6a3de86ab27a 100644
--- a/.clang-format
+++ b/.clang-format
@@ -481,6 +481,7 @@ ForEachMacros:
- 'genradix_for_each'
- 'genradix_for_each_from'
- 'genradix_for_each_reverse'
+ - 'guard'
- 'hash_for_each'
- 'hash_for_each_possible'
- 'hash_for_each_possible_rcu'
@@ -674,6 +675,7 @@ ForEachMacros:
- 'rq_list_for_each'
- 'rq_list_for_each_safe'
- 'sample_read_group__for_each'
+ - 'scoped_guard'
- 'scsi_for_each_prot_sg'
- 'scsi_for_each_sg'
- 'sctp_for_each_hentry'