Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Dec 2018 12:07:17 +0000 (UTC)
From:      Vincenzo Maffione <vmaffione@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r342650 - head/tests/sys/netmap
Message-ID:  <201812311207.wBVC7HwL098277@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: vmaffione
Date: Mon Dec 31 12:07:17 2018
New Revision: 342650
URL: https://svnweb.freebsd.org/changeset/base/342650

Log:
  netmap: fix warnings on unit tests
  
  Fix some printf() format string warnings raised for ctrl-api-test.c
  on some architectures.
  
  MFC after:	1 week
  Sponsored by:	Sunny Valley Networks

Modified:
  head/tests/sys/netmap/ctrl-api-test.c

Modified: head/tests/sys/netmap/ctrl-api-test.c
==============================================================================
--- head/tests/sys/netmap/ctrl-api-test.c	Mon Dec 31 11:17:58 2018	(r342649)
+++ head/tests/sys/netmap/ctrl-api-test.c	Mon Dec 31 12:07:17 2018	(r342650)
@@ -183,7 +183,7 @@ port_info_get(struct TestContext *ctx)
 		perror("ioctl(/dev/netmap, NIOCCTRL, PORT_INFO_GET)");
 		return ret;
 	}
-	printf("nr_memsize %lu\n", req.nr_memsize);
+	printf("nr_memsize %llu\n", (unsigned long long)req.nr_memsize);
 	printf("nr_tx_slots %u\n", req.nr_tx_slots);
 	printf("nr_rx_slots %u\n", req.nr_rx_slots);
 	printf("nr_tx_rings %u\n", req.nr_tx_rings);
@@ -216,8 +216,9 @@ port_register(struct TestContext *ctx)
 	int ret;
 
 	printf("Testing NETMAP_REQ_REGISTER(mode=%d,ringid=%d,"
-	       "flags=0x%lx) on '%s'\n",
-	       ctx->nr_mode, ctx->nr_ringid, ctx->nr_flags, ctx->ifname);
+	       "flags=0x%llx) on '%s'\n",
+	       ctx->nr_mode, ctx->nr_ringid, (unsigned long long)ctx->nr_flags,
+	       ctx->ifname);
 
 	nmreq_hdr_init(&hdr, ctx->ifname);
 	hdr.nr_reqtype = NETMAP_REQ_REGISTER;
@@ -238,8 +239,8 @@ port_register(struct TestContext *ctx)
 		perror("ioctl(/dev/netmap, NIOCCTRL, REGISTER)");
 		return ret;
 	}
-	printf("nr_offset 0x%lx\n", req.nr_offset);
-	printf("nr_memsize %lu\n", req.nr_memsize);
+	printf("nr_offset 0x%llx\n", (unsigned long long)req.nr_offset);
+	printf("nr_memsize %llu\n", (unsigned long long)req.nr_memsize);
 	printf("nr_tx_slots %u\n", req.nr_tx_slots);
 	printf("nr_rx_slots %u\n", req.nr_rx_slots);
 	printf("nr_tx_rings %u\n", req.nr_tx_rings);
@@ -687,15 +688,18 @@ pools_info_get(struct TestContext *ctx)
 		perror("ioctl(/dev/netmap, NIOCCTRL, POOLS_INFO_GET)");
 		return ret;
 	}
-	printf("nr_memsize %lu\n", req.nr_memsize);
+	printf("nr_memsize %llu\n", (unsigned long long)req.nr_memsize);
 	printf("nr_mem_id %u\n", req.nr_mem_id);
-	printf("nr_if_pool_offset 0x%lx\n", req.nr_if_pool_offset);
+	printf("nr_if_pool_offset 0x%llx\n",
+		(unsigned long long)req.nr_if_pool_offset);
 	printf("nr_if_pool_objtotal %u\n", req.nr_if_pool_objtotal);
 	printf("nr_if_pool_objsize %u\n", req.nr_if_pool_objsize);
-	printf("nr_ring_pool_offset 0x%lx\n", req.nr_if_pool_offset);
+	printf("nr_ring_pool_offset 0x%llx\n",
+		(unsigned long long)req.nr_if_pool_offset);
 	printf("nr_ring_pool_objtotal %u\n", req.nr_ring_pool_objtotal);
 	printf("nr_ring_pool_objsize %u\n", req.nr_ring_pool_objsize);
-	printf("nr_buf_pool_offset 0x%lx\n", req.nr_buf_pool_offset);
+	printf("nr_buf_pool_offset 0x%llx\n",
+		(unsigned long long)req.nr_buf_pool_offset);
 	printf("nr_buf_pool_objtotal %u\n", req.nr_buf_pool_objtotal);
 	printf("nr_buf_pool_objsize %u\n", req.nr_buf_pool_objsize);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812311207.wBVC7HwL098277>