[U-Boot] [PATCH 1/9] common/menu.c: Fix build warning

Fix: menu.c: In function 'menu_item_print': menu.c:91: warning: passing argument 1 of 'putc' makes integer from pointer without a cast
Signed-off-by: Anatolij Gustschin agust@denx.de --- common/menu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/common/menu.c b/common/menu.c index ca1baef..5e0817c 100644 --- a/common/menu.c +++ b/common/menu.c @@ -88,7 +88,7 @@ static inline void *menu_item_print(struct menu *m, void *extra) { if (!m->item_data_print) { - putc(item->key); + puts(item->key); putc('\n'); } else { m->item_data_print(item->data);

Fix warnings for both cases:
definded CONFIG_SYS_NAND_HW_ECC_OOBFIRST: nand_spl_simple.c: In function 'nand_read_page': nand_spl_simple.c:156:6: warning: variable 'stat' set but not used [-Wunused-but-set-variable]
not definded CONFIG_SYS_NAND_HW_ECC_OOBFIRST: nand_spl_simple.c: In function 'nand_read_page': nand_spl_simple.c:196:6: warning: variable 'stat' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Heiko Schocher hs@denx.de Cc: Scott Wood scottwood@freescale.com --- drivers/mtd/nand/nand_spl_simple.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nand/nand_spl_simple.c b/drivers/mtd/nand/nand_spl_simple.c index ed821f2..7eb08a3 100644 --- a/drivers/mtd/nand/nand_spl_simple.c +++ b/drivers/mtd/nand/nand_spl_simple.c @@ -153,7 +153,6 @@ static int nand_read_page(int block, int page, uchar *dst) int eccbytes = CONFIG_SYS_NAND_ECCBYTES; int eccsteps = CONFIG_SYS_NAND_ECCSTEPS; uint8_t *p = dst; - int stat;
/* * No malloc available for now, just use some temporary locations @@ -176,7 +175,7 @@ static int nand_read_page(int block, int page, uchar *dst) this->ecc.hwctl(&mtd, NAND_ECC_READ); this->read_buf(&mtd, p, eccsize); this->ecc.calculate(&mtd, p, &ecc_calc[i]); - stat = this->ecc.correct(&mtd, p, &ecc_code[i], &ecc_calc[i]); + this->ecc.correct(&mtd, p, &ecc_code[i], &ecc_calc[i]); }
return 0; @@ -193,7 +192,6 @@ static int nand_read_page(int block, int page, void *dst) int eccbytes = CONFIG_SYS_NAND_ECCBYTES; int eccsteps = CONFIG_SYS_NAND_ECCSTEPS; uint8_t *p = dst; - int stat;
nand_command(block, page, 0, NAND_CMD_READ0);
@@ -224,7 +222,7 @@ static int nand_read_page(int block, int page, void *dst) * from correct_data(). We just hope that all possible errors * are corrected by this routine. */ - stat = this->ecc.correct(&mtd, p, &ecc_code[i], &ecc_calc[i]); + this->ecc.correct(&mtd, p, &ecc_code[i], &ecc_calc[i]); }
return 0;

Hello Anatolij,
Anatolij Gustschin wrote:
Fix warnings for both cases:
definded CONFIG_SYS_NAND_HW_ECC_OOBFIRST: nand_spl_simple.c: In function 'nand_read_page': nand_spl_simple.c:156:6: warning: variable 'stat' set but not used [-Wunused-but-set-variable]
not definded CONFIG_SYS_NAND_HW_ECC_OOBFIRST: nand_spl_simple.c: In function 'nand_read_page': nand_spl_simple.c:196:6: warning: variable 'stat' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Heiko Schocher hs@denx.de Cc: Scott Wood scottwood@freescale.com
drivers/mtd/nand/nand_spl_simple.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
Thanks!
Acked-by: Heiko Schocher hs@denx.de
bye, Heiko

Fix warnings for both cases:
definded CONFIG_SYS_NAND_HW_ECC_OOBFIRST: nand_spl_simple.c: In function 'nand_read_page': nand_spl_simple.c:156:6: warning: variable 'stat' set but not used [-Wunused-but-set-variable]
not definded CONFIG_SYS_NAND_HW_ECC_OOBFIRST: nand_spl_simple.c: In function 'nand_read_page': nand_spl_simple.c:196:6: warning: variable 'stat' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Heiko Schocher hs@denx.de Cc: Scott Wood scottwood@freescale.com
drivers/mtd/nand/nand_spl_simple.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nand/nand_spl_simple.c b/drivers/mtd/nand/nand_spl_simple.c index ed821f2..7eb08a3 100644 --- a/drivers/mtd/nand/nand_spl_simple.c +++ b/drivers/mtd/nand/nand_spl_simple.c @@ -153,7 +153,6 @@ static int nand_read_page(int block, int page, uchar *dst) int eccbytes = CONFIG_SYS_NAND_ECCBYTES; int eccsteps = CONFIG_SYS_NAND_ECCSTEPS; uint8_t *p = dst;
int stat;
/*
- No malloc available for now, just use some temporary locations
@@ -176,7 +175,7 @@ static int nand_read_page(int block, int page, uchar *dst) this->ecc.hwctl(&mtd, NAND_ECC_READ); this->read_buf(&mtd, p, eccsize); this->ecc.calculate(&mtd, p, &ecc_calc[i]);
stat = this->ecc.correct(&mtd, p, &ecc_code[i], &ecc_calc[i]);
this->ecc.correct(&mtd, p, &ecc_code[i], &ecc_calc[i]);
}
return 0;
@@ -193,7 +192,6 @@ static int nand_read_page(int block, int page, void *dst) int eccbytes = CONFIG_SYS_NAND_ECCBYTES; int eccsteps = CONFIG_SYS_NAND_ECCSTEPS; uint8_t *p = dst;
int stat;
nand_command(block, page, 0, NAND_CMD_READ0);
@@ -224,7 +222,7 @@ static int nand_read_page(int block, int page, void *dst) * from correct_data(). We just hope that all possible errors * are corrected by this routine. */
stat = this->ecc.correct(&mtd, p, &ecc_code[i], &ecc_calc[i]);
this->ecc.correct(&mtd, p, &ecc_code[i], &ecc_calc[i]);
}
return 0;
Acked-by: Marek Vasut marek.vasut@gmail.com

