[PATCH 1/1] mm/damon/core: Remove unnecessary zero-initialization in damon_new_ctx()

From: Adrian Huang (Lenovo)

Date: Fri Oct 16 2026 - 11:05:49 EST


damon_new_ctx() allocates the context structure using kzalloc(),
which already initializes all fields to zero.

The explicit initialization of passed_sample_intervals,
next_aggregation_sis, and next_ops_update_sis is therefore redundant.
In addition, they are later initialized by kdamond_init_ctx() before use.

Remove the unnecessary assignments to simplify the code.

Signed-off-by: Adrian Huang (Lenovo) <adrianhuang0701@xxxxxxxxx>
---
mm/damon/core.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/mm/damon/core.c b/mm/damon/core.c
index b63e60ef8990..74e6022ca137 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -918,11 +918,6 @@ struct damon_ctx *damon_new_ctx(void)
ctx->attrs.aggr_interval = 100 * 1000;
ctx->attrs.ops_update_interval = 60 * 1000 * 1000;

- ctx->passed_sample_intervals = 0;
- /* These will be set from kdamond_init_ctx() */
- ctx->next_aggregation_sis = 0;
- ctx->next_ops_update_sis = 0;
-
mutex_init(&ctx->kdamond_lock);
INIT_LIST_HEAD(&ctx->call_controls);
mutex_init(&ctx->call_controls_lock);
--
2.53.0