mm/vmscan.c: Clean code by removing unnecessary assignment
Subsystems (3)
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
@@ -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
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.Signed-off-by Mateusz Nosek <[email protected]>
It _was_ used, until commit f87bccde6a7dd1bdb219a4045e8ac111590c9314 which removed lru_pages. So this is just a left-over, and I agree it's now superfluous.
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.Signed-off-by Mateusz Nosek <[email protected]>
Signature · 2 lines
Wei Yang Help you, Help me
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.Signed-off-by Mateusz Nosek <[email protected]>--- mm/vmscan.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)mm/vmscan.c +0
-0@@ -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
-3case 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