* [PATCH] Drop superfluous setting of i2c_board_info.type
@ 2012-05-24 14:38 Paul Bolle
2012-05-24 14:59 ` Paul Mundt
2012-05-24 16:22 ` Uwe Kleine-König
0 siblings, 2 replies; 5+ messages in thread
From: Paul Bolle @ 2012-05-24 14:38 UTC (permalink / raw)
To: linux-arm-kernel
Three instances of struct i2c_board_info have their "type" member set to
"tsc2007" twice. First through the I2C_BOARD_INFO macro and then
directly. Drop the superfluous second setting.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
0) Entirely untested. I'm unsure what toolchain(s) is (are) needed to
compile this and I am certain that I don't have the hardware.
1) This is apparently legal. Doesn't gcc issue a warning for this?
arch/arm/mach-imx/mach-cpuimx35.c | 1 -
arch/arm/mach-imx/mach-cpuimx51sd.c | 1 -
arch/arm/mach-shmobile/board-ap4evb.c | 1 -
3 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c
index 8ecc872..b1a4796 100644
--- a/arch/arm/mach-imx/mach-cpuimx35.c
+++ b/arch/arm/mach-imx/mach-cpuimx35.c
@@ -70,7 +70,6 @@ static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = {
I2C_BOARD_INFO("pcf8563", 0x51),
}, {
I2C_BOARD_INFO("tsc2007", 0x48),
- .type = "tsc2007",
.platform_data = &tsc2007_info,
.irq = IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO),
},
diff --git a/arch/arm/mach-imx/mach-cpuimx51sd.c b/arch/arm/mach-imx/mach-cpuimx51sd.c
index 9fbe923..89eb93c 100644
--- a/arch/arm/mach-imx/mach-cpuimx51sd.c
+++ b/arch/arm/mach-imx/mach-cpuimx51sd.c
@@ -124,7 +124,6 @@ static struct i2c_board_info eukrea_cpuimx51sd_i2c_devices[] = {
I2C_BOARD_INFO("pcf8563", 0x51),
}, {
I2C_BOARD_INFO("tsc2007", 0x49),
- .type = "tsc2007",
.platform_data = &tsc2007_info,
.irq = IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO),
},
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index b56dde2..801de4b 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -1168,7 +1168,6 @@ static struct tsc2007_platform_data tsc2007_info = {
static struct i2c_board_info tsc_device = {
I2C_BOARD_INFO("tsc2007", 0x48),
- .type = "tsc2007",
.platform_data = &tsc2007_info,
/*.irq is selected on ap4evb_init */
};
--
1.7.7.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] Drop superfluous setting of i2c_board_info.type
2012-05-24 14:38 [PATCH] Drop superfluous setting of i2c_board_info.type Paul Bolle
@ 2012-05-24 14:59 ` Paul Mundt
2012-05-24 16:22 ` Uwe Kleine-König
1 sibling, 0 replies; 5+ messages in thread
From: Paul Mundt @ 2012-05-24 14:59 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, May 24, 2012 at 04:38:23PM +0200, Paul Bolle wrote:
> Three instances of struct i2c_board_info have their "type" member set to
> "tsc2007" twice. First through the I2C_BOARD_INFO macro and then
> directly. Drop the superfluous second setting.
>
> Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
> ---
> 0) Entirely untested. I'm unsure what toolchain(s) is (are) needed to
> compile this and I am certain that I don't have the hardware.
>
> 1) This is apparently legal. Doesn't gcc issue a warning for this?
>
That's a new one to me. Seems legal enough. Using this feature you can
use macro initializion for the bulk of structure elements and then just
overload the ones you disagree with to save time, neat yet revolting at
the same time, there was definitely a committee involved in this.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] Drop superfluous setting of i2c_board_info.type
2012-05-24 14:38 [PATCH] Drop superfluous setting of i2c_board_info.type Paul Bolle
2012-05-24 14:59 ` Paul Mundt
@ 2012-05-24 16:22 ` Uwe Kleine-König
2012-05-24 16:40 ` Paul Bolle
1 sibling, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2012-05-24 16:22 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, May 24, 2012 at 04:38:23PM +0200, Paul Bolle wrote:
> Three instances of struct i2c_board_info have their "type" member set to
> "tsc2007" twice. First through the I2C_BOARD_INFO macro and then
> directly. Drop the superfluous second setting.
>
> Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
> ---
> 0) Entirely untested. I'm unsure what toolchain(s) is (are) needed to
> compile this and I am certain that I don't have the hardware.
>
> 1) This is apparently legal. Doesn't gcc issue a warning for this?
I wondered about that too, gcc doesn't even warn when the two values are
different. See for example commit
bd9e310dca15c9987256f67af19f9f42426e7493.
>
> arch/arm/mach-imx/mach-cpuimx35.c | 1 -
> arch/arm/mach-imx/mach-cpuimx51sd.c | 1 -
I already submitted a patch for the imx bits with Message id
1335989287-10094-1-git-send-email-u.kleine-koenig at pengutronix.de.
(e.g.
http://mid.gmane.org/1335989287-10094-1-git-send-email-u.kleine-koenig at pengutronix.de)
Don't know if Sascha took it already. If he did, he didn't tell me.
Best regards
Uwe
> arch/arm/mach-shmobile/board-ap4evb.c | 1 -
> 3 files changed, 0 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c
> index 8ecc872..b1a4796 100644
> --- a/arch/arm/mach-imx/mach-cpuimx35.c
> +++ b/arch/arm/mach-imx/mach-cpuimx35.c
> @@ -70,7 +70,6 @@ static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = {
> I2C_BOARD_INFO("pcf8563", 0x51),
> }, {
> I2C_BOARD_INFO("tsc2007", 0x48),
> - .type = "tsc2007",
> .platform_data = &tsc2007_info,
> .irq = IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO),
> },
> diff --git a/arch/arm/mach-imx/mach-cpuimx51sd.c b/arch/arm/mach-imx/mach-cpuimx51sd.c
> index 9fbe923..89eb93c 100644
> --- a/arch/arm/mach-imx/mach-cpuimx51sd.c
> +++ b/arch/arm/mach-imx/mach-cpuimx51sd.c
> @@ -124,7 +124,6 @@ static struct i2c_board_info eukrea_cpuimx51sd_i2c_devices[] = {
> I2C_BOARD_INFO("pcf8563", 0x51),
> }, {
> I2C_BOARD_INFO("tsc2007", 0x49),
> - .type = "tsc2007",
> .platform_data = &tsc2007_info,
> .irq = IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO),
> },
> diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
> index b56dde2..801de4b 100644
> --- a/arch/arm/mach-shmobile/board-ap4evb.c
> +++ b/arch/arm/mach-shmobile/board-ap4evb.c
> @@ -1168,7 +1168,6 @@ static struct tsc2007_platform_data tsc2007_info = {
>
> static struct i2c_board_info tsc_device = {
> I2C_BOARD_INFO("tsc2007", 0x48),
> - .type = "tsc2007",
> .platform_data = &tsc2007_info,
> /*.irq is selected on ap4evb_init */
> };
> --
> 1.7.7.6
>
>
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] Drop superfluous setting of i2c_board_info.type
2012-05-24 16:22 ` Uwe Kleine-König
@ 2012-05-24 16:40 ` Paul Bolle
2012-05-29 17:22 ` Sascha Hauer
0 siblings, 1 reply; 5+ messages in thread
From: Paul Bolle @ 2012-05-24 16:40 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, 2012-05-24 at 18:22 +0200, Uwe Kleine-K?nig wrote:
> On Thu, May 24, 2012 at 04:38:23PM +0200, Paul Bolle wrote:
> > 1) This is apparently legal. Doesn't gcc issue a warning for this?
> I wondered about that too, gcc doesn't even warn when the two values are
> different. See for example commit
> bd9e310dca15c9987256f67af19f9f42426e7493.
In that case it were two strings ("rtc-pcf8563" versus "pcf8563"). Why
should gcc care? Or is there something going on behind the scenes which
somehow depends on the contents of the string?
> > arch/arm/mach-imx/mach-cpuimx35.c | 1 -
> > arch/arm/mach-imx/mach-cpuimx51sd.c | 1 -
> I already submitted a patch for the imx bits with Message id
> 1335989287-10094-1-git-send-email-u.kleine-koenig at pengutronix.de.
> (e.g.
> http://mid.gmane.org/1335989287-10094-1-git-send-email-u.kleine-koenig at pengutronix.de)
Thanks. I missed that one, obviously. Should I just drop that part of
the patch and resend?
By the way, together with my previous patch (Message-ID
1337869829.22505.15.camel at x61.thuisdomein , probably not yet archived on
the web) we have found all instances of this issue, haven't we?
> Don't know if Sascha took it already. If he did, he didn't tell me.
Paul Bolle
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] Drop superfluous setting of i2c_board_info.type
2012-05-24 16:40 ` Paul Bolle
@ 2012-05-29 17:22 ` Sascha Hauer
0 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2012-05-29 17:22 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, May 24, 2012 at 06:40:26PM +0200, Paul Bolle wrote:
> On Thu, 2012-05-24 at 18:22 +0200, Uwe Kleine-K?nig wrote:
> > On Thu, May 24, 2012 at 04:38:23PM +0200, Paul Bolle wrote:
> > > 1) This is apparently legal. Doesn't gcc issue a warning for this?
> > I wondered about that too, gcc doesn't even warn when the two values are
> > different. See for example commit
> > bd9e310dca15c9987256f67af19f9f42426e7493.
>
> In that case it were two strings ("rtc-pcf8563" versus "pcf8563"). Why
> should gcc care? Or is there something going on behind the scenes which
> somehow depends on the contents of the string?
>
> > > arch/arm/mach-imx/mach-cpuimx35.c | 1 -
> > > arch/arm/mach-imx/mach-cpuimx51sd.c | 1 -
> > I already submitted a patch for the imx bits with Message id
> > 1335989287-10094-1-git-send-email-u.kleine-koenig at pengutronix.de.
> > (e.g.
> > http://mid.gmane.org/1335989287-10094-1-git-send-email-u.kleine-koenig at pengutronix.de)
>
> Thanks. I missed that one, obviously. Should I just drop that part of
> the patch and resend?
I just merged Uwes patch, this leaves the sh-mobile hunk still to be
fixed.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-05-29 17:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-24 14:38 [PATCH] Drop superfluous setting of i2c_board_info.type Paul Bolle
2012-05-24 14:59 ` Paul Mundt
2012-05-24 16:22 ` Uwe Kleine-König
2012-05-24 16:40 ` Paul Bolle
2012-05-29 17:22 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).