[ewg] [PATCH 7/8 warnings] warnings in madeye on ppc64

Jeremy Brown jeremy.brown at qlogic.com
Fri Oct 5 16:47:59 PDT 2007


Tziporet, Vlad,

I've included the seventh of the eight warning fix patches.

Thanks!

Jeremy Brown

---

Fix some compiler warnings on powerpc

Not sure why the tid wasn't being byteswapped before being printed.
Assuming it wasn't intentional.

On powerpc, __be64 is %lx rather than the %llx in x86_64, so there's
no way to win without a cast.

Signed-off-by: John Gregor <john.gregor at qlogic.com>

diff -r 110ba412bd4a drivers/infiniband/util/madeye.c
--- a/drivers/infiniband/util/madeye.c	Thu May 10 22:55:49 2007 -0700
+++ b/drivers/infiniband/util/madeye.c	Thu May 10 22:58:51 2007 -0700
@@ -238,7 +238,8 @@ static void print_mad_hdr(struct ib_mad_
 	if (mad_hdr->status)
 		print_status_details(be16_to_cpu(mad_hdr->status));
 	printk("Class specific.0x%02x\n", be16_to_cpu(mad_hdr->class_specific));
-	printk("Trans ID.......0x%llx\n", mad_hdr->tid);
+	printk("Trans ID.......0x%llx\n", 
+		(unsigned long long)be64_to_cpu(mad_hdr->tid));
 	if (mad_hdr->mgmt_class == IB_MGMT_CLASS_SUBN_ADM)
 		printk("Attr ID........0x%02x (%s)\n",
 		       be16_to_cpu(mad_hdr->attr_id),
@@ -361,12 +362,14 @@ static void print_smp(struct ib_smp *smp
 		print_status_details(be16_to_cpu(smp->status));
 	printk("Hop pointer...0x%01x\n", smp->hop_ptr);
 	printk("Hop counter...0x%01x\n", smp->hop_cnt);
-	printk("Trans ID.......0x%llx\n", smp->tid);
+	printk("Trans ID.......0x%llx\n", 
+		(unsigned long long)be64_to_cpu(smp->tid));
 	printk("Attr ID........0x%02x (%s)\n", be16_to_cpu(smp->attr_id),
 		get_smp_attr(smp->attr_id));
 	printk("Attr modifier..0x%04x\n", be32_to_cpu(smp->attr_mod));
 
-	printk("Mkey...........0x%llx\n", be64_to_cpu(smp->mkey));
+	printk("Mkey...........0x%llx\n",
+		(unsigned long long)be64_to_cpu(smp->mkey));
 	printk("DR SLID........0x%02x\n", be16_to_cpu(smp->dr_slid));
 	printk("DR DLID........0x%02x", be16_to_cpu(smp->dr_dlid));
 





More information about the ewg mailing list