On 12/03/2011 10:46 AM, Anatolij Gustschin wrote:
Fix warnings for both cases:
definded CONFIG_SYS_NAND_HW_ECC_OOBFIRST: nand_spl_simple.c: In function 'nand_read_page': nand_spl_simple.c:156:6: warning: variable 'stat' set but not used [-Wunused-but-set-variable]
not definded CONFIG_SYS_NAND_HW_ECC_OOBFIRST: nand_spl_simple.c: In function 'nand_read_page': nand_spl_simple.c:196:6: warning: variable 'stat' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Heiko Schocher hs@denx.de Cc: Scott Wood scottwood@freescale.com
drivers/mtd/nand/nand_spl_simple.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
Applied to u-boot-nand-flash
-Scott

Fix: nand_spl_load.c: In function 'nand_boot': nand_spl_load.c:31:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Heiko Schocher hs@denx.de Cc: Scott Wood scottwood@freescale.com --- drivers/mtd/nand/nand_spl_load.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/mtd/nand/nand_spl_load.c b/drivers/mtd/nand/nand_spl_load.c index ae8d5ac..215459a 100644 --- a/drivers/mtd/nand/nand_spl_load.c +++ b/drivers/mtd/nand/nand_spl_load.c @@ -28,23 +28,22 @@ */ void nand_boot(void) { - int ret; __attribute__((noreturn)) void (*uboot)(void);
/* * Load U-Boot image from NAND into RAM */ - ret = nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS, + nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS, CONFIG_SYS_NAND_U_BOOT_SIZE, - (void *)CONFIG_SYS_NAND_U_BOOT_DST); + (void *)CONFIG_SYS_NAND_U_BOOT_DST);
#ifdef CONFIG_NAND_ENV_DST - ret = nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, - (void *)CONFIG_NAND_ENV_DST); + nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, + (void *)CONFIG_NAND_ENV_DST);
#ifdef CONFIG_ENV_OFFSET_REDUND - ret = nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, CONFIG_ENV_SIZE, - (void *)CONFIG_NAND_ENV_DST + CONFIG_ENV_SIZE); + nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, CONFIG_ENV_SIZE, + (void *)CONFIG_NAND_ENV_DST + CONFIG_ENV_SIZE); #endif #endif

Hello Anatolij,
Anatolij Gustschin wrote:
Fix: nand_spl_load.c: In function 'nand_boot': nand_spl_load.c:31:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Heiko Schocher hs@denx.de Cc: Scott Wood scottwood@freescale.com
drivers/mtd/nand/nand_spl_load.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-)
Thanks!
Acked-by: Heiko Schocher hs@denx.de
bye, Heiko

Fix: nand_spl_load.c: In function 'nand_boot': nand_spl_load.c:31:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Heiko Schocher hs@denx.de Cc: Scott Wood scottwood@freescale.com
drivers/mtd/nand/nand_spl_load.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/mtd/nand/nand_spl_load.c b/drivers/mtd/nand/nand_spl_load.c index ae8d5ac..215459a 100644 --- a/drivers/mtd/nand/nand_spl_load.c +++ b/drivers/mtd/nand/nand_spl_load.c @@ -28,23 +28,22 @@ */ void nand_boot(void) {
int ret; __attribute__((noreturn)) void (*uboot)(void);
/*
- Load U-Boot image from NAND into RAM
*/
ret = nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
- nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS, CONFIG_SYS_NAND_U_BOOT_SIZE,
(void *)CONFIG_SYS_NAND_U_BOOT_DST);
(void *)CONFIG_SYS_NAND_U_BOOT_DST);
#ifdef CONFIG_NAND_ENV_DST
- ret = nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
(void *)CONFIG_NAND_ENV_DST);
- nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
(void *)CONFIG_NAND_ENV_DST);
#ifdef CONFIG_ENV_OFFSET_REDUND
- ret = nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, CONFIG_ENV_SIZE,
(void *)CONFIG_NAND_ENV_DST + CONFIG_ENV_SIZE);
- nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, CONFIG_ENV_SIZE,
(void *)CONFIG_NAND_ENV_DST + CONFIG_ENV_SIZE);
#endif #endif
Acked-by: Marek Vasut marek.vasut@gmail.com

On 12/03/2011 10:46 AM, Anatolij Gustschin wrote:
Fix: nand_spl_load.c: In function 'nand_boot': nand_spl_load.c:31:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Heiko Schocher hs@denx.de Cc: Scott Wood scottwood@freescale.com
drivers/mtd/nand/nand_spl_load.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-)
Applied to u-boot-nand-flash
-Scott

