[rtems commit] bsps/sparc: Fix warnings

Sebastian Huber sebh at rtems.org
Fri Dec 21 20:44:15 UTC 2018


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Dec 21 21:43:27 2018 +0100

bsps/sparc: Fix warnings

---

 bsps/sparc/shared/amba/ahbstat.c            |  6 +++---
 bsps/sparc/shared/net/greth.c               |  3 ++-
 bsps/sparc/shared/pci/gr_701.c              | 13 +++++++++----
 bsps/sparc/shared/pci/gr_cpci_gr740.c       |  8 +++++---
 bsps/sparc/shared/pci/gr_leon4_n2x.c        |  8 +++++---
 bsps/sparc/shared/pci/gr_rasta_adcdac.c     | 15 ++++++++++-----
 bsps/sparc/shared/pci/gr_rasta_io.c         | 15 ++++++++++-----
 bsps/sparc/shared/pci/gr_rasta_spw_router.c |  9 ++++++---
 bsps/sparc/shared/pci/gr_rasta_tmtc.c       | 13 +++++++++----
 bsps/sparc/shared/pci/gr_tmtc_1553.c        |  9 ++++++---
 10 files changed, 65 insertions(+), 34 deletions(-)

diff --git a/bsps/sparc/shared/amba/ahbstat.c b/bsps/sparc/shared/amba/ahbstat.c
index f57d643..4e4cd72 100644
--- a/bsps/sparc/shared/amba/ahbstat.c
+++ b/bsps/sparc/shared/amba/ahbstat.c
@@ -8,7 +8,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <string.h>
 #include <rtems.h>
 #include <rtems/bspIo.h>
