summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/ns8382x.c4
-rw-r--r--lib_ppc/board.c7
-rw-r--r--net/net.c3
-rw-r--r--net/tftp.c28
4 files changed, 29 insertions, 13 deletions
diff --git a/drivers/ns8382x.c b/drivers/ns8382x.c
index 281940b222..be99c3b4d7 100644
--- a/drivers/ns8382x.c
+++ b/drivers/ns8382x.c
@@ -745,7 +745,7 @@ static int
ns8382x_send(struct eth_device *dev, volatile void *packet, int length)
{
u32 i, status = 0;
- u32 tx_stat = 0;
+ vu_long tx_stat = 0;
/* Stop the transmitter */
OUTL(dev, TxOff, ChipCmd);
@@ -771,7 +771,7 @@ ns8382x_send(struct eth_device *dev, volatile void *packet, int length)
/* restart the transmitter */
OUTL(dev, TxOn, ChipCmd);
- for (i = 0; ((vu_long)tx_stat = le32_to_cpu(txd.cmdsts)) & DescOwn; i++) {
+ for (i = 0; (tx_stat = le32_to_cpu(txd.cmdsts)) & DescOwn; i++) {
if (i >= TOUT_LOOP) {
printf ("%s: tx error buffer not ready: txd.cmdsts %#X\n",
dev->name, tx_stat);
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index dab268e351..04aa8f9b4d 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -352,6 +352,7 @@ void board_init_f (ulong bootflag)
bd_t *bd;
ulong len, addr, addr_sp;
+ ulong *s;
gd_t *id;
init_fnc_t **init_fnc_ptr;
#ifdef CONFIG_PRAM
@@ -471,8 +472,10 @@ void board_init_f (ulong bootflag)
*/
addr_sp -= 16;
addr_sp &= ~0xF;
- *((ulong *) addr_sp)-- = 0;
- *((ulong *) addr_sp)-- = 0;
+ s = (ulong *)addr_sp;
+ *s-- = 0;
+ *s-- = 0;
+ addr_sp = (ulong)s;
debug ("Stack Pointer at: %08lx\n", addr_sp);
/*
diff --git a/net/net.c b/net/net.c
index 00217be081..d13ae74cd1 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1574,10 +1574,11 @@ unsigned
NetCksum(uchar * ptr, int len)
{
ulong xsum;
+ ushort *p = ptr;
xsum = 0;
while (len-- > 0)
- xsum += *((ushort *)ptr)++;
+ xsum += *p++;
xsum = (xsum & 0xffff) + (xsum >> 16);
xsum = (xsum & 0xffff) + (xsum >> 16);
return (xsum & 0xffff);
diff --git a/net/tftp.c b/net/tftp.c
index 64a5576663..03a002767a 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -106,6 +106,7 @@ TftpSend (void)
volatile uchar * pkt;
volatile uchar * xp;
int len = 0;
+ volatile ushort *s;
/*
* We will always be sending some sort of packet, so
@@ -117,7 +118,9 @@ TftpSend (void)
case STATE_RRQ:
xp = pkt;
- *((ushort *)pkt)++ = htons(TFTP_RRQ);
+ s = (ushort *)pkt;
+ *s++ = htons(TFTP_RRQ);
+ pkt = (uchar *)s;
strcpy ((char *)pkt, tftp_filename);
pkt += strlen(tftp_filename) + 1;
strcpy ((char *)pkt, "octet");
@@ -135,15 +138,19 @@ TftpSend (void)
case STATE_DATA:
case STATE_OACK:
xp = pkt;
- *((ushort *)pkt)++ = htons(TFTP_ACK);
- *((ushort *)pkt)++ = htons(TftpBlock);
+ s = (ushort *)pkt;
+ *s++ = htons(TFTP_ACK);
+ *s++ = htons(TftpBlock);
+ pkt = (uchar *)s;
len = pkt - xp;
break;
case STATE_TOO_LARGE:
xp = pkt;
- *((ushort *)pkt)++ = htons(TFTP_ERROR);
- *((ushort *)pkt)++ = htons(3);
+ s = (ushort *)pkt;
+ *s++ = htons(TFTP_ERROR);
+ *s++ = htons(3);
+ pkt = (uchar *)s;
strcpy ((char *)pkt, "File too large");
pkt += 14 /*strlen("File too large")*/ + 1;
len = pkt - xp;
@@ -151,8 +158,10 @@ TftpSend (void)
case STATE_BAD_MAGIC:
xp = pkt;
- *((ushort *)pkt)++ = htons(TFTP_ERROR);
- *((ushort *)pkt)++ = htons(2);
+ s = (ushort *)pkt;
+ *s++ = htons(TFTP_ERROR);
+ *s++ = htons(2);
+ pkt = (uchar *)s;
strcpy ((char *)pkt, "File has bad magic");
pkt += 18 /*strlen("File has bad magic")*/ + 1;
len = pkt - xp;
@@ -167,6 +176,7 @@ static void
TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
{
ushort proto;
+ ushort *s;
if (dest != TftpOurPort) {
return;
@@ -180,7 +190,9 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
}
len -= 2;
/* warning: don't use increment (++) in ntohs() macros!! */
- proto = *((ushort *)pkt)++;
+ s = (ushort *)pkt;
+ proto = *s++;
+ pkt = (uchar *)s;
switch (ntohs(proto)) {
case TFTP_RRQ: