[U-Boot] [PATCH 2/2] serial: uartlite: Fix compilation warnings

Michal Simek monstr at monstr.eu
Tue Oct 18 12:22:10 CEST 2011


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 at 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



More information about the U-Boot mailing list