From: Wei Yongjun Date: Fri, 14 Sep 2012 02:31:21 +0000 (+0800) Subject: s390/topology: use for_each_set_bit to simplify the code X-Git-Tag: upstream/snapshot3+hdmi~6599^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0327dab0e88b2f4be6ad7dcd5af86d085d2c0603;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git s390/topology: use for_each_set_bit to simplify the code Use for_each_set_bit() to simplify the code. spatch with a semantic match is used to found this. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index 30c8533..54d93f4 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c @@ -73,10 +73,7 @@ static struct mask_info *add_cpus_to_mask(struct topology_cpu *tl_cpu, { unsigned int cpu; - for (cpu = find_first_bit(&tl_cpu->mask[0], TOPOLOGY_CPU_BITS); - cpu < TOPOLOGY_CPU_BITS; - cpu = find_next_bit(&tl_cpu->mask[0], TOPOLOGY_CPU_BITS, cpu + 1)) - { + for_each_set_bit(cpu, &tl_cpu->mask[0], TOPOLOGY_CPU_BITS) { unsigned int rcpu; int lcpu;