[Devel] [PATCH rh7 v2 04/10] tcache: Remove excess variable from tcache_lru_isolate()

Kirill Tkhai ktkhai at virtuozzo.com
Wed Aug 16 14:52:32 MSK 2017


We have two variables (nr and nr_isolated), which show the same.
Kill one of them.

v2: new

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 mm/tcache.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/mm/tcache.c b/mm/tcache.c
index f2a9f439afb..ed04f810b55 100644
--- a/mm/tcache.c
+++ b/mm/tcache.c
@@ -1028,7 +1028,7 @@ tcache_lru_isolate(int nid, struct page **pages, int nr_to_isolate)
 {
 	struct tcache_nodeinfo *ni = &tcache_nodeinfo[nid];
 	struct tcache_pool_nodeinfo *pni;
-	int nr, nr_isolated = 0;
+	int nr_isolated = 0;
 	struct rb_node *rbn;
 
 	spin_lock_irq(&ni->lock);
@@ -1045,9 +1045,8 @@ tcache_lru_isolate(int nid, struct page **pages, int nr_to_isolate)
 		goto again;
 
 	spin_lock(&pni->lock);
-	nr = __tcache_lru_isolate(pni, pages, nr_to_isolate);
-	ni->nr_pages -= nr;
-	nr_isolated += nr;
+	nr_isolated = __tcache_lru_isolate(pni, pages, nr_to_isolate);
+	ni->nr_pages -= nr_isolated;
 
 	if (!list_empty(&pni->lru))
 		__tcache_insert_reclaim_node(ni, pni);



More information about the Devel mailing list