From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 06/10] ARM: davinci: don't use broken ntosd2_init_i2c
Date: Thu, 9 Aug 2012 08:00:17 +0000 [thread overview]
Message-ID: <201208090800.18321.arnd@arndb.de> (raw)
In-Reply-To: <1344461278-28245-7-git-send-email-arnd@arndb.de>
On second thought, there is probably no use in keeping the broken function
around, and we can just kill it off. If someone wants to add an i2c
device to the bus, they can always add the init code back as well.
8<-----
Subject: ARM: davinci: don't use broken ntosd2_init_i2c
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.
Since this can not possibly work, it's better to disable i2c
support entirely on this board.
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 <arnd@arndb.de>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Andrey Porodko <panda@chelcom.ru>
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c
index 5de69f2..f6b9fc7 100644
--- a/arch/arm/mach-davinci/board-neuros-osd2.c
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ -162,38 +162,6 @@ static void __init davinci_ntosd2_map_io(void)
dm644x_init();
}
-/*
- I2C initialization
-*/
-static struct davinci_i2c_platform_data ntosd2_i2c_pdata = {
- .bus_freq = 20 /* kHz */,
- .bus_delay = 100 /* usec */,
-};
-
-static struct i2c_board_info __initdata ntosd2_i2c_info[] = {
-};
-
-static int ntosd2_init_i2c(void)
-{
- int status;
-
- davinci_init_i2c(&ntosd2_i2c_pdata);
- status = gpio_request(NTOSD2_MSP430_IRQ, ntosd2_i2c_info[0].type);
- if (status == 0) {
- status = gpio_direction_input(NTOSD2_MSP430_IRQ);
- if (status == 0) {
- status = gpio_to_irq(NTOSD2_MSP430_IRQ);
- if (status > 0) {
- ntosd2_i2c_info[0].irq = status;
- i2c_register_board_info(1,
- ntosd2_i2c_info,
- ARRAY_SIZE(ntosd2_i2c_info));
- }
- }
- }
- return status;
-}
-
static struct davinci_mmc_config davinci_ntosd2_mmc_config = {
.wires = 4,
.version = MMC_CTLR_VERSION_1
@@ -218,7 +186,6 @@ static __init void davinci_ntosd2_init(void)
{
struct clk *aemif_clk;
struct davinci_soc_info *soc_info = &davinci_soc_info;
- int status;
aemif_clk = clk_get(NULL, "aemif");
clk_enable(aemif_clk);
@@ -242,12 +209,6 @@ static __init void davinci_ntosd2_init(void)
platform_add_devices(davinci_ntosd2_devices,
ARRAY_SIZE(davinci_ntosd2_devices));
- /* Initialize I2C interface specific for this board */
- status = ntosd2_init_i2c();
- if (status < 0)
- pr_warning("davinci_ntosd2_init: msp430 irq setup failed:"
- " %d\n", status);
-
davinci_serial_init(&uart_config);
dm644x_init_asp(&dm644x_ntosd2_snd_data);
WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: arm@kernel.org, linux-kernel@vger.kernel.org,
Kevin Hilman <khilman@ti.com>, Sekhar Nori <nsekhar@ti.com>,
Andrey Porodko <panda@chelcom.ru>
Subject: Re: [PATCH v2 06/10] ARM: davinci: don't use broken ntosd2_init_i2c
Date: Thu, 9 Aug 2012 08:00:17 +0000 [thread overview]
Message-ID: <201208090800.18321.arnd@arndb.de> (raw)
In-Reply-To: <1344461278-28245-7-git-send-email-arnd@arndb.de>
On second thought, there is probably no use in keeping the broken function
around, and we can just kill it off. If someone wants to add an i2c
device to the bus, they can always add the init code back as well.
8<-----
Subject: ARM: davinci: don't use broken ntosd2_init_i2c
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.
Since this can not possibly work, it's better to disable i2c
support entirely on this board.
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 <arnd@arndb.de>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Andrey Porodko <panda@chelcom.ru>
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c
index 5de69f2..f6b9fc7 100644
--- a/arch/arm/mach-davinci/board-neuros-osd2.c
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ -162,38 +162,6 @@ static void __init davinci_ntosd2_map_io(void)
dm644x_init();
}
-/*
- I2C initialization
-*/
-static struct davinci_i2c_platform_data ntosd2_i2c_pdata = {
- .bus_freq = 20 /* kHz */,
- .bus_delay = 100 /* usec */,
-};
-
-static struct i2c_board_info __initdata ntosd2_i2c_info[] = {
-};
-
-static int ntosd2_init_i2c(void)
-{
- int status;
-
- davinci_init_i2c(&ntosd2_i2c_pdata);
- status = gpio_request(NTOSD2_MSP430_IRQ, ntosd2_i2c_info[0].type);
- if (status == 0) {
- status = gpio_direction_input(NTOSD2_MSP430_IRQ);
- if (status == 0) {
- status = gpio_to_irq(NTOSD2_MSP430_IRQ);
- if (status > 0) {
- ntosd2_i2c_info[0].irq = status;
- i2c_register_board_info(1,
- ntosd2_i2c_info,
- ARRAY_SIZE(ntosd2_i2c_info));
- }
- }
- }
- return status;
-}
-
static struct davinci_mmc_config davinci_ntosd2_mmc_config = {
.wires = 4,
.version = MMC_CTLR_VERSION_1
@@ -218,7 +186,6 @@ static __init void davinci_ntosd2_init(void)
{
struct clk *aemif_clk;
struct davinci_soc_info *soc_info = &davinci_soc_info;
- int status;
aemif_clk = clk_get(NULL, "aemif");
clk_enable(aemif_clk);
@@ -242,12 +209,6 @@ static __init void davinci_ntosd2_init(void)
platform_add_devices(davinci_ntosd2_devices,
ARRAY_SIZE(davinci_ntosd2_devices));
- /* Initialize I2C interface specific for this board */
- status = ntosd2_init_i2c();
- if (status < 0)
- pr_warning("davinci_ntosd2_init: msp430 irq setup failed:"
- " %d\n", status);
-
davinci_serial_init(&uart_config);
dm644x_init_asp(&dm644x_ntosd2_snd_data);
next prev parent reply other threads:[~2012-08-09 8:00 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-08 21:27 [PATCH 00/10] ARM: interesting warnings from defconfig builds Arnd Bergmann
2012-08-08 21:27 ` Arnd Bergmann
2012-08-08 21:27 ` [PATCH 01/10] ARM: footbridge: nw_gpio_lock is raw_spin_lock Arnd Bergmann
2012-08-08 21:27 ` Arnd Bergmann
2012-08-08 21:27 ` [PATCH 02/10] ARM: ks8695: __arch_virt_to_dma type handling Arnd Bergmann
2012-08-08 21:27 ` Arnd Bergmann
2012-08-08 21:27 ` [PATCH 03/10] ARM: mv78xx0: fix win_cfg_base prototype Arnd Bergmann
2012-08-08 21:27 ` Arnd Bergmann
2012-08-13 14:59 ` Andrew Lunn
2012-08-13 14:59 ` Andrew Lunn
2012-08-08 21:27 ` [PATCH 04/10] ARM: pass -marm to gcc by default Arnd Bergmann
2012-08-08 21:27 ` Arnd Bergmann
2012-08-09 21:12 ` Nicolas Pitre
2012-08-09 21:12 ` Nicolas Pitre
2012-08-09 21:17 ` Russell King - ARM Linux
2012-08-09 21:17 ` Russell King - ARM Linux
2012-08-09 21:22 ` Nicolas Pitre
2012-08-09 21:22 ` Nicolas Pitre
2012-08-10 9:59 ` Dave Martin
2012-08-10 9:59 ` Dave Martin
2012-08-10 11:12 ` Arnd Bergmann
2012-08-10 11:12 ` Arnd Bergmann
2012-08-08 21:27 ` [PATCH 05/10] asm-generic: xor: mark static functions as __maybe_unused Arnd Bergmann
2012-08-08 21:27 ` Arnd Bergmann
2012-08-08 21:27 ` [PATCH 06/10] ARM: davinci: don't use broken ntosd2_init_i2c Arnd Bergmann
2012-08-08 21:27 ` Arnd Bergmann
2012-08-09 8:00 ` Arnd Bergmann [this message]
2012-08-09 8:00 ` [PATCH v2 " Arnd Bergmann
2012-08-09 18:23 ` Sekhar Nori
2012-08-09 18:23 ` Sekhar Nori
2012-08-08 21:27 ` [PATCH 07/10] ARM: rpc: check device_register return code in ecard_probe Arnd Bergmann
2012-08-08 21:27 ` Arnd Bergmann
2012-08-08 21:27 ` [PATCH 08/10] ARM: s3c24xx: enable CONFIG_BUG for tct_hammer Arnd Bergmann
2012-08-08 21:27 ` Arnd Bergmann
2012-08-10 6:07 ` Kukjin Kim
2012-08-10 6:07 ` Kukjin Kim
2012-08-08 21:27 ` [PATCH 09/10] ARM: rpc: Fix building RiscPC Arnd Bergmann
2012-08-08 21:27 ` Arnd Bergmann
2012-08-09 7:47 ` Russell King - ARM Linux
2012-08-09 7:47 ` Russell King - ARM Linux
2012-08-10 11:03 ` Arnd Bergmann
2012-08-10 11:03 ` Arnd Bergmann
2012-08-13 10:52 ` Russell King - ARM Linux
2012-08-13 10:52 ` Russell King - ARM Linux
2012-08-08 21:27 ` [PATCH 10/10] leds: renesas: fix error handling Arnd Bergmann
2012-08-08 21:27 ` Arnd Bergmann
2012-08-09 6:15 ` Bryan Wu
2012-08-09 6:15 ` Bryan Wu
2012-08-09 7:34 ` Arnd Bergmann
2012-08-09 7:34 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201208090800.18321.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.