@@ -177,8 +177,8 @@ void ahbstat_isr(void *arg)
 		rc = ahbstat_error(priv->minor, priv->regs, status, fadr);
 
 	if ((rc & 0x1) == 0) {
-		printk("\n### AHBSTAT: %s %s error of size %ld by master %ld"
-			" at 0x%08lx\n",
+		printk("\n### AHBSTAT: %s %s error of size %" PRId32
+			" by master %" PRId32 " at 0x%08" PRIx32 "\n",
 			status & AHBSTAT_STS_CE ? "single" : "non-correctable",
 			status & AHBSTAT_STS_HW ? "write" : "read",
 			(status & AHBSTAT_STS_HS) >> AHBSTAT_STS_HS_BIT,
diff --git a/bsps/sparc/shared/net/greth.c b/bsps/sparc/shared/net/greth.c
index f45f83c..a927ddf 100644
--- a/bsps/sparc/shared/net/greth.c
+++ b/bsps/sparc/shared/net/greth.c
@@ -327,7 +327,8 @@ static void print_init_info(struct greth_softc *sc)
     }
 #ifdef GRETH_AUTONEGO_PRINT_TIME
     if ( sc->auto_neg ) {
-        printf("Autonegotiation Time: %ldms\n", sc->auto_neg_time.tv_sec * 1000 +
+        printf("Autonegotiation Time: %" PRIdMAX "ms\n",
+               (intmax_t)sc->auto_neg_time.tv_sec * 1000 +
                sc->auto_neg_time.tv_nsec / 1000000);
     }
 #endif
diff --git a/bsps/sparc/shared/pci/gr_701.c b/bsps/sparc/shared/pci/gr_701.c
index 03f3020..b0070fd 100644
--- a/bsps/sparc/shared/pci/gr_701.c
+++ b/bsps/sparc/shared/pci/gr_701.c
@@ -15,6 +15,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -344,8 +345,10 @@ int gr701_init1(struct drvmgr_dev *dev)
 		PCI_DEV_EXPAND(priv->pcidev));
 	printk(" PCI VENDOR: 0x%04x, DEVICE: 0x%04x\n\n\n",
 		devinfo->id.vendor, devinfo->id.device);
-	printk(" PCI BAR[0]: 0x%lx - 0x%lx\n", bar0, bar0 + bar0_size - 1);
-	printk(" PCI BAR[1]: 0x%lx - 0x%lx\n", bar1, bar1 + bar1_size - 1);
+	printk(" PCI BAR[0]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar0, bar0 + bar0_size - 1);
+	printk(" PCI BAR[1]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar1, bar1 + bar1_size - 1);
 	printk(" IRQ: %d\n\n\n", devinfo->irq);
 
 	/* all neccessary space assigned to GR-701 target? */
@@ -572,8 +575,10 @@ void gr701_print_dev(struct drvmgr_dev *dev, int options)
 	bar1 = devinfo->resources[1].address;
 	bar1_size = devinfo->resources[1].size;
 
-	printf(" PCI BAR[0]: 0x%lx - 0x%lx\n", bar0, bar0 + bar0_size - 1);
-	printf(" PCI BAR[1]: 0x%lx - 0x%lx\n", bar1, bar1 + bar1_size - 1);
+	printf(" PCI BAR[0]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar0, bar0 + bar0_size - 1);
+	printf(" PCI BAR[1]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar1, bar1 + bar1_size - 1);
 	printf(" IRQ:             %d\n", devinfo->irq);
 
 	/* Frequency is the same as the PCI bus frequency */
diff --git a/bsps/sparc/shared/pci/gr_cpci_gr740.c b/bsps/sparc/shared/pci/gr_cpci_gr740.c
index dbb0947..a9a6149 100644
--- a/bsps/sparc/shared/pci/gr_cpci_gr740.c
+++ b/bsps/sparc/shared/pci/gr_cpci_gr740.c
@@ -25,6 +25,7 @@
  *   Interrupt testing
  */
 
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -482,7 +483,7 @@ int gr_cpci_gr740_init1(struct drvmgr_dev *dev)
 	printk(" PCI VENDOR: 0x%04x, DEVICE: 0x%04x\n",
 		devinfo->id.vendor, devinfo->id.device);
 	for (i = 0; i < 3; i++) {
-		printk(" PCI BAR[%d]: 0x%08lx - 0x%08lx\n",
+		printk(" PCI BAR[%d]: 0x%08" PRIx32 " - 0x%08" PRIx32 "\n",
 			i, devinfo->resources[i].address,
 			devinfo->resources[i].address +
 			(devinfo->resources[i].size - 1));
@@ -737,8 +738,9 @@ void gr_cpci_gr740_print_dev(struct drvmgr_dev *dev, int options)
 
 	bar0 = devinfo->resources[0].address;
 	bar0_size = devinfo->resources[0].size;
-	printf(" PCI BAR[0]: 0x%lx - 0x%lx\n", bar0, bar0 + bar0_size - 1);
-	printf(" IRQ REGS:        0x%x\n", (unsigned int)priv->irq);
+	printf(" PCI BAR[0]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar0, bar0 + bar0_size - 1);
+	printf(" IRQ REGS:        0x%" PRIxPTR "\n", (uintptr_t)priv->irq);
 	printf(" IRQ:             %d\n", devinfo->irq);
 	printf(" PCI REVISION:    %d\n", devinfo->rev);
 	printf(" FREQ:            %d Hz\n", priv->amba_freq_hz);
diff --git a/bsps/sparc/shared/pci/gr_leon4_n2x.c b/bsps/sparc/shared/pci/gr_leon4_n2x.c
index 76e2bb0..4dd9005 100644
--- a/bsps/sparc/shared/pci/gr_leon4_n2x.c
+++ b/bsps/sparc/shared/pci/gr_leon4_n2x.c
@@ -24,6 +24,7 @@
  *   bar1 RESOURCE 0xf0000000            L2-Cache registers
  */
 
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -505,7 +506,7 @@ int gr_cpci_leon4_n2x_init1(struct drvmgr_dev *dev)
 	printk(" PCI VENDOR: 0x%04x, DEVICE: 0x%04x\n",
 		devinfo->id.vendor, devinfo->id.device);
 	for (i = 0; i < 3; i++) {
-		printk(" PCI BAR[%d]: 0x%08lx - 0x%08lx\n",
+		printk(" PCI BAR[%d]: 0x%08" PRIx32 " - 0x%08" PRIx32 "\n",
 			i, devinfo->resources[i].address,
 			devinfo->resources[i].address +
 			(devinfo->resources[i].size - 1));
@@ -760,8 +761,9 @@ void gr_cpci_leon4_n2x_print_dev(struct drvmgr_dev *dev, int options)
 
 	bar0 = devinfo->resources[0].address;
 	bar0_size = devinfo->resources[0].size;
-	printf(" PCI BAR[0]: 0x%lx - 0x%lx\n", bar0, bar0 + bar0_size - 1);
-	printf(" IRQ REGS:        0x%x\n", (unsigned int)priv->irq);
+	printf(" PCI BAR[0]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar0, bar0 + bar0_size - 1);
+	printf(" IRQ REGS:        0x%" PRIxPTR "\n", (uintptr_t)priv->irq);
 	printf(" IRQ:             %d\n", devinfo->irq);
 	printf(" PCI REVISION:    %d\n", devinfo->rev);
 	printf(" FREQ:            %d Hz\n", priv->amba_freq_hz);
diff --git a/bsps/sparc/shared/pci/gr_rasta_adcdac.c b/bsps/sparc/shared/pci/gr_rasta_adcdac.c
index 1c46510..bea5832 100644
--- a/bsps/sparc/shared/pci/gr_rasta_adcdac.c
+++ b/bsps/sparc/shared/pci/gr_rasta_adcdac.c
@@ -15,6 +15,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -409,8 +410,10 @@ int gr_rasta_adcdac_init1(struct drvmgr_dev *dev)
 		PCI_DEV_EXPAND(priv->pcidev));
 	printk(" PCI VENDOR: 0x%04x, DEVICE: 0x%04x\n",
 		devinfo->id.vendor, devinfo->id.device);
-	printk(" PCI BAR[0]: 0x%lx - 0x%lx\n", bar0, bar0 + bar0_size - 1);
-	printk(" PCI BAR[1]: 0x%lx - 0x%lx\n", bar1, bar1 + bar1_size - 1);
+	printk(" PCI BAR[0]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar0, bar0 + bar0_size - 1);
+	printk(" PCI BAR[1]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar1, bar1 + bar1_size - 1);
 	printk(" IRQ: %d\n\n\n", devinfo->irq);
 
 	/* all neccessary space assigned to GR-RASTA-ADCDAC target? */
@@ -651,9 +654,11 @@ void gr_rasta_adcdac_print_dev(struct drvmgr_dev *dev, int options)
 	bar1 = devinfo->resources[1].address;
 	bar1_size = devinfo->resources[1].size;
 
-	printf(" PCI BAR[0]: 0x%lx - 0x%lx\n", bar0, bar0 + bar0_size - 1);
-	printf(" PCI BAR[1]: 0x%lx - 0x%lx\n", bar1, bar1 + bar1_size - 1);
-	printf(" IRQ REGS:        0x%x\n", (unsigned int)priv->irq);
+	printf(" PCI BAR[0]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar0, bar0 + bar0_size - 1);
+	printf(" PCI BAR[1]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar1, bar1 + bar1_size - 1);
+	printf(" IRQ REGS:        0x%" PRIxPTR "\n", (uintptr_t)priv->irq);
 	printf(" IRQ:             %d\n", devinfo->irq);
 	printf(" PCI REVISION:    %d\n", devinfo->rev);
 	printf(" FREQ:            %d Hz\n", priv->version->amba_freq_hz);
diff --git a/bsps/sparc/shared/pci/gr_rasta_io.c b/bsps/sparc/shared/pci/gr_rasta_io.c
index fed4b36..63299c1 100644
--- a/bsps/sparc/shared/pci/gr_rasta_io.c
+++ b/bsps/sparc/shared/pci/gr_rasta_io.c
@@ -15,6 +15,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -588,8 +589,10 @@ int gr_rasta_io_init1(struct drvmgr_dev *dev)
 		PCI_DEV_EXPAND(priv->pcidev));
 	printk(" PCI VENDOR: 0x%04x, DEVICE: 0x%04x\n",
 		devinfo->id.vendor, devinfo->id.device);
-	printk(" PCI BAR[0]: 0x%lx - 0x%lx\n", bar0, bar0 + bar0_size - 1);
-	printk(" PCI BAR[1]: 0x%lx - 0x%lx\n", bar1, bar1 + bar1_size - 1);
+	printk(" PCI BAR[0]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar0, bar0 + bar0_size - 1);
+	printk(" PCI BAR[1]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar1, bar1 + bar1_size - 1);
 	printk(" IRQ: %d\n\n\n", devinfo->irq);
 
 	/* all neccessary space assigned to GR-RASTA-IO target? */
@@ -848,9 +851,11 @@ void gr_rasta_io_print_dev(struct drvmgr_dev *dev, int options)
 	bar1 = devinfo->resources[1].address;
 	bar1_size = devinfo->resources[1].size;
 
-	printf(" PCI BAR[0]: 0x%lx - 0x%lx\n", bar0, bar0 + bar0_size - 1);
-	printf(" PCI BAR[1]: 0x%lx - 0x%lx\n", bar1, bar1 + bar1_size - 1);
-	printf(" IRQ REGS:        0x%x\n", (unsigned int)priv->irq);
+	printf(" PCI BAR[0]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar0, bar0 + bar0_size - 1);
+	printf(" PCI BAR[1]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar1, bar1 + bar1_size - 1);
+	printf(" IRQ REGS:        0x%" PRIxPTR "\n", (uintptr_t)priv->irq);
 	printf(" IRQ:             %d\n", devinfo->irq);
 	printf(" PCI REVISION:    %d\n", devinfo->rev);
 	printf(" FREQ:            %d Hz\n", priv->version->amba_freq_hz);
diff --git a/bsps/sparc/shared/pci/gr_rasta_spw_router.c b/bsps/sparc/shared/pci/gr_rasta_spw_router.c
index dede9a8..0bfc645 100644
--- a/bsps/sparc/shared/pci/gr_rasta_spw_router.c
+++ b/bsps/sparc/shared/pci/gr_rasta_spw_router.c
@@ -13,6 +13,7 @@
  *  GR-RASTA-IO driver.
  */
 
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -422,7 +423,8 @@ int gr_rasta_spw_router_init1(struct drvmgr_dev *dev)
 		PCI_DEV_EXPAND(priv->pcidev));
 	printk(" PCI VENDOR: 0x%04x, DEVICE: 0x%04x\n",
 		devinfo->id.vendor, devinfo->id.device);
-	printk(" PCI BAR[0]: 0x%08lx - 0x%08lx\n", bar0, bar0 + bar0_size - 1);
+	printk(" PCI BAR[0]: 0x%08" PRIx32 " - 0x%08" PRIx32 "\n",
+		bar0, bar0 + bar0_size - 1);
 	printk(" IRQ: %d\n\n\n", devinfo->irq);
 
 	/* all neccessary space assigned to GR-RASTA-SPW-ROUTER target? */
@@ -655,8 +657,9 @@ void gr_rasta_spw_router_print_dev(struct drvmgr_dev *dev, int options)
 
 	bar0 = devinfo->resources[0].address;
 	bar0_size = devinfo->resources[0].size;
-	printf(" PCI BAR[0]: 0x%lx - 0x%lx\n", bar0, bar0 + bar0_size - 1);
-	printf(" IRQ REGS:        0x%x\n", (unsigned int)priv->irq);
+	printf(" PCI BAR[0]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar0, bar0 + bar0_size - 1);
+	printf(" IRQ REGS:        0x%" PRIxPTR "\n", (uintptr_t)priv->irq);
 	printf(" IRQ:             %d\n", devinfo->irq);
 	printf(" PCI REVISION:    %d\n", devinfo->rev);
 	printf(" FREQ:            %d Hz\n", priv->version->amba_freq_hz);
diff --git a/bsps/sparc/shared/pci/gr_rasta_tmtc.c b/bsps/sparc/shared/pci/gr_rasta_tmtc.c
index f615958..b243259 100644
--- a/bsps/sparc/shared/pci/gr_rasta_tmtc.c
+++ b/bsps/sparc/shared/pci/gr_rasta_tmtc.c
@@ -15,6 +15,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -601,8 +602,10 @@ int gr_rasta_tmtc_init1(struct drvmgr_dev *dev)
 		PCI_DEV_EXPAND(priv->pcidev));
 	printk(" PCI VENDOR: 0x%04x, DEVICE: 0x%04x\n",
 		devinfo->id.vendor, devinfo->id.device);
-	printk(" PCI BAR[0]: 0x%lx - 0x%lx\n", bar0, bar0 + bar0_size - 1);
-	printk(" PCI BAR[1]: 0x%lx - 0x%lx\n", bar1, bar1 + bar1_size - 1);
+	printk(" PCI BAR[0]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar0, bar0 + bar0_size - 1);
+	printk(" PCI BAR[1]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar1, bar1 + bar1_size - 1);
 	printk(" IRQ: %d\n\n\n", devinfo->irq);
 
 	/* all neccessary space assigned to GR-RASTA-IO target? */
@@ -854,8 +857,10 @@ void gr_rasta_tmtc_print_dev(struct drvmgr_dev *dev, int options)
 	bar1 = devinfo->resources[1].address;
 	bar1_size = devinfo->resources[1].size;
 
-	printf(" PCI BAR[0]: 0x%lx - 0x%lx\n", bar0, bar0 + bar0_size - 1);
-	printf(" PCI BAR[1]: 0x%lx - 0x%lx\n", bar1, bar1 + bar1_size - 1);
+	printf(" PCI BAR[0]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar0, bar0 + bar0_size - 1);
+	printf(" PCI BAR[1]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar1, bar1 + bar1_size - 1);
 	printf(" IRQ:             %d\n", devinfo->irq);
 	printf(" PCI REVISION:    %d\n", devinfo->rev);
 	printf(" FREQ:            %d Hz\n", priv->version->amba_freq_hz);
diff --git a/bsps/sparc/shared/pci/gr_tmtc_1553.c b/bsps/sparc/shared/pci/gr_tmtc_1553.c
index a8181b6..2a497fe 100644
--- a/bsps/sparc/shared/pci/gr_tmtc_1553.c
+++ b/bsps/sparc/shared/pci/gr_tmtc_1553.c
@@ -15,6 +15,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -326,7 +327,8 @@ int gr_tmtc_1553_init1(struct drvmgr_dev *dev)
 		PCI_DEV_EXPAND(priv->pcidev));
 	printk(" PCI VENDOR: 0x%04x, DEVICE: 0x%04x\n",
 		devinfo->id.vendor, devinfo->id.device);
-	printk(" PCI BAR[0]: 0x%lx - 0x%lx\n", bar0, bar0 + bar0_size - 1);
+	printk(" PCI BAR[0]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar0, bar0 + bar0_size - 1);
 	printk(" IRQ: %d\n\n\n", devinfo->irq);
 
 	/* all neccessary space assigned to GR-TMTC-1553 target? */
@@ -556,8 +558,9 @@ void gr_tmtc_1553_print_dev(struct drvmgr_dev *dev, int options)
 	bar0 = devinfo->resources[0].address;
 	bar0_size = devinfo->resources[0].size;
 
-	printf(" PCI BAR[0]: 0x%lx - 0x%lx\n", bar0, bar0 + bar0_size - 1);
-	printf(" IRQ REGS:        0x%x\n", (unsigned int)priv->irq);
+	printf(" PCI BAR[0]: 0x%" PRIx32 " - 0x%" PRIx32 "\n",
+		bar0, bar0 + bar0_size - 1);
+	printf(" IRQ REGS:        0x%" PRIxPTR "\n", (uintptr_t)priv->irq);
 	printf(" IRQ:             %d\n", devinfo->irq);
 	printf(" FREQ:            %d Hz\n", priv->version->amba_freq_hz);
 	printf(" IMASK:           0x%08x\n", priv->irq->mask[0]);




More information about the vc mailing list