Skip to contentSkip to conversation

mm/vmscan.c: Clean code by removing unnecessary assignment

PATCH Applied [email protected] 4 participants 4 messages Feb 29, 2020 – Mar 3, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/vmscan.c: Clean code by removing unnecessary assignment

From: Mateusz Nosek <[email protected]>

Previously 0 was assigned to variable 'lruvec_size', but the variable was never read later.
So the assignment can be removed.

---
 mm/vmscan.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
mm/vmscan.c +1 -3
index f14c8c6069a6..a605ff36f126 100644
@@ -2427,10 +2427,8 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
 		case SCAN_FILE:
 		case SCAN_ANON:
 			/* Scan one type exclusively */
-			if ((scan_balance == SCAN_FILE) != file) {
-				lruvec_size = 0;
+			if ((scan_balance == SCAN_FILE) != file)
 				scan = 0;
-			}
 			break;
 		default:
 			/* Look ma, no brain */
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · On Sat, Feb 29, 2020 at 10:40:22PM +0100, [email protected] wrote:

From: Mateusz Nosek <[email protected]>

Previously 0 was assigned to variable 'lruvec_size', but the variable was never read later.
So the assignment can be removed.

It _was_ used, until commit f87bccde6a7dd1bdb219a4045e8ac111590c9314 which removed lru_pages. So this is just a left-over, and I agree it's now superfluous.

Reviewed-by on v1 1/1
#3 lore raw
In reply to [email protected]
Quoted 18 lines · On 29.02.20 22:40, [email protected] wrote:

From: Mateusz Nosek <[email protected]>

Previously 0 was assigned to variable 'lruvec_size', but the variable was never read later.
So the assignment can be removed.

---
 mm/vmscan.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
mm/vmscan.c +0 -0
index f14c8c6069a6..a605ff36f126 100644
@@ -2427,10 +2427,8 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
 		case SCAN_FILE:

mm/vmscan.c static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc, · line 2434

Quoted 10 lines
mm/vmscan.c +1 -3
 		case SCAN_ANON:
 			/* Scan one type exclusively */
-			if ((scan_balance == SCAN_FILE) != file) {
-				lruvec_size = 0;
+			if ((scan_balance == SCAN_FILE) != file)
 				scan = 0;
-			}
 			break;
 		default:
 			/* Look ma, no brain */
Signature · 3 lines
Thanks,

David / dhildenb