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: 10608 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 619B423E57 for ; Wed, 8 Aug 2012 21:28:23 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 30BA7A184CA for ; Wed, 8 Aug 2012 21:28:23 +0000 (UTC) Received: by mail-yw0-f52.google.com with SMTP id p61so1326862yhp.11 for ; Wed, 08 Aug 2012 14:28:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-provags-id:x-gm-message-state; bh=IG7atDxTH4QBpSGFpLiugS73MFmdgngnDMwPj+xsxVc=; b=kL7bsAVcu7r4zi+dVzORFJ6alzFV9GByv7EFj1OwxeiU5LIQ1qdTZROiZ26KJ98N7s CIhUP3Efyc/haqHX4oaQ0i5v03YVB+0kfbm99XEcVVy+VHbykRJP3CfNQNHENEd6QBiT dlvewrkvzzVUslppSp7Zm7VpQUwOG9sS+HjKmprs0G/6Vo2P2HAyllZEedpjujmdSyDw E+Jk13gtZr/GzyZsTuUsDB7IpTsjN/6kiwC7ZX9pyXamPyhwRqd1FqdZUnB7I2wu19wN +zkgKkVH8QTDXmRbXJTF7aEKlJezsDF6n5+6vQ8YM61jJO7gTfPITuMimEEijwbgJu57 w2mA== Received: by 10.50.186.131 with SMTP id fk3mr321996igc.31.1344461302653; Wed, 08 Aug 2012 14:28:22 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.200 with SMTP id ew8csp628855igc; Wed, 8 Aug 2012 14:28:21 -0700 (PDT) Received: by 10.180.100.131 with SMTP id ey3mr917141wib.15.1344461301240; Wed, 08 Aug 2012 14:28:21 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.126.187]) by mx.google.com with ESMTP id l1si31509570wek.25.2012.08.08.14.28.20; Wed, 08 Aug 2012 14:28:21 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.126.187 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.126.187; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.126.187 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mail=arnd@arndb.de 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 Cc: arm@kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Kevin Hilman , Sekhar Nori , Andrey Porodko 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-Gm-Message-State: ALoCoQlthHP0dbC8G0zzUyl4Dl8K4Ui+AYKbDMBJ6VkF7l8sHtpJbA6Biw05BgKfdfv3Vs5imqMA 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,