[U-Boot-Users] [PATCH] Remove warnings compiling serial_xuartlite.c

Signed-off-by: Ricardo Ribalda Delgado ricardo.ribalda@uam.es --- serial_xuartlite.c: In function ‘serial_putc’: serial_xuartlite.c:59: warning: passing argument 1 of ‘in_be32’ makes pointer from integer without a cast serial_xuartlite.c:60: warning: passing argument 1 of ‘out_be32’ makes pointer from integer without a cast serial_xuartlite.c: In function ‘serial_getc’: serial_xuartlite.c:72: warning: passing argument 1 of ‘in_be32’ makes pointer from integer without a cast serial_xuartlite.c:73: warning: passing argument 1 of ‘in_be32’ makes pointer from integer without a cast serial_xuartlite.c: In function ‘serial_tstc’: serial_xuartlite.c:78: warning: passing argument 1 of ‘in_be32’ makes pointer from integer without a cast
Previous warnings corrected by this patch
drivers/serial/serial_xuartlite.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/serial/serial_xuartlite.c b/drivers/serial/serial_xuartlite.c index 5c41a1c..2e6f096 100644 --- a/drivers/serial/serial_xuartlite.c +++ b/drivers/serial/serial_xuartlite.c @@ -37,9 +37,9 @@ #define SR_RX_FIFO_VALID_DATA 0x01 /* data in receive FIFO */ #define SR_RX_FIFO_FULL 0x02 /* receive FIFO full */
-#define UARTLITE_STATUS (CONFIG_SERIAL_BASE + STATUS_REG_OFFSET) -#define UARTLITE_TX_FIFO (CONFIG_SERIAL_BASE + TX_FIFO_OFFSET) -#define UARTLITE_RX_FIFO (CONFIG_SERIAL_BASE + RX_FIFO_OFFSET) +#define UARTLITE_STATUS (u32*)(CONFIG_SERIAL_BASE + STATUS_REG_OFFSET) +#define UARTLITE_TX_FIFO (u32*)(CONFIG_SERIAL_BASE + TX_FIFO_OFFSET) +#define UARTLITE_RX_FIFO (u32*)(CONFIG_SERIAL_BASE + RX_FIFO_OFFSET)
int serial_init(void) {

On Wed, Jul 16, 2008 at 03:01:33AM +0200, Ricardo Ribalda Delgado wrote:
diff --git a/drivers/serial/serial_xuartlite.c b/drivers/serial/serial_xuartlite.c index 5c41a1c..2e6f096 100644 --- a/drivers/serial/serial_xuartlite.c +++ b/drivers/serial/serial_xuartlite.c @@ -37,9 +37,9 @@ #define SR_RX_FIFO_VALID_DATA 0x01 /* data in receive FIFO */ #define SR_RX_FIFO_FULL 0x02 /* receive FIFO full */
-#define UARTLITE_STATUS (CONFIG_SERIAL_BASE + STATUS_REG_OFFSET) -#define UARTLITE_TX_FIFO (CONFIG_SERIAL_BASE + TX_FIFO_OFFSET) -#define UARTLITE_RX_FIFO (CONFIG_SERIAL_BASE + RX_FIFO_OFFSET) +#define UARTLITE_STATUS (u32*)(CONFIG_SERIAL_BASE + STATUS_REG_OFFSET) +#define UARTLITE_TX_FIFO (u32*)(CONFIG_SERIAL_BASE + TX_FIFO_OFFSET) +#define UARTLITE_RX_FIFO (u32*)(CONFIG_SERIAL_BASE + RX_FIFO_OFFSET)
Nak. Fix the code instead. These constants are correct and should not be pre-cast in the macro.
g.

Casting on in_be32 not in MACROS
Signed-off-by: Ricardo Ribalda Delgado ricardo.ribalda@uam.es --- serial_xuartlite.c: In function ‘serial_putc’: serial_xuartlite.c:59: warning: passing argument 1 of ‘in_be32’ makes pointer from integer without a cast serial_xuartlite.c:60: warning: passing argument 1 of ‘out_be32’ makes pointer from integer without a cast serial_xuartlite.c: In function ‘serial_getc’: serial_xuartlite.c:72: warning: passing argument 1 of ‘in_be32’ makes pointer from integer without a cast serial_xuartlite.c:73: warning: passing argument 1 of ‘in_be32’ makes pointer from integer without a cast serial_xuartlite.c: In function ‘serial_tstc’: serial_xuartlite.c:78: warning: passing argument 1 of ‘in_be32’ makes pointer from integer without a cast
Previous warnings corrected by this patch
drivers/serial/serial_xuartlite.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/serial/serial_xuartlite.c b/drivers/serial/serial_xuartlite.c index 5c41a1c..74546ce 100644 --- a/drivers/serial/serial_xuartlite.c +++ b/drivers/serial/serial_xuartlite.c @@ -56,8 +56,8 @@ void serial_putc(const char c) { if (c == '\n') serial_putc('\r'); - while (in_be32(UARTLITE_STATUS) & SR_TX_FIFO_FULL); - out_be32(UARTLITE_TX_FIFO, (unsigned char) (c & 0xff)); + while (in_be32((u32 *) UARTLITE_STATUS) & SR_TX_FIFO_FULL); + out_be32((u32 *) UARTLITE_TX_FIFO, (unsigned char) (c & 0xff)); }
void serial_puts(const char * s) @@ -69,13 +69,13 @@ void serial_puts(const char * s)
int serial_getc(void) { - while (!(in_be32(UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA)); - return in_be32(UARTLITE_RX_FIFO) & 0xff; + while (!(in_be32((u32 *) UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA)); + return in_be32((u32 *) UARTLITE_RX_FIFO) & 0xff; }
int serial_tstc(void) { - return (in_be32(UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA); + return (in_be32((u32 *) UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA); }
#endif /* CONFIG_MICROBLZE */

On Wed, Jul 16, 2008 at 04:22:32PM +0200, Ricardo Ribalda Delgado wrote:
Casting on in_be32 not in MACROS
Signed-off-by: Ricardo Ribalda Delgado ricardo.ribalda@uam.es
Acked-by: Grant Likely grant.likely@secretlab.ca
serial_xuartlite.c: In function ‘serial_putc’: serial_xuartlite.c:59: warning: passing argument 1 of ‘in_be32’ makes pointer from integer without a cast serial_xuartlite.c:60: warning: passing argument 1 of ‘out_be32’ makes pointer from integer without a cast serial_xuartlite.c: In function ‘serial_getc’: serial_xuartlite.c:72: warning: passing argument 1 of ‘in_be32’ makes pointer from integer without a cast serial_xuartlite.c:73: warning: passing argument 1 of ‘in_be32’ makes pointer from integer without a cast serial_xuartlite.c: In function ‘serial_tstc’: serial_xuartlite.c:78: warning: passing argument 1 of ‘in_be32’ makes pointer from integer without a cast
Previous warnings corrected by this patch
drivers/serial/serial_xuartlite.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/serial/serial_xuartlite.c b/drivers/serial/serial_xuartlite.c index 5c41a1c..74546ce 100644 --- a/drivers/serial/serial_xuartlite.c +++ b/drivers/serial/serial_xuartlite.c @@ -56,8 +56,8 @@ void serial_putc(const char c) { if (c == '\n') serial_putc('\r');
- while (in_be32(UARTLITE_STATUS) & SR_TX_FIFO_FULL);
- out_be32(UARTLITE_TX_FIFO, (unsigned char) (c & 0xff));
- while (in_be32((u32 *) UARTLITE_STATUS) & SR_TX_FIFO_FULL);
- out_be32((u32 *) UARTLITE_TX_FIFO, (unsigned char) (c & 0xff));
}
void serial_puts(const char * s) @@ -69,13 +69,13 @@ void serial_puts(const char * s)
int serial_getc(void) {
- while (!(in_be32(UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA));
- return in_be32(UARTLITE_RX_FIFO) & 0xff;
- while (!(in_be32((u32 *) UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA));
- return in_be32((u32 *) UARTLITE_RX_FIFO) & 0xff;
}
int serial_tstc(void) {
- return (in_be32(UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA);
- return (in_be32((u32 *) UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA);
}
#endif /* CONFIG_MICROBLZE */
1.5.6.2
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users

In message 1216218152-16067-1-git-send-email-ricardo.ribalda@uam.es you wrote:
Casting on in_be32 not in MACROS
Signed-off-by: Ricardo Ribalda Delgado ricardo.ribalda@uam.es
Applied, thanks.
But please do not base64 encode plain text messages!!!
Best regards,
Wolfgang Denk

Hello
I think that I created it using the git-format-patch and I did sent it using the git-send-email.... Any modifier that I should use?
Best regards
2008/7/20 Wolfgang Denk wd@denx.de:
In message 1216218152-16067-1-git-send-email-ricardo.ribalda@uam.es you wrote:
Casting on in_be32 not in MACROS
Signed-off-by: Ricardo Ribalda Delgado ricardo.ribalda@uam.es
Applied, thanks.
But please do not base64 encode plain text messages!!!
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@denx.de Der Dativ ist dem Genitiv sein Tod.

"Ricardo Ribalda Delgado" ricardo.ribalda@uam.es wrote:
I think that I created it using the git-format-patch and I did sent it using the git-send-email.... Any modifier that I should use?
I think the list engine at SourceForge converts the mail to base64 whenever it feels like it. So there's not much to do about it on your end except staying away from anything but 7-bit ascii.
Welcome to the seventies...
Haavard

On Wed, Jul 23, 2008 at 11:20:50AM +0200, Haavard Skinnemoen wrote:
"Ricardo Ribalda Delgado" ricardo.ribalda@uam.es wrote:
I think that I created it using the git-format-patch and I did sent it using the git-send-email.... Any modifier that I should use?
I think the list engine at SourceForge converts the mail to base64 whenever it feels like it. So there's not much to do about it on your end except staying away from anything but 7-bit ascii.
Welcome to the seventies...
Ugh. Now I need to figure out how to make mutt talk 7-bit. blech.
But at least I now know that I'm not going crazy.
Thanks, g.

In message 20080723112050.26135b94@hskinnemo-gx745.norway.atmel.com you wrote:
I think the list engine at SourceForge converts the mail to base64 whenever it feels like it. So there's not much to do about it on your end except staying away from anything but 7-bit ascii.
No, this is not correct. SF may be slow and doing a lot of painful things, but it does NOT convertany messages. That happens at the sender's end.
Best regards,
Wolfgang Denk

On Thu, Jul 24, 2008 at 05:18:26AM +0200, Wolfgang Denk wrote:
In message 20080723112050.26135b94@hskinnemo-gx745.norway.atmel.com you wrote:
I think the list engine at SourceForge converts the mail to base64 whenever it feels like it. So there's not much to do about it on your end except staying away from anything but 7-bit ascii.
No, this is not correct. SF may be slow and doing a lot of painful things, but it does NOT convertany messages. That happens at the sender's end.
I double checked. I'm definitely not sending base64. My copy in my sent mailbox is in utf-8, not base64.
g.

Grant Likely grant.likely@secretlab.ca wrote:
On Thu, Jul 24, 2008 at 05:18:26AM +0200, Wolfgang Denk wrote:
In message 20080723112050.26135b94@hskinnemo-gx745.norway.atmel.com you wrote:
I think the list engine at SourceForge converts the mail to base64 whenever it feels like it. So there's not much to do about it on your end except staying away from anything but 7-bit ascii.
No, this is not correct. SF may be slow and doing a lot of painful things, but it does NOT convertany messages. That happens at the sender's end.
I double checked. I'm definitely not sending base64. My copy in my sent mailbox is in utf-8, not base64.
I've seen that before too. Wolfgang yelled at me for sending base64, so I checked with some people which I had Cc'ed directly, and they received it correctly. Only people who got it through the list received it base64-encoded.
So whatever it is that mangles the message, it's not a trivial problem and I think yelling at the sender is the wrong thing to do.
In any case, it's probably a good idea to include whoever you want to apply the patch in the recipient list.
Haavard
participants (4)
-
Grant Likely
-
Haavard Skinnemoen
-
Ricardo Ribalda Delgado
-
Wolfgang Denk