Linux Documentation
 help / color / mirror / Atom feed
* [PATCH 1/6] mm/damon: fix missing parens in macro arguments
@ 2026-05-18 19:09 Maksym Shcherba
  2026-05-18 19:09 ` [PATCH 2/6] mm/damon/sysfs: implement update_schemes_quota_goals command Maksym Shcherba
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Maksym Shcherba @ 2026-05-18 19:09 UTC (permalink / raw)
  To: sj, akpm
  Cc: david, ljs, liam, vbabka, rppt, surenb, mhocko, corbet, skhan,
	damon, linux-mm, linux-kernel, linux-doc, linux-kselftest,
	Maksym Shcherba

The DAMON iterator macros do not wrap their pointer arguments with
parentheses. This can cause build failures when the argument is a
complex expression due to operator precedence issues.

Add missing parentheses around the arguments in the following macros
to prevent potential build failures:
- damon_for_each_region()
- damon_for_each_region_from()
- damon_for_each_region_safe()
- damos_for_each_quota_goal()

Assisted-by: Antigravity:Gemini-3.1-Pro
Signed-off-by: Maksym Shcherba <maksym.shcherba@lnu.edu.ua>
---
 include/linux/damon.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/damon.h b/include/linux/damon.h
index 4d4f031bcb45..32f2318ac77f 100644
--- a/include/linux/damon.h
+++ b/include/linux/damon.h
@@ -902,13 +902,13 @@ static inline unsigned long damon_sz_region(struct damon_region *r)
 
 
 #define damon_for_each_region(r, t) \
-	list_for_each_entry(r, &t->regions_list, list)
+	list_for_each_entry(r, &(t)->regions_list, list)
 
 #define damon_for_each_region_from(r, t) \
-	list_for_each_entry_from(r, &t->regions_list, list)
+	list_for_each_entry_from(r, &(t)->regions_list, list)
 
 #define damon_for_each_region_safe(r, next, t) \
-	list_for_each_entry_safe(r, next, &t->regions_list, list)
+	list_for_each_entry_safe(r, next, &(t)->regions_list, list)
 
 #define damon_for_each_target(t, ctx) \
 	list_for_each_entry(t, &(ctx)->adaptive_targets, list)
@@ -923,7 +923,7 @@ static inline unsigned long damon_sz_region(struct damon_region *r)
 	list_for_each_entry_safe(s, next, &(ctx)->schemes, list)
 
 #define damos_for_each_quota_goal(goal, quota) \
-	list_for_each_entry(goal, &quota->goals, list)
+	list_for_each_entry(goal, &(quota)->goals, list)
 
 #define damos_for_each_quota_goal_safe(goal, next, quota) \
 	list_for_each_entry_safe(goal, next, &(quota)->goals, list)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-05-19 15:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-18 19:09 [PATCH 1/6] mm/damon: fix missing parens in macro arguments Maksym Shcherba
2026-05-18 19:09 ` [PATCH 2/6] mm/damon/sysfs: implement update_schemes_quota_goals command Maksym Shcherba
2026-05-19  0:17   ` SeongJae Park
2026-05-19  7:33     ` Maksym Shcherba
2026-05-19 15:08       ` SeongJae Park
2026-05-18 19:09 ` [PATCH 3/6] Docs/ABI/damon: document " Maksym Shcherba
2026-05-18 19:09 ` [PATCH 4/6] Docs/admin-guide/mm/damon/usage: document update_schemes_quota_goals sysfs command Maksym Shcherba
2026-05-18 19:09 ` [PATCH 5/6] selftests/damon/_damon_sysfs: support update_schemes_quota_goals Maksym Shcherba
2026-05-18 19:09 ` [PATCH 6/6] selftests/damon: add a test for update_schemes_quota_goals Maksym Shcherba
2026-05-19  0:10 ` [PATCH 1/6] mm/damon: fix missing parens in macro arguments SeongJae Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox