Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932420AbbFSIwv (ORCPT ); Fri, 19 Jun 2015 04:52:51 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:56666 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932160AbbFSIwq (ORCPT ); Fri, 19 Jun 2015 04:52:46 -0400 X-AuditID: cbfee68e-f79c56d000006efb-a3-5583d85c3f5c From: Maninder Singh To: tglx@linutronix.de, jason@lakedaemon.net, linux-kernel@vger.kernel.org Cc: pankaj.m@samsung.com, Maninder Singh Subject: [PATCH 1/1] irq-gic: use BUG_ON instead of if()/BUG Date: Fri, 19 Jun 2015 14:22:18 +0530 Message-id: <1434703938-19180-1-git-send-email-maninder1.s@samsung.com> X-Mailer: git-send-email 2.1.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCLMWRmVeSWpSXmKPExsWyRsSkTjfmRnOowdMn5haNSy6zWFzeNYfN 4vD8NhaLe2+2Mlls3jSV2YHVo+HAeRaPd+fOsXv0bVnF6PF5k1wASxSXTUpqTmZZapG+XQJX xtUpK9gLFghVnJv4i6mBsY+/i5GTQ0LARGLP7rXsELaYxIV769m6GLk4hASWMkqsb93AClO0 7ucHVojEdEaJRVOfMkI4k5gk1kw6BNbOJqAnsWrXHhYQW0TAS2LulmVMXYwcHMwCThLTv+qB hIUFbCT2Ne9nBrFZBFQl3q2dwwhi8wq4S/yecIgNYpmcxPnjP5lB5ksIvGaTWPzlPCtEg4DE t8mHWEBmSgjISmw6wAxRLylxcMUNlgmMggsYGVYxiqYWJBcUJ6UXGekVJ+YWl+al6yXn525i BAbm6X/P+nYw3jxgfYhRgINRiYfX40BzqBBrYllxZe4hRlOgDROZpUST84Hhn1cSb2hsZmRh amJqbGRuaaYkzpsg9TNYSCA9sSQ1OzW1ILUovqg0J7X4ECMTB6dUA2NtLVPByltPeq6UbP/Y NTFj35vFotsr4vdI3U8/dyFzw5SSa+Jfdy1e3bNEbs/bjIOL5p7q2nwkReTfOnEPwZ+/mbIW GB/X+HZN4HTy7vsT71zgqpSf1bX75+vq3vDLPO7H/no031BOqFbZ+rtQ+sz/Ns3lffIzM6aw WTcd2MK6wV836Zt55p8VSizFGYmGWsxFxYkAL4/KgUcCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHLMWRmVeSWpSXmKPExsVy+t9jQd2YG82hBq9O6Fg0LrnMYnF51xw2 i8Pz21gs7r3ZymSxedNUZgdWj4YD51k83p07x+7Rt2UVo8fnTXIBLFENjDYZqYkpqUUKqXnJ +SmZeem2St7B8c7xpmYGhrqGlhbmSgp5ibmptkouPgG6bpk5QIuVFMoSc0qBQgGJxcVK+naY JoSGuOlawDRG6PqGBMH1GBmggYQ1jBlXp6xgL1ggVHFu4i+mBsY+/i5GTg4JAROJdT8/sELY YhIX7q1n62Lk4hASmM4osWjqU0YIZxKTxJpJh9hBqtgE9CRW7drDAmKLCHhJzN2yjKmLkYOD WcBJYvpXPZCwsICNxL7m/cwgNouAqsS7tXMYQWxeAXeJ3xMOsUEsk5M4f/wn8wRG7gWMDKsY RVMLkguKk9JzjfSKE3OLS/PS9ZLzczcxgsP+mfQOxlUNFocYBTgYlXh4A483hwqxJpYVV+Ye YpTgYFYS4WXcCRTiTUmsrEotyo8vKs1JLT7EaAq0fSKzlGhyPjAm80riDY1NzE2NTS1NLEzM LJXEeU/m+4QKCaQnlqRmp6YWpBbB9DFxcEo1MOac/VotYb1Dw0f6jcEvU3HRCff8VpyYIreU gXmp1PZ/bAFP5zKV2wufqGiJO3qzbnFzRGb8/XMO1zUtudctelFkqTst8KlVhWIO+wnHx+tn ZDOmRazOlU1tiPtuFWq5LlBp3fMX5lxaRdHx9jYHJeLyUq9J2d7x8D3Emf+uSVpCSmyVAlux EktxRqKhFnNRcSIAUTL6YpECAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2505 Lines: 81 Use BUG_ON(condition) instead of if(condition)/BUG() As given in scripts/coccinelle/misc/bugon.cocci Signed-off-by: Maninder Singh Reviewed-by: Vaneet Narang --- drivers/irqchip/irq-gic.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 8d7e1c8..b222c7b 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -329,8 +329,7 @@ static struct irq_chip gic_chip = { void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq) { - if (gic_nr >= MAX_GIC_NR) - BUG(); + BUG_ON(gic_nr >= MAX_GIC_NR); if (irq_set_handler_data(irq, &gic_data[gic_nr]) != 0) BUG(); irq_set_chained_handler(irq, gic_handle_cascade_irq); @@ -444,8 +443,7 @@ static void gic_dist_save(unsigned int gic_nr) void __iomem *dist_base; int i; - if (gic_nr >= MAX_GIC_NR) - BUG(); + BUG_ON(gic_nr >= MAX_GIC_NR); gic_irqs = gic_data[gic_nr].gic_irqs; dist_base = gic_data_dist_base(&gic_data[gic_nr]); @@ -479,8 +477,7 @@ static void gic_dist_restore(unsigned int gic_nr) unsigned int i; void __iomem *dist_base; - if (gic_nr >= MAX_GIC_NR) - BUG(); + BUG_ON(gic_nr >= MAX_GIC_NR); gic_irqs = gic_data[gic_nr].gic_irqs; dist_base = gic_data_dist_base(&gic_data[gic_nr]); @@ -516,8 +513,7 @@ static void gic_cpu_save(unsigned int gic_nr) void __iomem *dist_base; void __iomem *cpu_base; - if (gic_nr >= MAX_GIC_NR) - BUG(); + BUG_ON(gic_nr >= MAX_GIC_NR); dist_base = gic_data_dist_base(&gic_data[gic_nr]); cpu_base = gic_data_cpu_base(&gic_data[gic_nr]); @@ -542,8 +538,7 @@ static void gic_cpu_restore(unsigned int gic_nr) void __iomem *dist_base; void __iomem *cpu_base; - if (gic_nr >= MAX_GIC_NR) - BUG(); + BUG_ON(gic_nr >= MAX_GIC_NR); dist_base = gic_data_dist_base(&gic_data[gic_nr]); cpu_base = gic_data_cpu_base(&gic_data[gic_nr]); @@ -699,8 +694,7 @@ void gic_migrate_target(unsigned int new_cpu_id) int i, ror_val, cpu = smp_processor_id(); u32 val, cur_target_mask, active_mask; - if (gic_nr >= MAX_GIC_NR) - BUG(); + BUG_ON(gic_nr >= MAX_GIC_NR); dist_base = gic_data_dist_base(&gic_data[gic_nr]); if (!dist_base) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/