Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933608AbbFVNFT (ORCPT ); Mon, 22 Jun 2015 09:05:19 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:59153 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751446AbbFVNFO (ORCPT ); Mon, 22 Jun 2015 09:05:14 -0400 X-AuditID: cbfee68d-f79106d00000728c-3e-558808089f10 Date: Mon, 22 Jun 2015 13:05:12 +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: 20150622123826559@maninder1.s Msgkey: 20150622123826559@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: 20150622123826559@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: <1229205128.61041434978310948.JavaMail.weblogic@ep2mlwas07a> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOIsWRmVeSWpSXmKPExsWyRsSkTpeDoyPUYPNlHovLu+awOTB6fN4k F8AYxWWTkpqTWZZapG+XwJXx+dZx1oJXfBUHGxazNDBu4eti5OQQElCTWLT3MRuILSFgInFw y21GCFtM4sK99UBxLqCapYwSN57OZIYp2n/pORNEYg6jxK+lr9lBEiwCqhJzd14EK2IT0Jc4 u3cdmC0s4CCx5vcKFhBbREBL4sXKeywgzcwgU79/e88GcYaixPobT8BW8woISpyc+YQFYpuK xKVvm5kh4qoSu5fehorLSSyZepkJwuaVmNH+FC4+7esaqEulJc7P2gD3zuLvj6Hi/BLHbu+A 6hWQmHrmIFSN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Lj6h30Co+wsJKlZSNpnIWlH VrOAkWUVo2hqQXJBcVJ6haFecWJucWleul5yfu4mRnAqerZwB+OX89aHGAU4GJV4eCtYOkKF WBPLiitzDzFKcDArifC2nG0PFeJNSaysSi3Kjy8qzUktPsRoCoy2icxSosn5wDSZVxJvaGxi bmpsamFgaG5upiTO+/9cboiQQHpiSWp2ampBahFMHxMHp1QDY2THCh+z/fm3dL95cdi/+LNd kc3j/7QlntcXu9wT+1j818DRYp57uO0SuwNc638xxpeJrXl+5Eb1ol7/u9vSHBbaHOAqyrwz JZit9Dfr3CwpzsXfspo9+fYKnr56/NCaNW7ixxOF1DeWtXNdF591mDGgoe3u+oCj+yJvOE05 f2Pl0hUbd2SYn1diKc5INNRiLipOBACC6cgkWwMAAA== 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 t5MD5OlN004757 Content-Length: 1422 Lines: 42 Hi Thomas, Thanks For your suggestions. > >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. > >Right, and that's what I'm asking for. IOW, instead of blindly running >scripts at least ask the question whether this stuff needs to be there >unconditionally.... And I checked for these if()/BUG, I think we don't even need these if()/BUG constructs in codes. For below 4 functions. 1. gic_dist_save 2. gic_dist_restore 3. gic_cpu_save 4. gic_cpu_restore As we are checking in loop for (i = 0; i < MAX_GIC_NR; i++) and passing i as gic_nr. So below condition never returns true for any case, i think if (gic_nr >= MAX_GIC_NR). So we can remove if/BUG constructs from these functions ?? 5. gic_migrate_target And also in gic_migrate_target , we initializing gic_nr = 0; and then checking whether gic_nr >= MAX_GIC_NR. 6. gic_cascade_irq Before calling this function we have checked the same condition in gic_init_bases So we can also remove if()/BUG from these functions also ? Thanks , Maninder ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????s?y??杶????i??????????i