Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752818AbbFHNQa (ORCPT ); Mon, 8 Jun 2015 09:16:30 -0400 Received: from dub004-omc2s1.hotmail.com ([157.55.1.140]:58222 "EHLO DUB004-OMC2S1.hotmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752630AbbFHNQU convert rfc822-to-8bit (ORCPT ); Mon, 8 Jun 2015 09:16:20 -0400 X-TMN: [ALoQLRxLYa0HeFwGzJ/e1kJXOeKhyCal] X-Originating-Email: [dcb314@hotmail.com] Message-ID: From: David Binderman To: Thomas Gleixner CC: "jason@lakedaemon.net" , "linux-kernel@vger.kernel.org" Subject: RE: linux-4.1-rc7/drivers/irqchip/irq-renesas-intc-irqpin.c:418: array index used before limits check ? Date: Mon, 8 Jun 2015 13:16:19 +0000 Importance: Normal In-Reply-To: References: , Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT MIME-Version: 1.0 X-OriginalArrivalTime: 08 Jun 2015 13:16:19.0713 (UTC) FILETIME=[4EEB9F10:01D0A1ED] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 834 Lines: 30 Hello there Thomas, ---------------------------------------- >> [linux-4.1-rc7/drivers/irqchip/irq-renesas-intc-irqpin.c:418]: (style) Array ind >> ex 'k' is used before limits check. >> >> if (!io[k] && k < INTC_IRQPIN_REG_NR_MANDATORY) { >> >> Suggest sanity check array index before use. > > Which version of gcc is being stupid here? None of them. The original "(style)" message is from a static analysis tool called cppcheck. I can't think of a situation where, if an array index needs checking, then it should be checked *after* use. Regards David Binderman -- 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/