summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/amcc/common/flash.c7
-rw-r--r--board/amcc/taihu/flash.c14
-rw-r--r--board/amcc/yucca/flash.c7
-rw-r--r--board/dave/common/flash.c3
-rw-r--r--board/esd/common/flash.c3
-rw-r--r--board/esd/cpci750/ide.c8
-rw-r--r--board/etin/debris/phantom.c10
-rw-r--r--drivers/net/natsemi.c3
-rw-r--r--drivers/net/sk98lin/skge.c12
-rw-r--r--drivers/net/sk98lin/skgesirq.c7
-rw-r--r--drivers/net/sk98lin/skrlmt.c3
-rw-r--r--drivers/net/sk98lin/skxmac2.c20
-rw-r--r--net/bootp.c6
-rw-r--r--tools/kwbimage.c2
14 files changed, 63 insertions, 42 deletions
diff --git a/board/amcc/common/flash.c b/board/amcc/common/flash.c
index 9943c74..9aaf256 100644
--- a/board/amcc/common/flash.c
+++ b/board/amcc/common/flash.c
@@ -912,9 +912,10 @@ static int flash_erase_2(flash_info_t * info, int s_first, int s_last)
static int write_word_2(flash_info_t * info, ulong dest, ulong data)
{
- volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = (CONFIG_SYS_FLASH_WORD_SIZE *) (info->start[0]);
- volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = (CONFIG_SYS_FLASH_WORD_SIZE *) dest;
- volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = (CONFIG_SYS_FLASH_WORD_SIZE *) & data;
+ ulong *data_ptr = &data;
+ volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = (CONFIG_SYS_FLASH_WORD_SIZE *)(info->start[0]);
+ volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = (CONFIG_SYS_FLASH_WORD_SIZE *)dest;
+ volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = (CONFIG_SYS_FLASH_WORD_SIZE *)data_ptr;
ulong start;
int i;
diff --git a/board/amcc/taihu/flash.c b/board/amcc/taihu/flash.c
index 110cbe5..497fdb9 100644
--- a/board/amcc/taihu/flash.c
+++ b/board/amcc/taihu/flash.c
@@ -691,9 +691,10 @@ static int write_word_1(flash_info_t * info, ulong dest, ulong data)
static int write_word(flash_info_t * info, ulong dest, ulong data)
#endif
{
- volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = (CONFIG_SYS_FLASH_WORD_SIZE *) (info->start[0]);
- volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = (CONFIG_SYS_FLASH_WORD_SIZE *) dest;
- volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = (CONFIG_SYS_FLASH_WORD_SIZE *) & data;
+ ulong *data_ptr = &data;
+ volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = (CONFIG_SYS_FLASH_WORD_SIZE *)(info->start[0]);
+ volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = (CONFIG_SYS_FLASH_WORD_SIZE *)dest;
+ volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = (CONFIG_SYS_FLASH_WORD_SIZE *)data_ptr;
ulong start;
int i;
@@ -1039,9 +1040,10 @@ static int flash_erase_2(flash_info_t * info, int s_first, int s_last)
static int write_word_2(flash_info_t * info, ulong dest, ulong data)
{
- volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = (CONFIG_SYS_FLASH_WORD_SIZE *) (info->start[0]);
- volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = (CONFIG_SYS_FLASH_WORD_SIZE *) dest;
- volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = (CONFIG_SYS_FLASH_WORD_SIZE *) & data;
+ ulong *data_ptr = &data;
+ volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = (CONFIG_SYS_FLASH_WORD_SIZE *)(info->start[0]);
+ volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = (CONFIG_SYS_FLASH_WORD_SIZE *)dest;
+ volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = (CONFIG_SYS_FLASH_WORD_SIZE *)data_ptr;
ulong start;
int i;
diff --git a/board/amcc/yucca/flash.c b/board/amcc/yucca/flash.c
index 33b97a5..5fab7bb 100644
--- a/board/amcc/yucca/flash.c
+++ b/board/amcc/yucca/flash.c
@@ -914,9 +914,10 @@ static int flash_erase_2(flash_info_t * info, int s_first, int s_last)
static int write_word_2(flash_info_t * info, ulong dest, ulong data)
{
- volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = (CONFIG_SYS_FLASH_WORD_SIZE *) (info->start[0]);
- volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = (CONFIG_SYS_FLASH_WORD_SIZE *) dest;
- volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = (CONFIG_SYS_FLASH_WORD_SIZE *) & data;
+ ulong *data_ptr = &data;
+ volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = (CONFIG_SYS_FLASH_WORD_SIZE *)(info->start[0]);
+ volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = (CONFIG_SYS_FLASH_WORD_SIZE *)dest;
+ volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = (CONFIG_SYS_FLASH_WORD_SIZE *)data_ptr;
ulong start;
int i;
diff --git a/board/dave/common/flash.c b/board/dave/common/flash.c
index b6af63b..29caf47 100644
--- a/board/dave/common/flash.c
+++ b/board/dave/common/flash.c
@@ -663,9 +663,10 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
*/
static int write_word (flash_info_t *info, ulong dest, ulong data)
{
+ ulong *data_ptr = &data;
volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = (CONFIG_SYS_FLASH_WORD_SIZE *)(info->start[0]);
volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = (CONFIG_SYS_FLASH_WORD_SIZE *)dest;
- volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = (CONFIG_SYS_FLASH_WORD_SIZE *)&data;
+ volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = (CONFIG_SYS_FLASH_WORD_SIZE *)data_ptr;
ulong start;
int flag;
int i;
diff --git a/board/esd/common/flash.c b/board/esd/common/flash.c
index 3ea053b..38a58fb 100644
--- a/board/esd/common/flash.c
+++ b/board/esd/common/flash.c
@@ -630,9 +630,10 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
*/
static int write_word (flash_info_t *info, ulong dest, ulong data)
{
+ ulong *data_ptr = &data;
volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = (CONFIG_SYS_FLASH_WORD_SIZE *)(info->start[0]);
volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = (CONFIG_SYS_FLASH_WORD_SIZE *)dest;
- volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = (CONFIG_SYS_FLASH_WORD_SIZE *)&data;
+ volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = (CONFIG_SYS_FLASH_WORD_SIZE *)data_ptr;
ulong start;
int flag;
int i;
diff --git a/board/esd/cpci750/ide.c b/board/esd/cpci750/ide.c
index 638219f..a3bd1b7 100644
--- a/board/esd/cpci750/ide.c
+++ b/board/esd/cpci750/ide.c
@@ -48,14 +48,18 @@ int ide_preinit (void)
if (devbusfn == -1)
devbusfn = pci_find_device (0x1095, 0x3114, 0);
if (devbusfn != -1) {
+ ulong *ide_bus_offset_ptr;
+
status = 0;
+ ide_bus_offset_ptr = &ide_bus_offset[0];
pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_0,
- (u32 *) & ide_bus_offset[0]);
+ (u32 *)ide_bus_offset_ptr);
ide_bus_offset[0] &= 0xfffffffe;
ide_bus_offset[0] += CONFIG_SYS_PCI0_IO_SPACE;
+ ide_bus_offset_ptr = &ide_bus_offset[1];
pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_2,
- (u32 *) & ide_bus_offset[1]);
+ (u32 *)ide_bus_offset_ptr);
ide_bus_offset[1] &= 0xfffffffe;
ide_bus_offset[1] += CONFIG_SYS_PCI0_IO_SPACE;
}
diff --git a/board/etin/debris/phantom.c b/board/etin/debris/phantom.c
index fcb4c40..63feb7c 100644
--- a/board/etin/debris/phantom.c
+++ b/board/etin/debris/phantom.c
@@ -159,16 +159,6 @@ void rtc_reset(void)
}
}
-inline unsigned bcd2bin (uchar n)
-{
- return ((((n >> 4) & 0x0F) * 10) + (n & 0x0F));
-}
-
-inline unsigned char bin2bcd (unsigned int n)
-{
- return (((n / 10) << 4) | (n % 10));
-}
-
static int get_century_flag(void)
{
int flag = 0;
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index ce12c3b..e09da1d 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -754,7 +754,8 @@ natsemi_send(struct eth_device *dev, volatile void *packet, int length)
{
u32 i, status = 0;
u32 tx_status = 0;
- vu_long *res = (vu_long *)&tx_status;
+ u32 *tx_ptr = &tx_status;
+ vu_long *res = (vu_long *)tx_ptr;
/* Stop the transmitter */
OUTL(dev, TxOff, ChipCmd);
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
index c815480..df764b4 100644
--- a/drivers/net/sk98lin/skge.c
+++ b/drivers/net/sk98lin/skge.c
@@ -1382,13 +1382,19 @@ int TxDescrSize; /* the size of a tx descriptor rounded up to alignment*/
pAC->TxDescrPerRing = TX_RING_SIZE / RxDescrSize;
for (i=0; i<pAC->GIni.GIMacsFound; i++) {
+ TXD **txd_head, **txd_tail, **txd_prev;
+
+ txd_head = &pAC->TxPort[i][0].pTxdRingHead;
+ txd_tail = &pAC->TxPort[i][0].pTxdRingTail;
+ txd_prev = &pAC->TxPort[i][0].pTxdRingPrev;
+
SetupRing(
pAC,
pAC->TxPort[i][0].pTxDescrRing,
pAC->TxPort[i][0].VTxDescrRing,
- (RXD**)&pAC->TxPort[i][0].pTxdRingHead,
- (RXD**)&pAC->TxPort[i][0].pTxdRingTail,
- (RXD**)&pAC->TxPort[i][0].pTxdRingPrev,
+ (RXD**)txd_head,
+ (RXD**)txd_tail,
+ (RXD**)txd_prev,
&pAC->TxPort[i][0].TxdRingFree,
SK_TRUE);
SetupRing(
diff --git a/drivers/net/sk98lin/skgesirq.c b/drivers/net/sk98lin/skgesirq.c
index 106fe48..53229d2 100644
--- a/drivers/net/sk98lin/skgesirq.c
+++ b/drivers/net/sk98lin/skgesirq.c
@@ -1266,6 +1266,7 @@ int Port) /* Which port should be checked */
SK_GEPORT *pPrt; /* GIni Port struct pointer */
int Done;
SK_U32 GpReg; /* General Purpose register value */
+ SK_U32 *pGpReg; /* Pointer to -- " -- */
SK_U16 Isrc; /* Interrupt source register */
SK_U16 IsrcSum; /* Interrupt source register sum */
SK_U16 LpAb; /* Link Partner Ability */
@@ -1274,6 +1275,8 @@ int Port) /* Which port should be checked */
SK_BOOL AutoNeg; /* Is Auto-negotiation used ? */
SK_U8 NextMode; /* Next AutoSensing Mode */
+ pGpReg = &GpReg;
+
pPrt = &pAC->GIni.GP[Port];
if (pPrt->PHWLinkUp) {
@@ -1298,7 +1301,7 @@ int Port) /* Which port should be checked */
if (pPrt->PLinkBroken) {
/* Link was broken */
- XM_IN32(IoC, Port, XM_GP_PORT, &GpReg);
+ XM_IN32(IoC, Port, XM_GP_PORT, pGpReg);
if ((GpReg & XM_GP_INP_ASS) == 0) {
/* The Link is in sync */
@@ -1395,7 +1398,7 @@ int Port) /* Which port should be checked */
* here we usually can check whether the link is in sync and
* auto-negotiation is done.
*/
- XM_IN32(IoC, Port, XM_GP_PORT, &GpReg);
+ XM_IN32(IoC, Port, XM_GP_PORT, pGpReg);
XM_IN16(IoC, Port, XM_ISRC, &Isrc);
IsrcSum |= Isrc;
diff --git a/drivers/net/sk98lin/skrlmt.c b/drivers/net/sk98lin/skrlmt.c
index 2e7924d..a178dff 100644
--- a/drivers/net/sk98lin/skrlmt.c
+++ b/drivers/net/sk98lin/skrlmt.c
@@ -657,8 +657,9 @@ int Level) /* Initialization Level */
}
for (i = 0; i < (SK_U32)pAC->GIni.GIMacsFound; i++) {
+ SK_U64 *pRandom = &Random;
Random = SkOsGetTime(pAC);
- *(SK_U32*)&pAC->Rlmt.Port[i].Random = *(SK_U32*)&Random;
+ *(SK_U32*)&pAC->Rlmt.Port[i].Random = *(SK_U32*)pRandom;
for (j = 0; j < 4; j++) {
pAC->Rlmt.Port[i].Random[j] ^= pAC->Rlmt.Port[i].AddrPort->
diff --git a/drivers/net/sk98lin/skxmac2.c b/drivers/net/sk98lin/skxmac2.c
index e0ded42..2f7c054 100644
--- a/drivers/net/sk98lin/skxmac2.c
+++ b/drivers/net/sk98lin/skxmac2.c
@@ -747,10 +747,11 @@ SK_BOOL Enable) /* Enable / Disable */
{
SK_U16 RcReg;
SK_U32 MdReg;
+ SK_U32 *pMdReg = &MdReg;
if (pAC->GIni.GIGenesis) {
- XM_IN32(IoC, Port, XM_MODE, &MdReg);
+ XM_IN32(IoC, Port, XM_MODE, pMdReg);
/* enable or disable promiscuous mode */
if (Enable) {
MdReg |= XM_MD_ENA_PROM;
@@ -797,10 +798,11 @@ SK_BOOL Enable) /* Enable / Disable */
{
SK_U16 RcReg;
SK_U32 MdReg;
+ SK_U32 *pMdReg = &MdReg;
if (pAC->GIni.GIGenesis) {
- XM_IN32(IoC, Port, XM_MODE, &MdReg);
+ XM_IN32(IoC, Port, XM_MODE, pMdReg);
/* enable or disable hashing */
if (Enable) {
MdReg |= XM_MD_ENA_HASH;
@@ -1109,10 +1111,11 @@ SK_IOC IoC, /* IO context */
int Port) /* Port Index (MAC_1 + n) */
{
SK_U32 MdReg;
+ SK_U32 *pMdReg = &MdReg;
if (pAC->GIni.GIGenesis) {
- XM_IN32(IoC, Port, XM_MODE, &MdReg);
+ XM_IN32(IoC, Port, XM_MODE, pMdReg);
XM_OUT32(IoC, Port, XM_MODE, MdReg | XM_MD_FTF);
}
@@ -1139,10 +1142,11 @@ SK_IOC IoC, /* IO context */
int Port) /* Port Index (MAC_1 + n) */
{
SK_U32 MdReg;
+ SK_U32 *pMdReg = &MdReg;
if (pAC->GIni.GIGenesis) {
- XM_IN32(IoC, Port, XM_MODE, &MdReg);
+ XM_IN32(IoC, Port, XM_MODE, pMdReg);
XM_OUT32(IoC, Port, XM_MODE, MdReg | XM_MD_FRF);
}
@@ -1961,6 +1965,7 @@ int Port) /* Port Index (MAC_1 + n) */
{
SK_GEPORT *pPrt;
SK_U32 DWord;
+ SK_U32 *pDWord = &DWord;
SK_U16 Word;
pPrt = &pAC->GIni.GP[Port];
@@ -1984,7 +1989,7 @@ int Port) /* Port Index (MAC_1 + n) */
XM_OUT16(IoC, Port, XM_MMU_CMD, Word);
- XM_IN32(IoC, Port, XM_MODE, &DWord);
+ XM_IN32(IoC, Port, XM_MODE, pDWord);
if (pPrt->PFlowCtrlStatus == SK_FLOW_STAT_SYMMETRIC ||
pPrt->PFlowCtrlStatus == SK_FLOW_STAT_LOC_SEND) {
@@ -4228,18 +4233,19 @@ SK_U64 *pStatus) /* ptr for return overflow status value */
{
SK_U64 Status; /* Overflow status */
SK_U32 RegVal;
+ SK_U32 *pRegVal = &RegVal;
Status = 0;
if ((IStatus & XM_IS_RXC_OV) != 0) {
- XM_IN32(IoC, Port, XM_RX_CNT_EV, &RegVal);
+ XM_IN32(IoC, Port, XM_RX_CNT_EV, pRegVal);
Status |= (SK_U64)RegVal << 32;
}
if ((IStatus & XM_IS_TXC_OV) != 0) {
- XM_IN32(IoC, Port, XM_TX_CNT_EV, &RegVal);
+ XM_IN32(IoC, Port, XM_TX_CNT_EV, pRegVal);
Status |= (SK_U64)RegVal;
}
diff --git a/net/bootp.c b/net/bootp.c
index 0799ae2..3093852 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -683,6 +683,9 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
{
uchar *end = popt + BOOTP_HDR_SIZE;
int oplen, size;
+#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET)
+ int *to_ptr;
+#endif
while (popt < end && *popt != 0xff) {
oplen = *(popt + 1);
@@ -692,7 +695,8 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
break;
#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET)
case 2: /* Time offset */
- NetCopyLong ((ulong *)&NetTimeOffset, (ulong *) (popt + 2));
+ to_ptr = &NetTimeOffset;
+ NetCopyLong ((ulong *)to_ptr, (ulong *)(popt + 2));
NetTimeOffset = ntohl (NetTimeOffset);
break;
#endif
diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index 28dc2d6..ee067cb 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -131,7 +131,7 @@ static uint32_t kwbimage_checksum32 (uint32_t *start, uint32_t len, uint32_t csu
return 0;
if (len % sizeof(uint32_t)) {
- printf ("Error:%s[%d] - lenght is not in multiple of %d\n",
+ printf ("Error:%s[%d] - lenght is not in multiple of %ld\n",
__FUNCTION__, len, sizeof(uint32_t));
return 0;
}