All of lore.kernel.org
 help / color / mirror / Atom feed
From: hui yang <yanghui.def@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, YangHui <yanghui.def@gmail.com>
Subject: [PATCH] mm: reduced code declaration
Date: Fri, 18 Dec 2020 18:32:49 +0800	[thread overview]
Message-ID: <1608287569-4689-1-git-send-email-yanghui.def@gmail.com> (raw)

From: YangHui <yanghui.def@gmail.com>

make code more formal.

Signed-off-by: YangHui <yanghui.def@gmail.com>
---
 mm/vmscan.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 1b8f0e0..1fea0b4 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2425,7 +2425,7 @@ static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
 {
 	unsigned long nr[NR_LRU_LISTS];
 	unsigned long targets[NR_LRU_LISTS];
-	unsigned long nr_to_scan;
+	unsigned long nr_to_scan, scan_target;
 	enum lru_list lru;
 	unsigned long nr_reclaimed = 0;
 	unsigned long nr_to_reclaim = sc->nr_to_reclaim;
@@ -2492,12 +2492,12 @@ static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
 			break;
 
 		if (nr_file > nr_anon) {
-			unsigned long scan_target = targets[LRU_INACTIVE_ANON] +
+			scan_target = targets[LRU_INACTIVE_ANON] +
 						targets[LRU_ACTIVE_ANON] + 1;
 			lru = LRU_BASE;
 			percentage = nr_anon * 100 / scan_target;
 		} else {
-			unsigned long scan_target = targets[LRU_INACTIVE_FILE] +
+			scan_target = targets[LRU_INACTIVE_FILE] +
 						targets[LRU_ACTIVE_FILE] + 1;
 			lru = LRU_FILE;
 			percentage = nr_file * 100 / scan_target;
-- 
2.7.4



             reply	other threads:[~2020-12-18 11:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 10:32 hui yang [this message]
2020-12-18 18:02 ` [PATCH] mm: reduced code declaration Andrew Morton
2020-12-19  1:14 ` Chris Down

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=1608287569-4689-1-git-send-email-yanghui.def@gmail.com \
    --to=yanghui.def@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.