i2c_no_probes: Fix initialization warnings
PATCH 1/1 i2c_no_probes: Fix initialization warnings
This patch fixes the initialization warnings similar to
the one below:
cmd_i2c.o cmd_i2c.c -c
cmd_i2c.c:109:1: warning: missing braces around initializer cmd_i2c.c:109:1: warning: (near initialization for 'i2c_no_probes[0]')
---
The problem was originally found when compiling omap3_beagle[1]. All the changes were done with this bash script:
[script_here]
list=search.lst
[ -f ${list} ] && \rm -rf ${list}
grep CONFIG_SYS_I2C_NOPROBES ./include/configs/* | grep -v "{{" | cut -d":" -f1 > ${list}
for f in `cat ${list}` ;
do
echo "Fixing $f..."
sed -r -i 's/(CONFIG_SYS_I2C_NOPROBES\s*)\{{1}(.*)\}{1}/\1{{\2}}/g' "$f"
done
[/script_here] Compile tested for oma3_beagle only.
[1] http://marc.info/?l=u-boot&m=131522330112799&w=2
include/configs/KAREF.h | 2 +- include/configs/METROBOX.h | 2 +- include/configs/MPC8315ERDB.h | 2 +- include/configs/MPC8323ERDB.h | 2 +- include/configs/MPC832XEMDS.h | 2 +- include/configs/MPC8360EMDS.h | 2 +- include/configs/MPC837XEMDS.h | 2 +- include/configs/MPC837XERDB.h | 2 +- include/configs/MPC8540ADS.h | 2 +- include/configs/MPC8541CDS.h | 2 +- include/configs/MPC8544DS.h | 2 +- include/configs/MPC8548CDS.h | 2 +- include/configs/MPC8555CDS.h | 2 +- include/configs/MPC8560ADS.h | 2 +- include/configs/MPC8610HPCD.h | 2 +- include/configs/MPC8641HPCN.h | 2 +- include/configs/SBC8540.h | 2 +- include/configs/TQM85xx.h | 2 +- include/configs/alpr.h | 2 +- include/configs/bubinga.h | 2 +- include/configs/omap3_beagle.h | 2 +- include/configs/p3p440.h | 2 +- include/configs/redwood.h | 2 +- include/configs/sbc8349.h | 2 +- include/configs/sbc8560.h | 2 +- include/configs/sbc8641d.h | 2 +- include/configs/stxgp3.h | 2 +- include/configs/taihu.h | 2 +- include/configs/yucca.h | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-)
include/configs/KAREF.h +1 -1
@@ -139,7 +139,7 @@#define CONFIG_PPC4XX_I2C /* use PPC4xx driver */ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed 400kHz */ #define CONFIG_SYS_I2C_SLAVE 0x7F/* I2C slave address */ -#define CONFIG_SYS_I2C_NOPROBES {0x69}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x69}}/* Don't probe these addrs */ #define CONFIG_I2C_BUS1 1/* Include i2c bus 1 supp */
include/configs/METROBOX.h +1 -1
@@ -201,7 +201,7 @@#define CONFIG_PPC4XX_I2C /* use PPC4xx driver */ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed 400kHz */ #define CONFIG_SYS_I2C_SLAVE 0x7F/* I2C slave address */ -#define CONFIG_SYS_I2C_NOPROBES {0x69}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x69}}/* Don't probe these addrs */ #define CONFIG_I2C_BUS1 1/* Include i2c bus 1 supp */
include/configs/MPC8315ERDB.h +1 -1
@@ -346,7 +346,7 @@#define CONFIG_FSL_I2C #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x51}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x51}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3000#define CONFIG_SYS_I2C2_OFFSET 0x3100
include/configs/MPC8323ERDB.h +1 -1
@@ -291,7 +291,7 @@#define CONFIG_FSL_I2C #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x51}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x51}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3000/*
include/configs/MPC832XEMDS.h +1 -1
@@ -302,7 +302,7 @@#define CONFIG_FSL_I2C #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x51}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x51}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3000/*
include/configs/MPC8360EMDS.h +1 -1
@@ -339,7 +339,7 @@#define CONFIG_FSL_I2C #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x52}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x52}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3000#define CONFIG_SYS_I2C2_OFFSET 0x3100
include/configs/MPC837XEMDS.h +1 -1
@@ -328,7 +328,7 @@#define CONFIG_FSL_I2C #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x51}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x51}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3000#define CONFIG_SYS_I2C2_OFFSET 0x3100
include/configs/MPC837XERDB.h +1 -1
@@ -350,7 +350,7 @@#define CONFIG_FSL_I2C #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x51}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x51}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3000#define CONFIG_SYS_I2C2_OFFSET 0x3100
include/configs/MPC8540ADS.h +1 -1
@@ -272,7 +272,7 @@#undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x69}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x69}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3000/* RapidIO MMU */
include/configs/MPC8541CDS.h +1 -1
@@ -294,7 +294,7 @@ extern unsigned long get_clock_freq(void);#undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x69}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x69}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3000/* EEPROM */
include/configs/MPC8544DS.h +1 -1
@@ -246,7 +246,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);#define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_EEPROM_ADDR 0x57#define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x69}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x69}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3100/*
include/configs/MPC8548CDS.h +1 -1
@@ -316,7 +316,7 @@ extern unsigned long get_clock_freq(void);#undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x69}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x69}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3000/* EEPROM */
include/configs/MPC8555CDS.h +1 -1
@@ -292,7 +292,7 @@ extern unsigned long get_clock_freq(void);#undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x69}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x69}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3000/* EEPROM */
include/configs/MPC8560ADS.h +1 -1
@@ -266,7 +266,7 @@#undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x69}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x69}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3000/* RapidIO MMU */
include/configs/MPC8610HPCD.h +1 -1
@@ -259,7 +259,7 @@#undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x69}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x69}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3000/*
include/configs/MPC8641HPCN.h +1 -1
@@ -307,7 +307,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);#undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x69}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x69}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3100/*
include/configs/SBC8540.h +1 -1
@@ -243,7 +243,7 @@#undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x69}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x69}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3000#define CONFIG_SYS_PCI_MEM_BASE 0xC0000000
include/configs/TQM85xx.h +1 -1
@@ -323,7 +323,7 @@#undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x48}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x48}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3000/* I2C RTC */
include/configs/alpr.h +1 -1
@@ -126,7 +126,7 @@#define CONFIG_PPC4XX_I2C /* use PPC4xx driver */ #define CONFIG_SYS_I2C_SPEED 100000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x69}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x69}}/* Don't probe these addrs */ /*----------------------------------------------------------------------- * I2C EEPROM (PCF8594C)
include/configs/bubinga.h +1 -1
@@ -136,7 +136,7 @@*/ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ -#define CONFIG_SYS_I2C_NOPROBES { 0x69 }/* avoid i2c probe hangup (why?) */ +#define CONFIG_SYS_I2C_NOPROBES {{ 0x69 }}/* avoid i2c probe hangup (why?) */ #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 6/* 24C02 requires 5ms delay */ #if defined(CONFIG_CMD_EEPROM )
include/configs/omap3_beagle.h +1 -1
@@ -118,7 +118,7 @@#define CONFIG_I2C_MULTI_BUS 1/* Probe all devices */ -#define CONFIG_SYS_I2C_NOPROBES {0x0, 0x0} +#define CONFIG_SYS_I2C_NOPROBES {{0x0, 0x0}}/* USB */ #define CONFIG_MUSB_UDC 1
include/configs/p3p440.h +1 -1
@@ -102,7 +102,7 @@#define CONFIG_PPC4XX_I2C /* use PPC4xx driver */ #define CONFIG_SYS_I2C_SPEED 100000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x69}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x69}}/* Don't probe these addrs */ /*----------------------------------------------------------------------- * I2C RTC
include/configs/redwood.h +1 -1
@@ -116,7 +116,7 @@#define IIC0_ALT_BOOTPROM_ADDR 0x54/* Don't probe these addrs */ -#define CONFIG_SYS_I2C_NOPROBES {0x50, 0x52, 0x53, 0x54} +#define CONFIG_SYS_I2C_NOPROBES {{0x50, 0x52, 0x53, 0x54}}#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2/* Bytes of address */
include/configs/sbc8349.h +1 -1
@@ -286,7 +286,7 @@#define CONFIG_FSL_I2C #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x69}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x69}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C1_OFFSET 0x3000#define CONFIG_SYS_I2C2_OFFSET 0x3100#define CONFIG_SYS_I2C_OFFSET CONFIG_SYS_I2C2_OFFSET
include/configs/sbc8560.h +1 -1
@@ -235,7 +235,7 @@#undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x69}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x69}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3000#define CONFIG_SYS_PCI_MEM_BASE 0xC0000000
include/configs/sbc8641d.h +1 -1
@@ -294,7 +294,7 @@#undef CONFIG_SOFT_I2C/* I2C bit-banged */ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F -#define CONFIG_SYS_I2C_NOPROBES {0x69}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x69}}/* Don't probe these addrs */ #define CONFIG_SYS_I2C_OFFSET 0x3100/*
include/configs/stxgp3.h +1 -1
@@ -188,7 +188,7 @@#define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ #define CONFIG_SYS_I2C_SLAVE 0x7F#if 0 -#define CONFIG_SYS_I2C_NOPROBES {0x00}/* Don't probe these addrs */ +#define CONFIG_SYS_I2C_NOPROBES {{0x00}}/* Don't probe these addrs */ #else /* I did the 'if 0' so we could keep the syntax above if ever needed. */ #undef CONFIG_SYS_I2C_NOPROBES
include/configs/taihu.h +1 -1
@@ -140,7 +140,7 @@*/ #define CONFIG_SYS_I2C_SPEED 400000/* I2C speed and slave address */ -#define CONFIG_SYS_I2C_NOPROBES { 0x69 }/* avoid i2c probe hangup (why?) */ +#define CONFIG_SYS_I2C_NOPROBES {{ 0x69 }}/* avoid i2c probe hangup (why?) */ #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 6/* 24C02 requires 5ms delay */ #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50/* I2C boot EEPROM (24C02W) */
include/configs/yucca.h +1 -1
@@ -126,7 +126,7 @@#define IIC0_ALT_BOOTPROM_ADDR 0x54/* Don't probe these addrs */ -#define CONFIG_SYS_I2C_NOPROBES {0x50, 0x52, 0x53, 0x54} +#define CONFIG_SYS_I2C_NOPROBES {{0x50, 0x52, 0x53, 0x54}}/* #if defined(CONFIG_CMD_EEPROM) */ /* #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 */ /* I2C boot EEPROM */
Signature · 1 line
1.7.0.4
PATCH 1/1 i2c_no_probes: Fix initialization warnings
Hello Sanjeev,
Quoted 26 lines · Sanjeev Premi
This patch fixes the initialization warnings similar to
the one below:
cmd_i2c.ocmd_i2c.c-c
cmd_i2c.c:109:1: warning: missing braces around initializer cmd_i2c.c:109:1: warning: (near initialization for 'i2c_no_probes[0]')Signed-off-by Sanjeev Premi <[email protected]>Cc Albert ARIBAUD <[email protected]>---
The problem was originally found when compiling omap3_beagle[1]. All the changes were done with this bash script:
[script_here] list=search.lst [ -f ${list} ] && \rm -rf ${list} grep CONFIG_SYS_I2C_NOPROBES ./include/configs/* | grep -v "{{" | cut -d":" -f1 > ${list} for f in `cat ${list}` ; do echo "Fixing $f..." sed -r -i 's/(CONFIG_SYS_I2C_NOPROBES\s*)\{{1}(.*)\}{1}/\1{{\2}}/g' "$f" done [/script_here]
Quoted 1 line
Compile tested for
oma3_beagleonly.
Compiling for example for the alpr board with your patch:
[hs at pollux u-boot]$ ./MAKEALL alpr
Configuring for alpr board...
cmd_i2c.c:115: warning: braces around scalar initializer cmd_i2c.c:115: warning: (near initialization for 'i2c_no_probes[0]') fpga.c:226: warning: initialization from incompatible pointer type
text data bss dec hex filename
231746 18612 68328 318686 4dcde ./u-boot
--------------------- SUMMARY ---------------------------- Boards compiled: 1
Boards with warnings or errors: 1 ( alpr )
----------------------------------------------------------
[hs at pollux u-boot]$
-> so Sorry, NACK for this patch.
bye,
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Premi
PATCH 1/1 i2c_no_probes: Fix initialization warnings
Quoted 9 lines
-----Original Message-----
From: Heiko Schocher [mailto:hs at denx.de]
Sent: Monday, September 05, 2011 7:13 PM
To: Premi, Sanjeev
Cc: u-boot at lists.denx.de; Albert ARIBAUD
Subject: Re: [U-Boot] [PATCH]i2c_no_probes: Fix
initialization warningsHello Sanjeev,
[snip]...[snip]
Quoted 12 lines
Quoted 1 line
Compile tested for
oma3_beagleonly.Compiling for example for the alpr board with your patch:
[hs at pollux u-boot]$ ./MAKEALL alpr
Configuring for alpr board...
cmd_i2c.c:115: warning: braces around scalar initializer cmd_i2c.c:115: warning: (near initialization for 'i2c_no_probes[0]') fpga.c:226: warning: initialization from incompatible pointer type
text data bss dec hex filename
231746 18612 68328 318686 4dcde ./u-boot
Quoted 7 lines
--------------------- SUMMARY ---------------------------- Boards compiled: 1
Boards with warnings or errors: 1 ( alpr )
----------------------------------------------------------
[hs at pollux u-boot]$-> so Sorry, NACK for this patch.
[sp] Didn't look at this reponse while I was responding to your
earlier mail.
One difference, I see notice between the warnings I got while building for beagle and the one you see:
(beagle)
cmd_i2c.c:109:1: warning: missing braces around initializer
(alpr)
cmd_i2c.c:115: warning: braces around scalar initializer
The difference seems to be length of the array.
(beagle)
#define CONFIG_SYS_I2C_NOPROBES {{0x0, 0x0}}
(alpr)
#define CONFIG_SYS_I2C_NOPROBES {{0x69}}
So, temporarily, I changed the definition for beagle as #define CONFIG_SYS_I2C_NOPROBES {{0x0}}
...but it succeeded.
I am using "Codesourcery 2011.03-41". I will try using an older toolchain as well. Only trying to find of the original patch itself was right OR not.
~sanjeev
Quoted 7 lines
bye,
HeikoSignature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany