Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754523AbbFSJvr (ORCPT ); Fri, 19 Jun 2015 05:51:47 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:57800 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753522AbbFSJvj (ORCPT ); Fri, 19 Jun 2015 05:51:39 -0400 X-AuditID: cbfee691-f79ca6d00000456a-ed-5583e629ce61 Date: Fri, 19 Jun 2015 09:51:36 +0000 (GMT) From: Maninder Singh Subject: Re: [PATCH 1/1] irq-gic: use BUG_ON instead of if()/BUG To: Thomas Gleixner Cc: Jason Cooper , LKML , PANKAJ MISHRA , Marc Zyngier Reply-to: maninder1.s@samsung.com MIME-version: 1.0 X-MTR: 20150619094029531@maninder1.s Msgkey: 20150619094029531@maninder1.s X-EPLocale: en_US.windows-1252 X-Priority: 3 X-EPWebmail-Msg-Type: personal X-EPWebmail-Reply-Demand: 0 X-EPApproval-Locale: X-EPHeader: ML X-MLAttribute: X-RootMTR: 20150619094029531@maninder1.s X-ParentMTR: X-ArchiveUser: X-CPGSPASS: N X-ConfirmMail: N,general Content-type: text/plain; charset=windows-1252 MIME-version: 1.0 Message-id: <814009118.53061434707495088.JavaMail.weblogic@ep2mlwas07a> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOIsWRmVeSWpSXmKPExsWyRsSkTlfzWXOowfONNhaXd81hc2D0+LxJ LoAxissmJTUnsyy1SN8ugStj5uzTbAWXeCs2rFrK3sC4gLeLkZNDSEBNYtHex2wgtoSAicSe a1dZIGwxiQv31gPFuYBqljJKvPt2hRGmaPb+J8wQiTmMEuuf3GEFSbAIqEo0zfkHZrMJ6Euc 3buOGcQWFnCQWPN7BdhUEQEtiRcr77GANDODTP3+7T0bxBmKEutvPAHbwCsgKHFy5hOoM1Qk bnW+Y4GIq0p0bv7CBBGXk1gy9TKUzSsxo/0pC0x82tc1zBC2tMT5WRsYYd5Z/P0xVJxf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yaA4rul94BdwlXm1+zj6BUXYWktQsJO2zkLQj q1nAyLKKUTS1ILmgOCm9wlivODG3uDQvXS85P3cTIzgVPVu8g/H/eetDjAIcjEo8vBO2NIcK sSaWFVfmHmKU4GBWEuFl3AkU4k1JrKxKLcqPLyrNSS0+xGgKjLaJzFKiyfnANJlXEm9obGJu amxqYWBobm6mJM77/1xuiJBAemJJanZqakFqEUwfEwenVAOjguW+y/kTfQSte59bcB7QmH7d fuG7uS3rNwScvKltsu6Y1P1j6Z4bVcPt/z2bb5pa+OyC6RW51QsFLyplc/qtEnyWZcR4OfJo V8aTK6tUN/zc8XOF1Bapro93/1zjavf6qvl36bz3Gaubn9UlTZZ9HsJ844NtTP3iptt6ynaf 6y5svOL9Q2YihxJLcUaioRZzUXEiAD5Uc/BbAwAA DLP-Filter: Pass X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id t5J9ppmr024618 Content-Length: 1396 Lines: 37 Hi Thomas, >> { >> - 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(); > >So this patch was clearly done just by running a script and not sanity >checked afterwards. Otherwise the next if() BUG(); construct would >have been fixed as well. Yes semantic patch did the changes to use preferred APIs, And it also changed this BUG_ON(irq_set_handler_data(irq, &gic_data[gic_nr]) != 0) But we have to take care that condition has no side effects i.e. if()/BUG conversion to BUG_ON must be avoided when there's side effect in condition. The reason being BUG_ON won't execute the condition when CONFIG_BUG is not defined As suggested by Julia Lawall Thats why did not take that change --> (BUG_ON(irq_set_handler_data(irq, &gic_data[gic_nr]) != 0)) >Further, while we are at that. It would be even more useful to analyze >whether the BUG_ON() is needed in the first place or at least could be >made conditional on some debug option. > >But that's not done by the script either, right? Yes coccinelle semantic patches did not do that changes. we have to choose whether to make BUG_ON conditional on some debug options. Thanks, Maninder ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?