All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <monstr@monstr.eu>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] serial: uartlite: Fix compilation warnings
Date: Tue, 18 Oct 2011 12:22:10 +0200	[thread overview]
Message-ID: <1318933330-17883-2-git-send-email-monstr@monstr.eu> (raw)
In-Reply-To: <1318933330-17883-1-git-send-email-monstr@monstr.eu>

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

  reply	other threads:[~2011-10-18 10:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2011-10-23  8:52   ` [U-Boot] [PATCH 2/2] serial: uartlite: Fix compilation warnings Wolfgang Denk
2011-10-18 10:26 ` [U-Boot] [PATCH 1/2] microblaze: Fix strict-aliasign rules for in_be32 Michal Simek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1318933330-17883-2-git-send-email-monstr@monstr.eu \
    --to=monstr@monstr.eu \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.