From patchwork Fri Sep 14 02:30:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1455121 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (unknown [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id EDA6FDF24C for ; Fri, 14 Sep 2012 02:42:07 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TCLgS-0005hu-Pc; Fri, 14 Sep 2012 02:31:08 +0000 Received: from mail-qa0-f49.google.com ([209.85.216.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TCLgK-0005bo-1w for linux-arm-kernel@lists.infradead.org; Fri, 14 Sep 2012 02:31:04 +0000 Received: by mail-qa0-f49.google.com with SMTP id k1so2449379qaf.15 for ; Thu, 13 Sep 2012 19:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=Cj2rPU6Yg4YQCOvmyxb872V7F1JAp6elE4UjRFDP1eo=; b=irWkm3x7f0pGIoh30IwZU3lBlxY+/99ptijk53gCk5pfHGZ/llwEryLF1FmJ4XaSwY GiVs6K+Ye15x5s0dL3hNACnGhhMJDRJ2UrZS7+QnLjbt04pmyxaCAkX2RPFeNWbse10R ijTY7BFOppFMPecrbqvnmcGaFfJ3wJ5FDGbR2C3OUaIEIPZxNL6VjiwxzEbKGJiFeUU5 VgShyD3vwzIvHxYTW4qIo5MPEfw19vbhhPN7lbi0BwG9AKkYziZrxvVaYSbvIQtJqR/E WcSHkvvvc1Exwom5l2dorp5UG5On0YzK9IkMN99fyOSHn9JncgjW85fJ28QlNGB2loWh zKOQ== MIME-Version: 1.0 Received: by 10.224.178.4 with SMTP id bk4mr3907786qab.38.1347589859885; Thu, 13 Sep 2012 19:30:59 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Thu, 13 Sep 2012 19:30:59 -0700 (PDT) Date: Fri, 14 Sep 2012 10:30:59 +0800 Message-ID: Subject: [PATCH] ARM: mmp: using for_each_set_bit to simplify the code From: Wei Yongjun To: eric.y.miao@gmail.com, haojian.zhuang@gmail.com, linux@arm.linux.org.uk X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.216.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (weiyj.lk[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: yongjun_wei@trendmicro.com.cn, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Wei Yongjun Using 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 --- arch/arm/mach-mmp/irq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm/mach-mmp/irq.c b/arch/arm/mach-mmp/irq.c index e60c7d9..3c71246 100644 --- a/arch/arm/mach-mmp/irq.c +++ b/arch/arm/mach-mmp/irq.c @@ -153,10 +153,8 @@ static void icu_mux_irq_demux(unsigned int irq, struct irq_desc *desc) status = readl_relaxed(data->reg_status) & ~mask; if (status == 0) break; - n = find_first_bit(&status, BITS_PER_LONG); - while (n < BITS_PER_LONG) { + for_each_set_bit(n, &status, BITS_PER_LONG) { generic_handle_irq(icu_data[i].virq_base + n); - n = find_next_bit(&status, BITS_PER_LONG, n + 1); } } }