microblaze: Fix strict-aliasign rules for in_be32
Michal Simek
maintainerPATCH 1/2 microblaze: Fix strict-aliasign rules for in_be32
readl should work with unsigned int instead of unsigned long.
--- arch/microblaze/include/asm/io.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/microblaze/include/asm/io.h +1 -1
@@ -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))
Signature · 1 line
1.7.5.4
Michal Simek
maintainerPATCH 2/2 serial: uartlite: Fix compilation warnings
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
---
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(-)
drivers/serial/serial_xuartlite.c +1 -1
@@ -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
Signature · 1 line
1.7.5.4
Michal Simek
maintainerPATCH 1/2 microblaze: Fix strict-aliasign rules for in_be32
In reply to Michal SimekQuoted 6 lines · Michal Simek
readl should work with unsigned int instead of unsigned long.
Signed-off-by Michal Simek <[email protected]>--- arch/microblaze/include/asm/io.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Reject - coding style issue - I was too fast.
Thanks,
Michal
Signature · 4 lines
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
Wolfgang Denk
AppliedPATCH 2/2 serial: uartlite: Fix compilation warnings
In reply to Michal SimekDear Michal Simek,
Quoted 12 lines · In message <[email protected]> you wrote:
Do not setup
userial_portsarray as const because inuartlite_serial_putcisout_be32which can't write totx_fifoif is const.Warning log:
serial_xuartlite.c: In function 'uartlite_serial_putc':
serial_xuartlite.c:60: warning: initialization discards qualifiers from pointer target typeserial_xuartlite.c: In function 'uartlite_serial_getc':
serial_xuartlite.c:78: warning: initialization discards qualifiers from pointer target typeserial_xuartlite.c: In function 'uartlite_serial_tstc':
serial_xuartlite.c:87: warning: initialization discards qualifiers from pointer target type
Quoted 7 lines
Signed-off-by Michal Simek <[email protected]>---
There are several approach how to solve it inuartlite_serial_putc.
1. add retype toout_be32function
2. retype in assignment
3. do not defineuserial_portsas 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?
Quoted 3 lines
--- drivers/serial/serial_xuartlite.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 4 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 God made the integers; all else is the work of Man. - Kronecker