[PATCH] nfs_show_stats: for_each_possible_cpu(), not NR_CPUS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Convert a for-loop that explicitly references "NR_CPUS" into the potentially
more efficient for_each_possible_cpu() construct.

Signed-off-by: John Hawkes <[email protected]>

Index: linux/fs/nfs/inode.c
--- linux.orig/fs/nfs/inode.c	2006-04-13 12:48:18.000000000 -0700
+++ linux/fs/nfs/inode.c	2006-04-13 15:49:23.000000000 -0700
@@ -700,12 +700,9 @@ static int nfs_show_stats(struct seq_fil
 	 * Display superblock I/O counters
-	for (cpu = 0; cpu < NR_CPUS; cpu++) {
+	for_each_possible_cpu(cpu) {
 		struct nfs_iostats *stats;
-		if (!cpu_possible(cpu))
-			continue;
 		stats = per_cpu_ptr(nfss->io_stats, cpu);
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux