Patchwork [Open-FCoE] fcoeadm: Fix compilatoin warnings

login
register
mail settings
Submitter Robert Love
Date July 24, 2013, 9:13 p.m.
Message ID <20130724211337.1022.37312.stgit@fritz>
Download mbox | patch
Permalink /patch/72/
State Superseded
Headers show

Comments

Robert Love - July 24, 2013, 9:13 p.m.
Use PRIx64.

fcoeadm_display.c:1429:2: error: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'u_int64_t' [-Werror=format=]
  printf("        Fabric Name:      0x%016lx\n", fcf->fabric_name);
  ^
fcoeadm_display.c:1430:2: error: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'u_int64_t' [-Werror=format=]
  printf("        Switch Name       0x%016lx\n", fcf->switch_name);
---
 fcoeadm_display.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/fcoeadm_display.c b/fcoeadm_display.c
index 287e370..9b96aa7 100644
--- a/fcoeadm_display.c
+++ b/fcoeadm_display.c
@@ -1417,8 +1417,8 @@  static void print_fcoe_fcf_device(void *ep, UNUSED void *arg)
 	if (!buf)
 		buf = temp;
 	printf("        Connection Mode:  %s\n", buf);
-	printf("        Fabric Name:      0x%016lx\n", fcf->fabric_name);
-	printf("        Switch Name       0x%016lx\n", fcf->switch_name);
+	printf("        Fabric Name:      0x%016" PRIx64 "\n", fcf->fabric_name);
+	printf("        Switch Name       0x%016" PRIx64 "\n", fcf->switch_name);
 	mac2str(fcf->mac, mac, MAX_STR_LEN);
 	printf("        MAC Address:      %s\n", mac);
 	printf("        FCF Priority:     %u\n", fcf->priority);