mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yejune Deng <yejune.deng@gmail.com>
To: rdunlap@infradead.org, yejune.deng@gmail.com, akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] lib: dynamic_queue_limits: use memset and offsetof init
Date: Fri, 15 Jan 2021 09:50:53 +0800	[thread overview]
Message-ID: <1610675453-14603-1-git-send-email-yejune.deng@gmail.com> (raw)

In dql_reset(), use memset and offsetof instead of '= 0'.

Signed-off-by: Yejune Deng <yejune.deng@gmail.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


             reply	other threads:[~2021-01-15  1:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15  1:50 Yejune Deng [this message]
     [not found] ` <202101151210.n0rr01he-lkp@intel.com>
2021-01-15  6:33   ` Yejune Deng
2021-01-16  0:53     ` Yejune Deng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1610675453-14603-1-git-send-email-yejune.deng@gmail.com \
    --to=yejune.deng@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®