From patchwork Wed Aug 8 21:27:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 1297871 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id C0BD53FD8D for ; Wed, 8 Aug 2012 21:32:23 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SzDoV-0000FP-5z; Wed, 08 Aug 2012 21:29:11 +0000 Received: from moutng.kundenserver.de ([212.227.126.187]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SzDne-00005t-O8 for linux-arm-kernel@lists.infradead.org; Wed, 08 Aug 2012 21:28:20 +0000 Received: from localhost.localdomain (HSI-KBW-149-172-5-253.hsi13.kabel-badenwuerttemberg.de [149.172.5.253]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MNh30-1T5FPU3YNO-007S7j; Wed, 08 Aug 2012 23:28:11 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 06/10] ARM: davinci: don't use broken ntosd2_init_i2c Date: Wed, 8 Aug 2012 23:27:54 +0200 Message-Id: <1344461278-28245-7-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1344461278-28245-1-git-send-email-arnd@arndb.de> References: <1344461278-28245-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:DHPFueg9/b7qP9mdSCUBD6q5epGLauS8DIZySwx+Dqs pUgFVHv9W14euzKZhHCF7M+bNpKnrrgWPODEjJVgDu4vmS7zH5 wH+r1AKWDF8ad2kMb+2s8G4/b7wjQ4ANr7zlYIIbRqwn5yybLS u9hlHLmVvqy1LYdkBO4sGSxdDsQyhPtFDoTdd/LBk4Fkecvv+P ji8DU7wL06IE3zk9xb7cifpV7/8MYjLn1i4glFnNhJgtZI17ww nTY73BgEJzKTP/CiZs8TAWInKFTJvj8eWxN5MBYJkft5IPasDG +KsLY9U69rq3ReUllWSjAyl1eu4lpTOjFklLbAp4Mota9O7fnz lVMikcJujuaNAhYoED6JfQ56p2xSHOZQb5GRlzbsAjs20YICdV AOtLwhyVs4cYA== X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.187 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Kevin Hilman , Arnd Bergmann , Sekhar Nori , linux-kernel@vger.kernel.org, Andrey Porodko , arm@kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org ntosd2_init_i2c walks the ntosd2_i2c_info array, which it expects to be populated with at least one member. gcc correctly warns about the out-of-bounds access here. Without this patch, building davinci_all_defconfig results in: arch/arm/mach-davinci/board-neuros-osd2.c: In function 'davinci_ntosd2_init': arch/arm/mach-davinci/board-neuros-osd2.c:187:20: warning: array subscript is above array bounds [-Warray-bounds] Signed-off-by: Arnd Bergmann Cc: Kevin Hilman Cc: Sekhar Nori Cc: Andrey Porodko --- arch/arm/mach-davinci/board-neuros-osd2.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c index 5de69f2..9d40df9 100644 --- a/arch/arm/mach-davinci/board-neuros-osd2.c +++ b/arch/arm/mach-davinci/board-neuros-osd2.c @@ -162,6 +162,7 @@ static void __init davinci_ntosd2_map_io(void) dm644x_init(); } +#if 0 /* I2C initialization */ @@ -193,6 +194,12 @@ static int ntosd2_init_i2c(void) } return status; } +#else +static int ntosd2_init_i2c(void) +{ + return 0; +} +#endif static struct davinci_mmc_config davinci_ntosd2_mmc_config = { .wires = 4,