public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] microblaze: Fix strict-aliasign rules for in_be32
@ 2011-10-18 10:22 Michal Simek
  2011-10-18 10:22 ` [U-Boot] [PATCH 2/2] serial: uartlite: Fix compilation warnings Michal Simek
  2011-10-18 10:26 ` [U-Boot] [PATCH 1/2] microblaze: Fix strict-aliasign rules for in_be32 Michal Simek
  0 siblings, 2 replies; 4+ messages in thread
From: Michal Simek @ 2011-10-18 10:22 UTC (permalink / raw)
  To: u-boot

readl should work with unsigned int instead of unsigned long.

Signed-off-by: Michal Simek <monstr@monstr.eu>
---
 arch/microblaze/include/asm/io.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h
index 7e190d1..187ae73 100644
--- a/arch/microblaze/include/asm/io.h
+++ b/arch/microblaze/include/asm/io.h
@@ -25,7 +25,7 @@
 #define readw(addr) \
   ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; })
 #define readl(addr) \
-  ({ unsigned long __v = (*(volatile unsigned long *) (addr)); __v; })
+  ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; })
 
 #define writeb(b, addr) \
   (void)((*(volatile unsigned char *) (addr)) = (b))
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 2/2] serial: uartlite: Fix compilation warnings
  2011-10-18 10:22 [U-Boot] [PATCH 1/2] microblaze: Fix strict-aliasign rules for in_be32 Michal Simek
@ 2011-10-18 10:22 ` Michal Simek
  2011-10-23  8:52   ` Wolfgang Denk
  2011-10-18 10:26 ` [U-Boot] [PATCH 1/2] microblaze: Fix strict-aliasign rules for in_be32 Michal Simek
  1 sibling, 1 reply; 4+ messages in thread
From: Michal Simek @ 2011-10-18 10:22 UTC (permalink / raw)
  To: u-boot

Do not setup userial_ports array as const because
in uartlite_serial_putc is out_be32 which can't write
to tx_fifo if is const.

Warning log:
serial_xuartlite.c: In function 'uartlite_serial_putc':
serial_xuartlite.c:60: warning: initialization discards qualifiers from pointer target type
serial_xuartlite.c: In function 'uartlite_serial_getc':
serial_xuartlite.c:78: warning: initialization discards qualifiers from pointer target type
serial_xuartlite.c: In function 'uartlite_serial_tstc':
serial_xuartlite.c:87: warning: initialization discards qualifiers from pointer target type

Signed-off-by: Michal Simek <monstr@monstr.eu>

---
There are several approach how to solve it in uartlite_serial_putc.
1. add retype to out_be32 function
2. retype in assignment
3. do not define userial_ports as const - used solution
---
 drivers/serial/serial_xuartlite.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/serial_xuartlite.c b/drivers/serial/serial_xuartlite.c
index 2dc6bd1..3a38f9e 100644
--- a/drivers/serial/serial_xuartlite.c
+++ b/drivers/serial/serial_xuartlite.c
@@ -40,7 +40,7 @@ struct uartlite {
 	unsigned int status;
 };
 
-static const struct uartlite *userial_ports[4] = {
+static struct uartlite *userial_ports[4] = {
 #ifdef XILINX_UARTLITE_BASEADDR
 	[0] = (struct uartlite *)XILINX_UARTLITE_BASEADDR,
 #endif
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 1/2] microblaze: Fix strict-aliasign rules for in_be32
  2011-10-18 10:22 [U-Boot] [PATCH 1/2] microblaze: Fix strict-aliasign rules for in_be32 Michal Simek
  2011-10-18 10:22 ` [U-Boot] [PATCH 2/2] serial: uartlite: Fix compilation warnings Michal Simek
@ 2011-10-18 10:26 ` Michal Simek
  1 sibling, 0 replies; 4+ messages in thread
From: Michal Simek @ 2011-10-18 10:26 UTC (permalink / raw)
  To: u-boot

Michal Simek wrote:
> readl should work with unsigned int instead of unsigned long.
> 
> Signed-off-by: Michal Simek <monstr@monstr.eu>
> ---
>  arch/microblaze/include/asm/io.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Reject - coding style issue - I was too fast.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 2/2] serial: uartlite: Fix compilation warnings
  2011-10-18 10:22 ` [U-Boot] [PATCH 2/2] serial: uartlite: Fix compilation warnings Michal Simek
@ 2011-10-23  8:52   ` Wolfgang Denk
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2011-10-23  8:52 UTC (permalink / raw)
  To: u-boot

Dear Michal Simek,

In message <1318933330-17883-2-git-send-email-monstr@monstr.eu> you wrote:
> Do not setup userial_ports array as const because
> in uartlite_serial_putc is out_be32 which can't write
> to tx_fifo if is const.
> 
> Warning log:
> serial_xuartlite.c: In function 'uartlite_serial_putc':
> serial_xuartlite.c:60: warning: initialization discards qualifiers from pointer target type
> serial_xuartlite.c: In function 'uartlite_serial_getc':
> serial_xuartlite.c:78: warning: initialization discards qualifiers from pointer target type
> serial_xuartlite.c: In function 'uartlite_serial_tstc':
> serial_xuartlite.c:87: warning: initialization discards qualifiers from pointer target type
> 
> Signed-off-by: Michal Simek <monstr@monstr.eu>
> 
> ---
> There are several approach how to solve it in uartlite_serial_putc.
> 1. add retype to out_be32 function
> 2. retype in assignment
> 3. do not define userial_ports as const - used solution

Wouldn't 1. and 2. actually be wrong?  If you need to write to the
struct, you must not declare it as constant?

> ---
>  drivers/serial/serial_xuartlite.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
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
God made the integers; all else is the work of Man.       - Kronecker

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-10-23  8:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-18 10:22 [U-Boot] [PATCH 1/2] microblaze: Fix strict-aliasign rules for in_be32 Michal Simek
2011-10-18 10:22 ` [U-Boot] [PATCH 2/2] serial: uartlite: Fix compilation warnings Michal Simek
2011-10-23  8:52   ` Wolfgang Denk
2011-10-18 10:26 ` [U-Boot] [PATCH 1/2] microblaze: Fix strict-aliasign rules for in_be32 Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox