[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1610675453-14603-1-git-send-email-yejune.deng@gmail.com>
Date: Fri, 15 Jan 2021 09:50:53 +0800
From: Yejune Deng <yejune.deng@...il.com>
To: rdunlap@...radead.org, yejune.deng@...il.com,
akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] lib: dynamic_queue_limits: use memset and offsetof init
In dql_reset(), use memset and offsetof instead of '= 0'.
Signed-off-by: Yejune Deng <yejune.deng@...il.com>
---
lib/dynamic_queue_limits.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/lib/dynamic_queue_limits.c b/lib/dynamic_queue_limits.c
index fde0aa2..21f0745 100644
--- a/lib/dynamic_queue_limits.c
+++ b/lib/dynamic_queue_limits.c
@@ -116,13 +116,7 @@ void dql_completed(struct dql *dql, unsigned int count)
void dql_reset(struct dql *dql)
{
/* Reset all dynamic values */
- dql->limit = 0;
- dql->num_queued = 0;
- dql->num_completed = 0;
- dql->last_obj_cnt = 0;
- dql->prev_num_queued = 0;
- dql->prev_last_obj_cnt = 0;
- dql->prev_ovlimit = 0;
+ memset(dql, 0, offsetof(struct dql, lowest_slack));
dql->lowest_slack = UINT_MAX;
dql->slack_start_time = jiffies;
}
--
1.9.1
Powered by blists - more mailing lists