VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   55 Tags
author: Miaohe Lin <linmiaohe@huawei.com> 2021-09-02 15:01:05 -0700 committer: Linus Torvalds <torvalds@linux-foundation.org> 2021-09-03 09:58:18 -0700 commit: 64632fd3eb4611780a1190362f2119d8f2bb5465 parent: ea15ba17b434b7dd7f92bb85b7e5cf53707733ad
Commit Summary:
mm/vmstat: simplify the array size calculation
Diffstat:
1 file changed, 3 insertions, 5 deletions
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 5bd621eadc48..c4634dc83916 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1891,17 +1891,15 @@ static bool need_update(int cpu)
 		/*
 		 * The fast way of checking if there are any vmstat diffs.
 		 */
-		if (memchr_inv(pzstats->vm_stat_diff, 0, NR_VM_ZONE_STAT_ITEMS *
-			       sizeof(pzstats->vm_stat_diff[0])))
+		if (memchr_inv(pzstats->vm_stat_diff, 0, sizeof(pzstats->vm_stat_diff)))
 			return true;
 
 		if (last_pgdat == zone->zone_pgdat)
 			continue;
 		last_pgdat = zone->zone_pgdat;
 		n = per_cpu_ptr(zone->zone_pgdat->per_cpu_nodestats, cpu);
-		if (memchr_inv(n->vm_node_stat_diff, 0, NR_VM_NODE_STAT_ITEMS *
-			       sizeof(n->vm_node_stat_diff[0])))
-		    return true;
+		if (memchr_inv(n->vm_node_stat_diff, 0, sizeof(n->vm_node_stat_diff)))
+			return true;
 	}
 	return false;
 }