[1/5] bus/dpaa: fix compilation warnings with clang

Message ID 1516874011-8760-2-git-send-email-hemant.agrawal@nxp.com
State New
Headers show
Series
  • ARMv8: enable DPAA-X driver compilation
Related show

Commit Message

Hemant Agrawal Jan. 25, 2018, 9:53 a.m.
fman.c:570:15: error: format specifies type 'unsigned short' but the
argument has type 'int' [-Werror,-Wformat]  __FILE__, __LINE__, __func__,

fman/netcfg_layer.c:80:1: error: unused function 'get_num_netcfg_interfaces
' [-Werror,-Wunused-function] get_num_netcfg_interfaces(char *str)

Fixes: 5b22cf744689 ("bus/dpaa: introducing FMan configurations")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

---
 drivers/bus/dpaa/base/fman/fman.c         |  2 +-
 drivers/bus/dpaa/base/fman/netcfg_layer.c | 16 ----------------
 2 files changed, 1 insertion(+), 17 deletions(-)

-- 
2.7.4

Comments

Shreyansh Jain Jan. 30, 2018, 6:19 a.m. | #1
On Thursday 25 January 2018 03:23 PM, Hemant Agrawal wrote:
> fman.c:570:15: error: format specifies type 'unsigned short' but the

> argument has type 'int' [-Werror,-Wformat]  __FILE__, __LINE__, __func__,

> 

> fman/netcfg_layer.c:80:1: error: unused function 'get_num_netcfg_interfaces

> ' [-Werror,-Wunused-function] get_num_netcfg_interfaces(char *str)

> 

> Fixes: 5b22cf744689 ("bus/dpaa: introducing FMan configurations")

> Cc: stable@dpdk.org

> 

> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

> ---


Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>

Patch

diff --git a/drivers/bus/dpaa/base/fman/fman.c b/drivers/bus/dpaa/base/fman/fman.c
index 1dd1f91..bda62e0 100644
--- a/drivers/bus/dpaa/base/fman/fman.c
+++ b/drivers/bus/dpaa/base/fman/fman.c
@@ -566,7 +566,7 @@  fman_finish(void)
 		/* release the mapping */
 		_errno = munmap(__if->ccsr_map, __if->regs_size);
 		if (unlikely(_errno < 0))
-			fprintf(stderr, "%s:%hu:%s(): munmap() = %d (%s)\n",
+			fprintf(stderr, "%s:%d:%s(): munmap() = %d (%s)\n",
 				__FILE__, __LINE__, __func__,
 				-errno, strerror(errno));
 		printf("Tearing down %s\n", __if->node_path);
diff --git a/drivers/bus/dpaa/base/fman/netcfg_layer.c b/drivers/bus/dpaa/base/fman/netcfg_layer.c
index 24186c9..3e956ce 100644
--- a/drivers/bus/dpaa/base/fman/netcfg_layer.c
+++ b/drivers/bus/dpaa/base/fman/netcfg_layer.c
@@ -76,22 +76,6 @@  dump_netcfg(struct netcfg_info *cfg_ptr)
 }
 #endif /* RTE_LIBRTE_DPAA_DEBUG_DRIVER */
 
-static inline int
-get_num_netcfg_interfaces(char *str)
-{
-	char *pch;
-	uint8_t count = 0;
-
-	if (str == NULL)
-		return -EINVAL;
-	pch = strtok(str, ",");
-	while (pch != NULL) {
-		count++;
-		pch = strtok(NULL, ",");
-	}
-	return count;
-}
-
 struct netcfg_info *
 netcfg_acquire(void)
 {