From: Andrew Morton Date: Sun, 25 Jun 2006 12:48:10 +0000 (-0700) Subject: [PATCH] for_each_cpu_mask() warning fix X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9de9adb615bddbdb786273c41ec3c03837e32fa5;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [PATCH] for_each_cpu_mask() warning fix On UP, this: cpumask_t mask = node_to_cpumask(numa_node_id()); for_each_cpu_mask(cpu, mask) does this: mm/readahead.c: In function `node_readahead_aging': mm/readahead.c:850: warning: unused variable `mask' which is unpleasantly fixed by this: Acked-by: Paul Jackson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index fb5b761e3444..b268a3c0c376 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -317,7 +317,8 @@ static inline void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp, (cpu) < NR_CPUS; \ (cpu) = next_cpu((cpu), (mask))) #else /* NR_CPUS == 1 */ -#define for_each_cpu_mask(cpu, mask) for ((cpu) = 0; (cpu) < 1; (cpu)++) +#define for_each_cpu_mask(cpu, mask) \ + for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) #endif /* NR_CPUS */ /*