From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757808Ab3BXMj5 (ORCPT ); Sun, 24 Feb 2013 07:39:57 -0500 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:49164 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755670Ab3BXMj4 (ORCPT ); Sun, 24 Feb 2013 07:39:56 -0500 Date: Sun, 24 Feb 2013 12:38:49 +0000 From: Russell King - ARM Linux To: Julia Lawall Cc: ben-linux@fluff.org, kgene.kim@samsung.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: question about arch/arm/mach-s3c24xx/irq.c Message-ID: <20130224123849.GH17833@n2100.arm.linux.org.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 24, 2013 at 12:45:11PM +0100, Julia Lawall wrote: > The function s3c24xx_irq_map in arch/arm/mach-s3c24xx/irq.c contains the > code: > > parent_irq_data = &parent_intc->irqs[irq_data->parent_irq]; > if (!irq_data) { > pr_err("irq-s3c24xx: no irq data found for hwirq %lu\n", > hw); > goto err; > } > > At this point irq_data has already been tested, so the null test on > irq_data does not look correct. But I wonder if parent_irq_data could > ever be null here? That would be really obscure - because that would require parent_intc to be a "negative" pointer (to counter-act the indexing by irq_data->parent_irq). So it looks to me like the above is redundant.