Fix: musb_udc.c: In function 'musb_peri_softconnect': musb_udc.c:166:14: warning: variable 'intrtx' set but not used [-Wunused-but-set-variable] musb_udc.c:166:6: warning: variable 'intrrx' set but not used [-Wunused-but-set-variable] musb_udc.c:165:5: warning: variable 'intrusb' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Remy Bohmer linux@bohmer.net --- drivers/usb/musb/musb_udc.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c index 6f6ed61..09cdec3 100644 --- a/drivers/usb/musb/musb_udc.c +++ b/drivers/usb/musb/musb_udc.c @@ -162,8 +162,6 @@ static void musb_db_regs(void) static void musb_peri_softconnect(void) { u8 power, devctl; - u8 intrusb; - u16 intrrx, intrtx;
/* Power off MUSB */ power = readb(&musbr->power); @@ -171,9 +169,9 @@ static void musb_peri_softconnect(void) writeb(power, &musbr->power);
/* Read intr to clear */ - intrusb = readb(&musbr->intrusb); - intrrx = readw(&musbr->intrrx); - intrtx = readw(&musbr->intrtx); + readb(&musbr->intrusb); + readw(&musbr->intrrx); + readw(&musbr->intrtx);
udelay(1000 * 1000); /* 1 sec */

Hi,
2011/12/3 Anatolij Gustschin agust@denx.de:
Fix: musb_udc.c: In function 'musb_peri_softconnect': musb_udc.c:166:14: warning: variable 'intrtx' set but not used [-Wunused-but-set-variable] musb_udc.c:166:6: warning: variable 'intrrx' set but not used [-Wunused-but-set-variable] musb_udc.c:165:5: warning: variable 'intrusb' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Remy Bohmer linux@bohmer.net
drivers/usb/musb/musb_udc.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c index 6f6ed61..09cdec3 100644 --- a/drivers/usb/musb/musb_udc.c +++ b/drivers/usb/musb/musb_udc.c @@ -162,8 +162,6 @@ static void musb_db_regs(void) static void musb_peri_softconnect(void) { u8 power, devctl;
- u8 intrusb;
- u16 intrrx, intrtx;
/* Power off MUSB */ power = readb(&musbr->power); @@ -171,9 +169,9 @@ static void musb_peri_softconnect(void) writeb(power, &musbr->power);
/* Read intr to clear */
- intrusb = readb(&musbr->intrusb);
- intrrx = readw(&musbr->intrrx);
- intrtx = readw(&musbr->intrtx);
- readb(&musbr->intrusb);
- readw(&musbr->intrrx);
- readw(&musbr->intrtx);
udelay(1000 * 1000); /* 1 sec */
Since it is part of a series with non-USB related changes: Acked-by: Remy Bohmer linux@bohmer.net
Kind regards,
Remy

Fix: musb_udc.c: In function 'musb_peri_softconnect': musb_udc.c:166:14: warning: variable 'intrtx' set but not used [-Wunused-but-set-variable] musb_udc.c:166:6: warning: variable 'intrrx' set but not used [-Wunused-but-set-variable] musb_udc.c:165:5: warning: variable 'intrusb' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Remy Bohmer linux@bohmer.net
drivers/usb/musb/musb_udc.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c index 6f6ed61..09cdec3 100644 --- a/drivers/usb/musb/musb_udc.c +++ b/drivers/usb/musb/musb_udc.c @@ -162,8 +162,6 @@ static void musb_db_regs(void) static void musb_peri_softconnect(void) { u8 power, devctl;
u8 intrusb;
u16 intrrx, intrtx;
/* Power off MUSB */ power = readb(&musbr->power);
@@ -171,9 +169,9 @@ static void musb_peri_softconnect(void) writeb(power, &musbr->power);
/* Read intr to clear */
- intrusb = readb(&musbr->intrusb);
- intrrx = readw(&musbr->intrrx);
- intrtx = readw(&musbr->intrtx);
readb(&musbr->intrusb);
readw(&musbr->intrrx);
readw(&musbr->intrtx);
udelay(1000 * 1000); /* 1 sec */
Acked-by: Marek Vasut marek.vasut@gmail.com

Dear Anatolij Gustschin,
In message 1322930775-4767-4-git-send-email-agust@denx.de you wrote:
Fix: musb_udc.c: In function 'musb_peri_softconnect': musb_udc.c:166:14: warning: variable 'intrtx' set but not used [-Wunused-but-set-variable] musb_udc.c:166:6: warning: variable 'intrrx' set but not used [-Wunused-but-set-variable] musb_udc.c:165:5: warning: variable 'intrusb' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Remy Bohmer linux@bohmer.net
drivers/usb/musb/musb_udc.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Fix: core.c: In function 'usbd_device_event_irq': core.c:596:21: warning: variable 'state' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Remy Bohmer linux@bohmer.net --- drivers/usb/gadget/core.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/core.c b/drivers/usb/gadget/core.c index 67b6681..4f2ebab 100644 --- a/drivers/usb/gadget/core.c +++ b/drivers/usb/gadget/core.c @@ -671,9 +671,9 @@ void usbd_device_event_irq (struct usb_device_instance *device, usb_device_event usbdbg("event %d - not handled",event); break; } - /*usbdbg("%s event: %d oldstate: %d newstate: %d status: %d address: %d", + debug("%s event: %d oldstate: %d newstate: %d status: %d address: %d", device->name, event, state, - device->device_state, device->status, device->address); */ + device->device_state, device->status, device->address);
/* tell the bus interface driver */ if( device->event ) {

Hi,
2011/12/3 Anatolij Gustschin agust@denx.de:
Fix: core.c: In function 'usbd_device_event_irq': core.c:596:21: warning: variable 'state' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Remy Bohmer linux@bohmer.net
drivers/usb/gadget/core.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Since it is part of a series with non-USB related changes: Acked-by: Remy Bohmer linux@bohmer.net
Kind regards,
Remy

Fix: core.c: In function 'usbd_device_event_irq': core.c:596:21: warning: variable 'state' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Remy Bohmer linux@bohmer.net
drivers/usb/gadget/core.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/core.c b/drivers/usb/gadget/core.c index 67b6681..4f2ebab 100644 --- a/drivers/usb/gadget/core.c +++ b/drivers/usb/gadget/core.c @@ -671,9 +671,9 @@ void usbd_device_event_irq (struct usb_device_instance *device, usb_device_event usbdbg("event %d - not handled",event); break; }
- /*usbdbg("%s event: %d oldstate: %d newstate: %d status: %d address:
%d",
- debug("%s event: %d oldstate: %d newstate: %d status: %d address: %d", device->name, event, state,
device->device_state, device->status, device->address); */
device->device_state, device->status, device->address);
/* tell the bus interface driver */ if( device->event ) {
Acked-by: Marek Vasut marek.vasut@gmail.com

Dear Anatolij Gustschin,
In message 1322930775-4767-5-git-send-email-agust@denx.de you wrote:
Fix: core.c: In function 'usbd_device_event_irq': core.c:596:21: warning: variable 'state' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Remy Bohmer linux@bohmer.net
drivers/usb/gadget/core.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Fix: ep0.c: In function 'ep0_get_descriptor': ep0.c:187:8: warning: variable 'cp' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Remy Bohmer linux@bohmer.net --- drivers/usb/gadget/ep0.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/ep0.c b/drivers/usb/gadget/ep0.c index 2b4ec44..22499d3 100644 --- a/drivers/usb/gadget/ep0.c +++ b/drivers/usb/gadget/ep0.c @@ -184,7 +184,6 @@ static int ep0_get_descriptor (struct usb_device_instance *device, int index) { int port = 0; /* XXX compound device */ - char *cp;
/*dbg_ep0(3, "max: %x type: %x index: %x", max, descriptor_type, index); */
@@ -196,7 +195,6 @@ static int ep0_get_descriptor (struct usb_device_instance *device,
/* setup tx urb */ urb->actual_length = 0; - cp = (char*)urb->buffer;
dbg_ep0 (2, "%s", USBD_DEVICE_DESCRIPTORS (descriptor_type));

Hi,
2011/12/3 Anatolij Gustschin agust@denx.de:
Fix: ep0.c: In function 'ep0_get_descriptor': ep0.c:187:8: warning: variable 'cp' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Remy Bohmer linux@bohmer.net
drivers/usb/gadget/ep0.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/ep0.c b/drivers/usb/gadget/ep0.c index 2b4ec44..22499d3 100644 --- a/drivers/usb/gadget/ep0.c +++ b/drivers/usb/gadget/ep0.c @@ -184,7 +184,6 @@ static int ep0_get_descriptor (struct usb_device_instance *device, int index) { int port = 0; /* XXX compound device */
- char *cp;
/*dbg_ep0(3, "max: %x type: %x index: %x", max, descriptor_type, index); */
@@ -196,7 +195,6 @@ static int ep0_get_descriptor (struct usb_device_instance *device,
/* setup tx urb */ urb->actual_length = 0;
- cp = (char*)urb->buffer;
dbg_ep0 (2, "%s", USBD_DEVICE_DESCRIPTORS (descriptor_type));
Since it is part of a series with non-USB related changes: Acked-by: Remy Bohmer linux@bohmer.net
Kind regards,
Remy

Fix: ep0.c: In function 'ep0_get_descriptor': ep0.c:187:8: warning: variable 'cp' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Remy Bohmer linux@bohmer.net
drivers/usb/gadget/ep0.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/ep0.c b/drivers/usb/gadget/ep0.c index 2b4ec44..22499d3 100644 --- a/drivers/usb/gadget/ep0.c +++ b/drivers/usb/gadget/ep0.c @@ -184,7 +184,6 @@ static int ep0_get_descriptor (struct usb_device_instance *device, int index) { int port = 0; /* XXX compound device */
char *cp;
/*dbg_ep0(3, "max: %x type: %x index: %x", max, descriptor_type, index);
*/
@@ -196,7 +195,6 @@ static int ep0_get_descriptor (struct usb_device_instance *device,
/* setup tx urb */ urb->actual_length = 0;
cp = (char*)urb->buffer;
dbg_ep0 (2, "%s", USBD_DEVICE_DESCRIPTORS (descriptor_type));
Acked-by: Marek Vasut marek.vasut@gmail.com

Dear Anatolij Gustschin,
In message 1322930775-4767-6-git-send-email-agust@denx.de you wrote:
Fix: ep0.c: In function 'ep0_get_descriptor': ep0.c:187:8: warning: variable 'cp' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: Remy Bohmer linux@bohmer.net
drivers/usb/gadget/ep0.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Fix: spl.c: In function 'jump_to_image_no_args': spl.c:103: warning: assignment makes pointer from integer without a cast spl.c:105: warning: dereferencing type-punned pointer will break strict-aliasing rules
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: sricharan r.sricharan@ti.com Cc: Tom Rini trini@ti.com --- arch/arm/cpu/armv7/omap-common/spl.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c index 25f04ed..9c35a09 100644 --- a/arch/arm/cpu/armv7/omap-common/spl.c +++ b/arch/arm/cpu/armv7/omap-common/spl.c @@ -100,9 +100,10 @@ static void jump_to_image_no_args(void) debug("image entry point: 0x%X\n", spl_image.entry_point); /* Pass the saved boot_params from rom code */ #if defined(CONFIG_VIRTIO) || defined(CONFIG_ZEBU) - image_entry = 0x80100000; + image_entry = (image_entry_noargs_t)0x80100000; #endif - image_entry((u32 *)&boot_params_ptr); + u32 boot_params_ptr_addr = (u32)&boot_params_ptr; + image_entry((u32 *)boot_params_ptr_addr); }
void jump_to_image_no_args(void) __attribute__ ((noreturn));

Fix: spl.c: In function 'jump_to_image_no_args': spl.c:103: warning: assignment makes pointer from integer without a cast spl.c:105: warning: dereferencing type-punned pointer will break strict-aliasing rules
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: sricharan r.sricharan@ti.com Cc: Tom Rini trini@ti.com
arch/arm/cpu/armv7/omap-common/spl.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c index 25f04ed..9c35a09 100644 --- a/arch/arm/cpu/armv7/omap-common/spl.c +++ b/arch/arm/cpu/armv7/omap-common/spl.c @@ -100,9 +100,10 @@ static void jump_to_image_no_args(void) debug("image entry point: 0x%X\n", spl_image.entry_point); /* Pass the saved boot_params from rom code */ #if defined(CONFIG_VIRTIO) || defined(CONFIG_ZEBU)
- image_entry = 0x80100000;
- image_entry = (image_entry_noargs_t)0x80100000;
#endif
- image_entry((u32 *)&boot_params_ptr);
- u32 boot_params_ptr_addr = (u32)&boot_params_ptr;
- image_entry((u32 *)boot_params_ptr_addr);
}
void jump_to_image_no_args(void) __attribute__ ((noreturn));
Acked-by: Marek Vasut marek.vasut@gmail.com

On 12/04/2011 04:28 AM, Marek Vasut wrote:
Fix: spl.c: In function 'jump_to_image_no_args': spl.c:103: warning: assignment makes pointer from integer without a cast spl.c:105: warning: dereferencing type-punned pointer will break strict-aliasing rules
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: sricharan r.sricharan@ti.com Cc: Tom Rini trini@ti.com
arch/arm/cpu/armv7/omap-common/spl.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c index 25f04ed..9c35a09 100644 --- a/arch/arm/cpu/armv7/omap-common/spl.c +++ b/arch/arm/cpu/armv7/omap-common/spl.c @@ -100,9 +100,10 @@ static void jump_to_image_no_args(void) debug("image entry point: 0x%X\n", spl_image.entry_point); /* Pass the saved boot_params from rom code */ #if defined(CONFIG_VIRTIO) || defined(CONFIG_ZEBU)
- image_entry = 0x80100000;
- image_entry = (image_entry_noargs_t)0x80100000;
#endif
- image_entry((u32 *)&boot_params_ptr);
- u32 boot_params_ptr_addr = (u32)&boot_params_ptr;
- image_entry((u32 *)boot_params_ptr_addr);
}
void jump_to_image_no_args(void) __attribute__ ((noreturn));
Acked-by: Marek Vasut marek.vasut@gmail.com
Acked-by: Tom Rini trini@ti.com
And will be queued to u-boot-ti/master once the current pull request is dealt with.

Fix: clocks-common.c: In function 'setup_dplls': clocks-common.c:256:6: warning: variable 'sysclk_ind' set but not used [-Wunused-but-set-variable] clocks-common.c: In function 'setup_non_essential_dplls': clocks-common.c:292:6: warning: variable 'sysclk_ind' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: sricharan r.sricharan@ti.com Cc: Tom Rini trini@ti.com --- arch/arm/cpu/armv7/omap-common/clocks-common.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap-common/clocks-common.c b/arch/arm/cpu/armv7/omap-common/clocks-common.c index 1e7e20e..1da90a4 100644 --- a/arch/arm/cpu/armv7/omap-common/clocks-common.c +++ b/arch/arm/cpu/armv7/omap-common/clocks-common.c @@ -253,11 +253,10 @@ void configure_mpu_dpll(void)
static void setup_dplls(void) { - u32 sysclk_ind, temp; + u32 temp; const struct dpll_params *params; - debug("setup_dplls\n");
- sysclk_ind = get_sys_clk_index(); + debug("setup_dplls\n");
/* CORE dpll */ params = get_core_dpll_params(); /* default - safest */ @@ -289,10 +288,9 @@ static void setup_dplls(void) static void setup_non_essential_dplls(void) { u32 sys_clk_khz, abe_ref_clk; - u32 sysclk_ind, sd_div, num, den; + u32 sd_div, num, den; const struct dpll_params *params;
- sysclk_ind = get_sys_clk_index(); sys_clk_khz = get_sys_clk_freq() / 1000;
/* IVA */

Fix: clocks-common.c: In function 'setup_dplls': clocks-common.c:256:6: warning: variable 'sysclk_ind' set but not used [-Wunused-but-set-variable] clocks-common.c: In function 'setup_non_essential_dplls': clocks-common.c:292:6: warning: variable 'sysclk_ind' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: sricharan r.sricharan@ti.com Cc: Tom Rini trini@ti.com
arch/arm/cpu/armv7/omap-common/clocks-common.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap-common/clocks-common.c b/arch/arm/cpu/armv7/omap-common/clocks-common.c index 1e7e20e..1da90a4 100644 --- a/arch/arm/cpu/armv7/omap-common/clocks-common.c +++ b/arch/arm/cpu/armv7/omap-common/clocks-common.c @@ -253,11 +253,10 @@ void configure_mpu_dpll(void)
static void setup_dplls(void) {
- u32 sysclk_ind, temp;
- u32 temp; const struct dpll_params *params;
debug("setup_dplls\n");
sysclk_ind = get_sys_clk_index();
debug("setup_dplls\n");
/* CORE dpll */ params = get_core_dpll_params(); /* default - safest */
@@ -289,10 +288,9 @@ static void setup_dplls(void) static void setup_non_essential_dplls(void) { u32 sys_clk_khz, abe_ref_clk;
- u32 sysclk_ind, sd_div, num, den;
- u32 sd_div, num, den; const struct dpll_params *params;
sysclk_ind = get_sys_clk_index(); sys_clk_khz = get_sys_clk_freq() / 1000;
/* IVA */
Acked-by: Marek Vasut marek.vasut@gmail.com

On 12/03/2011 09:46 AM, Anatolij Gustschin wrote:
Fix: clocks-common.c: In function 'setup_dplls': clocks-common.c:256:6: warning: variable 'sysclk_ind' set but not used [-Wunused-but-set-variable] clocks-common.c: In function 'setup_non_essential_dplls': clocks-common.c:292:6: warning: variable 'sysclk_ind' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: sricharan r.sricharan@ti.com Cc: Tom Rini trini@ti.com
arch/arm/cpu/armv7/omap-common/clocks-common.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap-common/clocks-common.c b/arch/arm/cpu/armv7/omap-common/clocks-common.c index 1e7e20e..1da90a4 100644 --- a/arch/arm/cpu/armv7/omap-common/clocks-common.c +++ b/arch/arm/cpu/armv7/omap-common/clocks-common.c @@ -253,11 +253,10 @@ void configure_mpu_dpll(void)
static void setup_dplls(void) {
- u32 sysclk_ind, temp;
- u32 temp; const struct dpll_params *params;
debug("setup_dplls\n");
sysclk_ind = get_sys_clk_index();
debug("setup_dplls\n");
/* CORE dpll */ params = get_core_dpll_params(); /* default - safest */
Hand-editing the diffs? Not sure why the debug print looks like it moved. But regardless...
Acked-by: Tom Rini trini@ti.com
And will be queued to u-boot-ti/master once Albert pulls /comments on my current request.

On Mon, 5 Dec 2011 08:02:53 -0700 Tom Rini trini@ti.com wrote:
On 12/03/2011 09:46 AM, Anatolij Gustschin wrote:
Fix: clocks-common.c: In function 'setup_dplls': clocks-common.c:256:6: warning: variable 'sysclk_ind' set but not used [-Wunused-but-set-variable] clocks-common.c: In function 'setup_non_essential_dplls': clocks-common.c:292:6: warning: variable 'sysclk_ind' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: sricharan r.sricharan@ti.com Cc: Tom Rini trini@ti.com
arch/arm/cpu/armv7/omap-common/clocks-common.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap-common/clocks-common.c b/arch/arm/cpu/armv7/omap-common/clocks-common.c index 1e7e20e..1da90a4 100644 --- a/arch/arm/cpu/armv7/omap-common/clocks-common.c +++ b/arch/arm/cpu/armv7/omap-common/clocks-common.c @@ -253,11 +253,10 @@ void configure_mpu_dpll(void)
static void setup_dplls(void) {
- u32 sysclk_ind, temp;
- u32 temp; const struct dpll_params *params;
debug("setup_dplls\n");
sysclk_ind = get_sys_clk_index();
debug("setup_dplls\n");
/* CORE dpll */ params = get_core_dpll_params(); /* default - safest */
Hand-editing the diffs? Not sure why the debug print looks like it moved. But regardless...
No, not this time. I moved the debug print intentionally to fix the coding style, while at it. It doesn't make sense to send separate patch for this coding style fix. I should have mentioned this in the commit log, sorry.
Thanks for review!
Anatolij

On 12/05/2011 09:32 AM, Anatolij Gustschin wrote:
On Mon, 5 Dec 2011 08:02:53 -0700 Tom Rini trini@ti.com wrote:
On 12/03/2011 09:46 AM, Anatolij Gustschin wrote:
Fix: clocks-common.c: In function 'setup_dplls': clocks-common.c:256:6: warning: variable 'sysclk_ind' set but not used [-Wunused-but-set-variable] clocks-common.c: In function 'setup_non_essential_dplls': clocks-common.c:292:6: warning: variable 'sysclk_ind' set but not used [-Wunused-but-set-variable]
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: sricharan r.sricharan@ti.com Cc: Tom Rini trini@ti.com
arch/arm/cpu/armv7/omap-common/clocks-common.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/arm/cpu/armv7/omap-common/clocks-common.c b/arch/arm/cpu/armv7/omap-common/clocks-common.c index 1e7e20e..1da90a4 100644 --- a/arch/arm/cpu/armv7/omap-common/clocks-common.c +++ b/arch/arm/cpu/armv7/omap-common/clocks-common.c @@ -253,11 +253,10 @@ void configure_mpu_dpll(void)
static void setup_dplls(void) {
- u32 sysclk_ind, temp;
- u32 temp; const struct dpll_params *params;
debug("setup_dplls\n");
sysclk_ind = get_sys_clk_index();
debug("setup_dplls\n");
/* CORE dpll */ params = get_core_dpll_params(); /* default - safest */
Hand-editing the diffs? Not sure why the debug print looks like it moved. But regardless...
No, not this time. I moved the debug print intentionally to fix the coding style, while at it. It doesn't make sense to send separate patch for this coding style fix. I should have mentioned this in the commit log, sorry.
Ah, OK, now I see it, thanks (and will still merge as-is).

Fix: clocks.c: In function 'setup_post_dividers': clocks.c:175: warning: comparison is always true due to limited range of data type clocks.c:177: warning: comparison is always true due to limited range of data type clocks.c:179: warning: comparison is always true due to limited range of data type clocks.c:181: warning: comparison is always true due to limited range of data type clocks.c:183: warning: comparison is always true due to limited range of data type clocks.c:185: warning: comparison is always true due to limited range of data type clocks.c:187: warning: comparison is always true due to limited range of data type clocks.c:189: warning: comparison is always true due to limited range of data type
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: sricharan r.sricharan@ti.com Cc: Tom Rini trini@ti.com --- Some notes:
- GCC v4.5.1 didn't warn here - GCC v4.6.1 seems to have a bug and can't compile this code: clocks.c: In function 'enable_non_essential_clocks': clocks.c:349:13: internal compiler error: in decode_addr_const, at varasm.c:2632
arch/arm/include/asm/arch-omap5/clocks.h | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/arm/include/asm/arch-omap5/clocks.h b/arch/arm/include/asm/arch-omap5/clocks.h index fa99f65..d0e6dd6 100644 --- a/arch/arm/include/asm/arch-omap5/clocks.h +++ b/arch/arm/include/asm/arch-omap5/clocks.h @@ -686,14 +686,14 @@ struct dpll_regs { struct dpll_params { u32 m; u32 n; - u8 m2; - u8 m3; - u8 h11; - u8 h12; - u8 h13; - u8 h14; - u8 h22; - u8 h23; + s8 m2; + s8 m3; + s8 h11; + s8 h12; + s8 h13; + s8 h14; + s8 h22; + s8 h23; };
extern struct omap5_prcm_regs *const prcm;

Fix: clocks.c: In function 'setup_post_dividers': clocks.c:175: warning: comparison is always true due to limited range of data type clocks.c:177: warning: comparison is always true due to limited range of data type clocks.c:179: warning: comparison is always true due to limited range of data type clocks.c:181: warning: comparison is always true due to limited range of data type clocks.c:183: warning: comparison is always true due to limited range of data type clocks.c:185: warning: comparison is always true due to limited range of data type clocks.c:187: warning: comparison is always true due to limited range of data type clocks.c:189: warning: comparison is always true due to limited range of data type
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: sricharan r.sricharan@ti.com Cc: Tom Rini trini@ti.com
Some notes:
- GCC v4.5.1 didn't warn here
- GCC v4.6.1 seems to have a bug and can't compile this code: clocks.c: In function 'enable_non_essential_clocks': clocks.c:349:13: internal compiler error: in decode_addr_const, at
varasm.c:2632
arch/arm/include/asm/arch-omap5/clocks.h | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/arm/include/asm/arch-omap5/clocks.h b/arch/arm/include/asm/arch-omap5/clocks.h index fa99f65..d0e6dd6 100644 --- a/arch/arm/include/asm/arch-omap5/clocks.h +++ b/arch/arm/include/asm/arch-omap5/clocks.h @@ -686,14 +686,14 @@ struct dpll_regs { struct dpll_params { u32 m; u32 n;
- u8 m2;
- u8 m3;
- u8 h11;
- u8 h12;
- u8 h13;
- u8 h14;
- u8 h22;
- u8 h23;
- s8 m2;
- s8 m3;
- s8 h11;
- s8 h12;
- s8 h13;
- s8 h14;
- s8 h22;
- s8 h23;
};
extern struct omap5_prcm_regs *const prcm;
Make clock registers a signed type? whoa

On Sun, 4 Dec 2011 12:30:40 +0100 Marek Vasut marek.vasut@gmail.com wrote:
Fix: clocks.c: In function 'setup_post_dividers': clocks.c:175: warning: comparison is always true due to limited range of data type clocks.c:177: warning: comparison is always true due to limited range of data type clocks.c:179: warning: comparison is always true due to limited range of data type clocks.c:181: warning: comparison is always true due to limited range of data type clocks.c:183: warning: comparison is always true due to limited range of data type clocks.c:185: warning: comparison is always true due to limited range of data type clocks.c:187: warning: comparison is always true due to limited range of data type clocks.c:189: warning: comparison is always true due to limited range of data type
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: sricharan r.sricharan@ti.com Cc: Tom Rini trini@ti.com
Some notes:
- GCC v4.5.1 didn't warn here
- GCC v4.6.1 seems to have a bug and can't compile this code: clocks.c: In function 'enable_non_essential_clocks': clocks.c:349:13: internal compiler error: in decode_addr_const, at
varasm.c:2632
arch/arm/include/asm/arch-omap5/clocks.h | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/arm/include/asm/arch-omap5/clocks.h b/arch/arm/include/asm/arch-omap5/clocks.h index fa99f65..d0e6dd6 100644 --- a/arch/arm/include/asm/arch-omap5/clocks.h +++ b/arch/arm/include/asm/arch-omap5/clocks.h @@ -686,14 +686,14 @@ struct dpll_regs { struct dpll_params { u32 m; u32 n;
- u8 m2;
- u8 m3;
- u8 h11;
- u8 h12;
- u8 h13;
- u8 h14;
- u8 h22;
- u8 h23;
- s8 m2;
- s8 m3;
- s8 h11;
- s8 h12;
- s8 h13;
- s8 h14;
- s8 h22;
- s8 h23;
};
extern struct omap5_prcm_regs *const prcm;
Make clock registers a signed type? whoa
No, we don't make registers a signed type. This is parameters structure for some parameter tables containing -1 as an indicator that the parameter shouldn't be written to the register. Using unsigned type for structure field results in parameter value 255:
static const struct dpll_params per_dpll_params_768mhz[NUM_SYS_CLKS] = { {32, 0, 4, 3, 6, 4, -1, 2, -1, -1}, /* 12 MHz */ {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 13 MHz */ {160, 6, 4, 3, 6, 4, -1, 2, -1, -1}, /* 16.8 MHz */ {20, 0, 4, 3, 6, 4, -1, 2, -1, -1}, /* 19.2 MHz */ {192, 12, 4, 3, 6, 4, -1, 2, -1, -1}, /* 26 MHz */ {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */ {10, 0, 4, 3, 6, 4, -1, 2, -1, -1} /* 38.4 MHz */ };
The code then checks:
void setup_post_dividers(u32 *const base, const struct dpll_params *params) { struct dpll_regs *const dpll_regs = (struct dpll_regs *)base;
/* Setup post-dividers */ if (params->m2 >= 0) writel(params->m2, &dpll_regs->cm_div_m2_dpll); if (params->m3 >= 0) writel(params->m3, &dpll_regs->cm_div_m3_dpll); if (params->h11 >= 0) writel(params->h11, &dpll_regs->cm_div_h11_dpll); if (params->h12 >= 0) writel(params->h12, &dpll_regs->cm_div_h12_dpll); if (params->h13 >= 0) writel(params->h13, &dpll_regs->cm_div_h13_dpll); if (params->h14 >= 0) writel(params->h14, &dpll_regs->cm_div_h14_dpll); if (params->h22 >= 0) writel(params->h22, &dpll_regs->cm_div_h22_dpll); if (params->h23 >= 0) writel(params->h23, &dpll_regs->cm_div_h23_dpll); }
The result is that the registers will always be written to, since the comparison is always true. This is apparently not intended in the code.
The actual registers structure 'struct dpll_regs' uses unsigned type.
This sneaked in in the commit 2e5ba489 adding omap5 clock support. The similar parameter structure for omap4 used signed type for the fields in question.
Newer gcc doesn't warn here unless -Wextra option is used.
Thanks, Anatolij

On 12/04/2011 06:59 AM, Anatolij Gustschin wrote:
On Sun, 4 Dec 2011 12:30:40 +0100 Marek Vasut marek.vasut@gmail.com wrote:
Fix: clocks.c: In function 'setup_post_dividers': clocks.c:175: warning: comparison is always true due to limited range of data type clocks.c:177: warning: comparison is always true due to limited range of data type clocks.c:179: warning: comparison is always true due to limited range of data type clocks.c:181: warning: comparison is always true due to limited range of data type clocks.c:183: warning: comparison is always true due to limited range of data type clocks.c:185: warning: comparison is always true due to limited range of data type clocks.c:187: warning: comparison is always true due to limited range of data type clocks.c:189: warning: comparison is always true due to limited range of data type
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: sricharan r.sricharan@ti.com Cc: Tom Rini trini@ti.com
Some notes:
- GCC v4.5.1 didn't warn here
- GCC v4.6.1 seems to have a bug and can't compile this code: clocks.c: In function 'enable_non_essential_clocks': clocks.c:349:13: internal compiler error: in decode_addr_const, at
varasm.c:2632
arch/arm/include/asm/arch-omap5/clocks.h | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/arm/include/asm/arch-omap5/clocks.h b/arch/arm/include/asm/arch-omap5/clocks.h index fa99f65..d0e6dd6 100644 --- a/arch/arm/include/asm/arch-omap5/clocks.h +++ b/arch/arm/include/asm/arch-omap5/clocks.h @@ -686,14 +686,14 @@ struct dpll_regs { struct dpll_params { u32 m; u32 n;
- u8 m2;
- u8 m3;
- u8 h11;
- u8 h12;
- u8 h13;
- u8 h14;
- u8 h22;
- u8 h23;
- s8 m2;
- s8 m3;
- s8 h11;
- s8 h12;
- s8 h13;
- s8 h14;
- s8 h22;
- s8 h23;
};
extern struct omap5_prcm_regs *const prcm;
Make clock registers a signed type? whoa
No, we don't make registers a signed type. This is parameters structure for some parameter tables containing -1 as an indicator that the parameter shouldn't be written to the register. Using unsigned type for structure field results in parameter value 255:
static const struct dpll_params per_dpll_params_768mhz[NUM_SYS_CLKS] = { {32, 0, 4, 3, 6, 4, -1, 2, -1, -1}, /* 12 MHz */ {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 13 MHz */ {160, 6, 4, 3, 6, 4, -1, 2, -1, -1}, /* 16.8 MHz */ {20, 0, 4, 3, 6, 4, -1, 2, -1, -1}, /* 19.2 MHz */ {192, 12, 4, 3, 6, 4, -1, 2, -1, -1}, /* 26 MHz */ {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */ {10, 0, 4, 3, 6, 4, -1, 2, -1, -1} /* 38.4 MHz */ };
The code then checks:
void setup_post_dividers(u32 *const base, const struct dpll_params *params) { struct dpll_regs *const dpll_regs = (struct dpll_regs *)base;
/* Setup post-dividers */ if (params->m2 >= 0) writel(params->m2, &dpll_regs->cm_div_m2_dpll); if (params->m3 >= 0) writel(params->m3, &dpll_regs->cm_div_m3_dpll); if (params->h11 >= 0) writel(params->h11, &dpll_regs->cm_div_h11_dpll); if (params->h12 >= 0) writel(params->h12, &dpll_regs->cm_div_h12_dpll); if (params->h13 >= 0) writel(params->h13, &dpll_regs->cm_div_h13_dpll); if (params->h14 >= 0) writel(params->h14, &dpll_regs->cm_div_h14_dpll); if (params->h22 >= 0) writel(params->h22, &dpll_regs->cm_div_h22_dpll); if (params->h23 >= 0) writel(params->h23, &dpll_regs->cm_div_h23_dpll);
}
The result is that the registers will always be written to, since the comparison is always true. This is apparently not intended in the code.
The actual registers structure 'struct dpll_regs' uses unsigned type.
This sneaked in in the commit 2e5ba489 adding omap5 clock support. The similar parameter structure for omap4 used signed type for the fields in question.
Newer gcc doesn't warn here unless -Wextra option is used.
Sricharan, my examination, this analysis is correct, can you confirm that omap5 is supposed to work like omap4 in this case? Thanks.

Hi Tom, I agree on this. This was a bug. My gcc was on version 4.4.4 and did not see any warnings here.
Thanks, Sricharan
On Mon, Dec 5, 2011 at 8:38 PM, Tom Rini trini@ti.com wrote:
On 12/04/2011 06:59 AM, Anatolij Gustschin wrote:
On Sun, 4 Dec 2011 12:30:40 +0100 Marek Vasut marek.vasut@gmail.com wrote:
Fix: clocks.c: In function 'setup_post_dividers': clocks.c:175: warning: comparison is always true due to limited range
of
data type clocks.c:177: warning: comparison is always true due to limited range
of
data type clocks.c:179: warning: comparison is always true due to limited range
of
data type clocks.c:181: warning: comparison is always true due to limited range
of
data type clocks.c:183: warning: comparison is always true due to limited range
of
data type clocks.c:185: warning: comparison is always true due to limited range
of
data type clocks.c:187: warning: comparison is always true due to limited range
of
data type clocks.c:189: warning: comparison is always true due to limited range
of
data type
Signed-off-by: Anatolij Gustschin agust@denx.de Cc: sricharan r.sricharan@ti.com Cc: Tom Rini trini@ti.com
Some notes:
- GCC v4.5.1 didn't warn here
- GCC v4.6.1 seems to have a bug and can't compile this code: clocks.c: In function 'enable_non_essential_clocks': clocks.c:349:13: internal compiler error: in decode_addr_const, at
varasm.c:2632
arch/arm/include/asm/arch-omap5/clocks.h | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/arm/include/asm/arch-omap5/clocks.h b/arch/arm/include/asm/arch-omap5/clocks.h index fa99f65..d0e6dd6
100644
--- a/arch/arm/include/asm/arch-omap5/clocks.h +++ b/arch/arm/include/asm/arch-omap5/clocks.h @@ -686,14 +686,14 @@ struct dpll_regs { struct dpll_params { u32 m; u32 n;
- u8 m2;
- u8 m3;
- u8 h11;
- u8 h12;
- u8 h13;
- u8 h14;
- u8 h22;
- u8 h23;
- s8 m2;
- s8 m3;
- s8 h11;
- s8 h12;
- s8 h13;
- s8 h14;
- s8 h22;
- s8 h23;
};
extern struct omap5_prcm_regs *const prcm;
Make clock registers a signed type? whoa
No, we don't make registers a signed type. This is parameters structure for some parameter tables containing -1 as an indicator that the parameter shouldn't be written to the register. Using unsigned type for structure field results in parameter value 255:
static const struct dpll_params per_dpll_params_768mhz[NUM_SYS_CLKS] = { {32, 0, 4, 3, 6, 4, -1, 2, -1, -1}, /* 12 MHz */ {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 13 MHz */ {160, 6, 4, 3, 6, 4, -1, 2, -1, -1}, /* 16.8 MHz */ {20, 0, 4, 3, 6, 4, -1, 2, -1, -1}, /* 19.2 MHz */ {192, 12, 4, 3, 6, 4, -1, 2, -1, -1}, /* 26 MHz */ {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */ {10, 0, 4, 3, 6, 4, -1, 2, -1, -1} /* 38.4 MHz */ };
The code then checks:
void setup_post_dividers(u32 *const base, const struct dpll_params
*params)
{ struct dpll_regs *const dpll_regs = (struct dpll_regs *)base;
/* Setup post-dividers */ if (params->m2 >= 0) writel(params->m2, &dpll_regs->cm_div_m2_dpll); if (params->m3 >= 0) writel(params->m3, &dpll_regs->cm_div_m3_dpll); if (params->h11 >= 0) writel(params->h11, &dpll_regs->cm_div_h11_dpll); if (params->h12 >= 0) writel(params->h12, &dpll_regs->cm_div_h12_dpll); if (params->h13 >= 0) writel(params->h13, &dpll_regs->cm_div_h13_dpll); if (params->h14 >= 0) writel(params->h14, &dpll_regs->cm_div_h14_dpll); if (params->h22 >= 0) writel(params->h22, &dpll_regs->cm_div_h22_dpll); if (params->h23 >= 0) writel(params->h23, &dpll_regs->cm_div_h23_dpll);
}
The result is that the registers will always be written to, since the comparison is always true. This is apparently not intended in the code.
The actual registers structure 'struct dpll_regs' uses unsigned type.
This sneaked in in the commit 2e5ba489 adding omap5 clock support. The similar parameter structure for omap4 used signed type for the fields in question.
Newer gcc doesn't warn here unless -Wextra option is used.
Sricharan, my examination, this analysis is correct, can you confirm that omap5 is supposed to work like omap4 in this case? Thanks.
-- Tom

Hello Anatolij,
Anatolij Gustschin wrote:
Fix: menu.c: In function 'menu_item_print': menu.c:91: warning: passing argument 1 of 'putc' makes integer from pointer without a cast
Signed-off-by: Anatolij Gustschin agust@denx.de
common/menu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Thanks, had the same patch in my queue ;-)
Acked-by: Heiko Schocher hs@denx.de
Tested on the cam_enc_4xx board, so also a:
Tested-by: Heiko Schocher hs@denx.de
bye, Heiko

Fix: menu.c: In function 'menu_item_print': menu.c:91: warning: passing argument 1 of 'putc' makes integer from pointer without a cast
Signed-off-by: Anatolij Gustschin agust@denx.de
common/menu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/common/menu.c b/common/menu.c index ca1baef..5e0817c 100644 --- a/common/menu.c +++ b/common/menu.c @@ -88,7 +88,7 @@ static inline void *menu_item_print(struct menu *m, void *extra) { if (!m->item_data_print) {
putc(item->key);
putc('\n'); } else { m->item_data_print(item->data);puts(item->key);
I see printf("%s\n", item->key); in there ... you might have some newer version though. Please recheck and if that's the case:
Acked-by: Marek Vasut marek.vasut@gmail.com

Hi Marek,
On Sun, 4 Dec 2011 12:27:26 +0100 Marek Vasut marek.vasut@gmail.com wrote: ...
diff --git a/common/menu.c b/common/menu.c index ca1baef..5e0817c 100644 --- a/common/menu.c +++ b/common/menu.c @@ -88,7 +88,7 @@ static inline void *menu_item_print(struct menu *m, void *extra) { if (!m->item_data_print) {
putc(item->key);
putc('\n'); } else { m->item_data_print(item->data);puts(item->key);
I see printf("%s\n", item->key); in there ... you might have some newer version though. Please recheck and if that's the case:
I've the newer version from u-boot.git master branch.
Thanks, Anatolij

Dear Anatolij Gustschin,
In message 1322930775-4767-1-git-send-email-agust@denx.de you wrote:
Fix: menu.c: In function 'menu_item_print': menu.c:91: warning: passing argument 1 of 'putc' makes integer from pointer without a cast
Signed-off-by: Anatolij Gustschin agust@denx.de
common/menu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
participants (8)
-
Anatolij Gustschin
-
Heiko Schocher
-
Marek Vasut
-
R, Sricharan
-
Remy Bohmer
-
Scott Wood
-
Tom Rini
-
Wolfgang Denk