sk98lin: fix compile warnings
Fix warnings:
skge.c: In function 'BoardInitMem':
skge.c:1389: warning: dereferencing type-punned pointer will break strict-aliasing rules
skge.c:1390: warning: dereferencing type-punned pointer will break strict-aliasing rules
skge.c:1391: warning: dereferencing type-punned pointer will break strict-aliasing rules
skgesirq.c: In function 'SkGePortCheckUpXmac':
skgesirq.c:1301: warning: dereferencing type-punned pointer will break strict-aliasing rules
skgesirq.c:1301: warning: dereferencing type-punned pointer will break strict-aliasing rules
skgesirq.c:1398: warning: dereferencing type-punned pointer will break strict-aliasing rules
skgesirq.c:1398: warning: dereferencing type-punned pointer will break strict-aliasing rules
skrlmt.c: In function 'SkRlmtInit':
skrlmt.c:661: warning: dereferencing type-punned pointer will break strict-aliasing rules
skxmac2.c: In function 'SkMacPromiscMode':
skxmac2.c:753: warning: dereferencing type-punned pointer will break strict-aliasing rules
skxmac2.c:753: warning: dereferencing type-punned pointer will break strict-aliasing rules
skxmac2.c: In function 'SkMacHashing':
skxmac2.c:803: warning: dereferencing type-punned pointer will break strict-aliasing rules
skxmac2.c:803: warning: dereferencing type-punned pointer will break strict-aliasing rules
skxmac2.c: In function 'SkMacFlushTxFifo':
skxmac2.c:1115: warning: dereferencing type-punned pointer will break strict-aliasing rules
skxmac2.c:1115: warning: dereferencing type-punned pointer will break strict-aliasing rules
skxmac2.c: In function 'SkMacFlushRxFifo':
skxmac2.c:1145: warning: dereferencing type-punned pointer will break strict-aliasing rules
skxmac2.c:1145: warning: dereferencing type-punned pointer will break strict-aliasing rules
skxmac2.c: In function 'SkXmInitPauseMd':
skxmac2.c:1987: warning: dereferencing type-punned pointer will break strict-aliasing rules
skxmac2.c:1987: warning: dereferencing type-punned pointer will break strict-aliasing rules
skxmac2.c: In function 'SkXmOverflowStatus':
skxmac2.c:4236: warning: dereferencing type-punned pointer will break strict-aliasing rules
skxmac2.c:4236: warning: dereferencing type-punned pointer will break strict-aliasing rules
skxmac2.c:4242: warning: dereferencing type-punned pointer will break strict-aliasing rules
skxmac2.c:4242: warning: dereferencing type-punned pointer will break strict-aliasing rules
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Ben Warren <biggerbadderben@gmail.com>
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 @@
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 @@
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 @@
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 @@
* 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;