jedec_flash: Fix compilation warning in jedec_flash.c
PATCH 1/1 jedec_flash: Fix compilation warning in jedec_flash.c
--- drivers/mtd/jedec_flash.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
drivers/mtd/jedec_flash.c +6 -6
@@ -172,7 +172,7 @@ struct amd_flash_info {static const struct amd_flash_info jedec_table[] = { #ifdef CONFIG_SYS_FLASH_LEGACY_256Kx8 { - .mfr_id =MANUFACTURER_SST , + .mfr_id = (u16 )MANUFACTURER_SST , .dev_id =SST39LF020 , .name ="SST 39LF020" , .uaddr = {
@@ -188,7 +188,7 @@ static const struct amd_flash_info jedec_table[] = {#endif #ifdef CONFIG_SYS_FLASH_LEGACY_512Kx8 { - .mfr_id = MANUFACTURER_AMD, + .mfr_id = (u16)MANUFACTURER_AMD, .dev_id = AM29LV040B, .name = "AMD AM29LV040B", .uaddr = {
@@ -202,7 +202,7 @@ static const struct amd_flash_info jedec_table[] = { } }, { - .mfr_id = MANUFACTURER_SST, + .mfr_id = (u16)MANUFACTURER_SST, .dev_id = SST39LF040, .name = "SST 39LF040", .uaddr = {
@@ -216,7 +216,7 @@ static const struct amd_flash_info jedec_table[] = { } }, { - .mfr_id = STM_MANUFACT, + .mfr_id = (u16)STM_MANUFACT, .dev_id = STM_ID_M29W040B, .name = "ST Micro M29W040B", .uaddr = {
@@ -232,7 +232,7 @@ static const struct amd_flash_info jedec_table[] = {#endif #ifdef CONFIG_SYS_FLASH_LEGACY_512Kx16 { - .mfr_id = MANUFACTURER_AMD, + .mfr_id = (u16)MANUFACTURER_AMD, .dev_id = AM29LV400BB, .name = "AMD AM29LV400BB", .uaddr = {
@@ -249,7 +249,7 @@ static const struct amd_flash_info jedec_table[] = { } }, { - .mfr_id = MANUFACTURER_AMD, + .mfr_id = (u16)MANUFACTURER_AMD, .dev_id = AM29LV800BB, .name = "AMD AM29LV800BB", .uaddr = {
Signature · 1 line
1.6.1
PATCH 1/1 jedec_flash: Fix compilation warning in jedec_flash.c
Dear Stefan Roese,
Quoted 10 lines · In message <[email protected]> you wrote:
Signed-off-by Stefan Roese <[email protected]>--- drivers/mtd/jedec_flash.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)drivers/mtd/jedec_flash.c +0
-0
drivers/mtd/jedec_flash.c struct amd_flash_info { · line 175
Quoted 5 lines
drivers/mtd/jedec_flash.c +1
-1@@ -172,7 +172,7 @@ struct amd_flash_info {static const struct amd_flash_info jedec_table[] = { #ifdef CONFIG_SYS_FLASH_LEGACY_256Kx8 { - .mfr_id =MANUFACTURER_SST , + .mfr_id = (u16 )MANUFACTURER_SST ,
Which toolchain is throwing which exact warnings here? For which board?
I don't think this should be needed. MANUFACTURER_SST is defined as 0x00BF - this hsould give no conflicts here.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Never underestimate the power of human stupidity when it comes to using technology they don't understand.
PATCH 1/1 jedec_flash: Fix compilation warning in jedec_flash.c
Hi Wolfgang,
Quoted 14 lines · Wolfgang Denk
drivers/mtd/jedec_flash.c struct amd_flash_info { · line 175
Quoted 10 lines
drivers/mtd/jedec_flash.c +1
-1@@ -172,7 +172,7 @@ struct amd_flash_info {static const struct amd_flash_info jedec_table[] = { #ifdef CONFIG_SYS_FLASH_LEGACY_256Kx8 { - .mfr_id =MANUFACTURER_SST , + .mfr_id = (u16 )MANUFACTURER_SST ,Which toolchain is throwing which exact warnings here? For which board?
Quoted 2 lines
I don't think this should be needed.
MANUFACTURER_SSTis defined as0x00BF- this hsould give no conflicts here.
Your correct this line doesn't give a waring. The toolchain is ELDK 4.2. But the warning is "only" in line 219:
[stefan at kubuntu u-boot (master)]$ ./MAKEALL hcu4
Configuring for hcu4 board...
jedec_flash.c:219: warning: large integer implicitly truncated to unsigned type
Some of the manufacturer defines are defined (again) 16bit wide in jedec_flash.c, and one (STM_MANUFACT) is defined 32bit wide in include/flash.h (0x00200020).
Perhaps its better to remove those double manufacturer defines from jedec_flash.c? Just let me know if you would prefer such a version and I will generate a patch for it.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================