From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Sun, 23 Oct 2011 10:52:25 +0200 Subject: [U-Boot] [PATCH 2/2] serial: uartlite: Fix compilation warnings In-Reply-To: <1318933330-17883-2-git-send-email-monstr@monstr.eu> References: <1318933330-17883-1-git-send-email-monstr@monstr.eu> <1318933330-17883-2-git-send-email-monstr@monstr.eu> Message-ID: <20111023085225.B9CCF18AE823@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > > --- > 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