[rtems commit] powerpc/shared: Fix warnings

Chris Johns chrisj at rtems.org
Mon Feb 15 21:14:29 UTC 2021


Module:    rtems
Branch:    master
Commit:    53abbbd08db28c516728f92d343a93a983122dcb
Changeset: http://git.rtems.org/rtems/commit/?id=53abbbd08db28c516728f92d343a93a983122dcb

Author:    Chris Johns <chrisj at rtems.org>
Date:      Fri Feb 12 15:25:07 2021 -1000

powerpc/shared: Fix warnings

---

 bsps/powerpc/shared/vme/bspVmeDmaList.c |  3 ++-
 bsps/powerpc/shared/vme/vmeTsi148.c     | 15 +++++++++------
 bsps/powerpc/shared/vme/vmeUniverse.c   |  8 +++++---
 3 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/bsps/powerpc/shared/vme/bspVmeDmaList.c b/bsps/powerpc/shared/vme/bspVmeDmaList.c
index 73b398d..fb552ac 100644
--- a/bsps/powerpc/shared/vme/bspVmeDmaList.c
+++ b/bsps/powerpc/shared/vme/bspVmeDmaList.c
@@ -47,6 +47,7 @@
  * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
  */
 
+#include <inttypes.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -71,7 +72,7 @@ typedef struct VMEDmaListNodeRec_ {
 static void
 lprint(VMEDmaListNode d)
 {
-	printf("n 0x%08lx, p: 0x%08lx, n: 0x%08lx d: 0x%08lx\n",
+	printf("n 0x%08" PRIu32", p: 0x%08" PRIu32 ", n: 0x%08" PRIu32 " d: 0x%08" PRIu32 "\n",
 		(uint32_t)d, (uint32_t)d->p, (uint32_t)d->n, (uint32_t)d->d);
 }
 #endif
diff --git a/bsps/powerpc/shared/vme/vmeTsi148.c b/bsps/powerpc/shared/vme/vmeTsi148.c
index 4e1893b..3cb3f94 100644
--- a/bsps/powerpc/shared/vme/vmeTsi148.c
+++ b/bsps/powerpc/shared/vme/vmeTsi148.c
@@ -46,6 +46,7 @@
  */
 
 #include <rtems.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdarg.h>
 #include <bsp/irq.h>
@@ -2352,8 +2353,10 @@ static uint32_t
 vme_attr(uint32_t xfer_mode)
 {
 uint32_t vme_mode;
-	if ( am2omode(xfer_mode, &vme_mode) )
+unsigned long ul;
+	if ( am2omode(xfer_mode, &ul) )
 		return BSP_VMEDMA_STATUS_UNSUP;
+	vme_mode = (uint32_t) ul;
 
 	/* am2omode may set prefetch and other bits */
 	vme_mode &= TSI_DXAT_OTAT_MSK;
@@ -2405,11 +2408,11 @@ static void
 tsi_desc_dump(DmaDescriptor p)
 {
 VmeTsi148DmaListDescriptor d = p;
-		printf("   DSA: 0x%08lx%08lx\n", ld_be32(&d->dsau),  ld_be32(&d->dsal));
-		printf("   DDA: 0x%08lx%08lx\n", ld_be32(&d->ddau),  ld_be32(&d->ddal));
-		printf("   NLA: 0x%08lx%08lx\n", ld_be32(&d->dnlau), ld_be32(&d->dnlal));
-		printf("   SAT: 0x%08lx              DAT: 0x%08lx\n", ld_be32(&d->dsat), ld_be32(&d->ddat));
-		printf("   CNT: 0x%08lx\n",      ld_be32(&d->dcnt));
+		printf("   DSA: 0x%08" PRIx32 "%08" PRIx32 "\n", ld_be32(&d->dsau),  ld_be32(&d->dsal));
+		printf("   DDA: 0x%08" PRIx32 "%08" PRIx32 "\n", ld_be32(&d->ddau),  ld_be32(&d->ddal));
+		printf("   NLA: 0x%08" PRIx32 "%08" PRIx32 "\n", ld_be32(&d->dnlau), ld_be32(&d->dnlal));
+		printf("   SAT: 0x%08" PRIx32 "              DAT: 0x%08" PRIx32 "\n", ld_be32(&d->dsat), ld_be32(&d->ddat));
+		printf("   CNT: 0x%08" PRIx32 "\n",      ld_be32(&d->dcnt));
 }
 
 
diff --git a/bsps/powerpc/shared/vme/vmeUniverse.c b/bsps/powerpc/shared/vme/vmeUniverse.c
index c7373b4..18fe61f 100644
--- a/bsps/powerpc/shared/vme/vmeUniverse.c
+++ b/bsps/powerpc/shared/vme/vmeUniverse.c
@@ -1301,6 +1301,7 @@ static uint32_t
 xfer_mode2dctl(uint32_t xfer_mode)
 {
 uint32_t dctl;
+unsigned long ul;
 
 	/* Check requested bus mode */
 
@@ -1323,8 +1324,9 @@ uint32_t dctl;
 		return BSP_VMEDMA_STATUS_UNSUP;
 
 	/* Luckily DCTL bits match MCTL bits so we can use am2mode */
-	if ( am2mode( 1, xfer_mode, &dctl ) )
+	if ( am2mode( 1, xfer_mode, &ul ) )
 		return BSP_VMEDMA_STATUS_UNSUP;
+	dctl = (uint32_t) ul;
 
 	/* However, the book says that for DMA VAS==5 [which would
 	 * be a CSR access] is reserved. Tests indicate that
@@ -1959,7 +1961,7 @@ unsigned long 		linten;
 #else
 			vmeUniverseIntDisable(lvl);
 #endif
-			printk("vmeUniverse ISR: error read from STATID register; (level: %i) STATID: 0x%08" PRIx32 " -- DISABLING\n", lvl, status);
+			printk("vmeUniverse ISR: error read from STATID register; (level: %i) STATID: 0x%08lx -- DISABLING\n", lvl, status);
 		} else if (!(ip=universeHdlTbl[status & UNIV_VIRQ_STATID_MASK])) {
 #ifdef BSP_PIC_DO_EOI
 			linten &= ~msk;
@@ -1967,7 +1969,7 @@ unsigned long 		linten;
 			vmeUniverseIntDisable(lvl);
 #endif
 				/* TODO: log error message - RTEMS has no logger :-( */
-			printk("vmeUniverse ISR: no handler installed for this vector; (level: %i) STATID: 0x%08" PRIx32 " -- DISABLING\n", lvl, status);
+			printk("vmeUniverse ISR: no handler installed for this vector; (level: %i) STATID: 0x%08lx -- DISABLING\n", lvl, status);
 		} else {
 				/* dispatch handler, it must clear the IRQ at the device */
 				ip->isr(ip->usrData, status&UNIV_VIRQ_STATID_MASK);



More information about the vc mailing list