Skip to contentSkip to conversation

pm80xx: Fix for 32 bit compilation issue.

PATCH Superseded Anand 5 participants 5 messages Aug 7, 2013 – Aug 9, 2013

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Anand

author
#0 lore raw

PATCH 1/1 pm80xx: Fix for 32 bit compilation issue.

Quoted 1 line

From cc606631fae60a38ab9532bab79fd93523f4c579 Mon Sep 17 00:00:00 2001

From: Anand Kumar Santhanam <[email protected]>
Date: Mon, 5 Aug 2013 14:16:52 +0530
Subject: [PATCH] pm80xx: Fix for 32 bit compilation issue.

pm80xx driver does not compile under 32 bit linux. This patch fixes the same.

Signed-off-by [email protected]
---
 drivers/scsi/pm8001/pm8001_init.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/pm8001/pm8001_init.c +3 -2
index e4b9bc7..584d04e 100644
@@ -422,9 +422,10 @@ static int pm8001_ioremap(struct pm8001_hba_info *pm8001_ha)
 				pm8001_printk("PCI: bar %d, logicalBar %d ",
 				bar, logicalBar));
 			PM8001_INIT_DBG(pm8001_ha, pm8001_printk(
-				"base addr %llx virt_addr=%llx len=%d\n",
+				"base addr %llx virt_addr %p len=%d\n",
 				(u64)pm8001_ha->io_mem[logicalBar].membase,
-				(u64)pm8001_ha->io_mem[logicalBar].memvirtaddr,
+				(void __iomem *)
+				pm8001_ha->io_mem[logicalBar].memvirtaddr,
 				pm8001_ha->io_mem[logicalBar].memsize));
 		} else {
 			pm8001_ha->io_mem[logicalBar].membase	= 0;
Signature · 1 line
1.7.1
#1 lore raw
Quoted 19 lines · Anand

From cc606631fae60a38ab9532bab79fd93523f4c579 Mon Sep 17 00:00:00 2001
From: Anand Kumar Santhanam <[email protected]>
Date: Mon, 5 Aug 2013 14:16:52 +0530
Subject: [PATCH] pm80xx: Fix for 32 bit compilation issue.

pm80xx driver does not compile under 32 bit linux. This patch fixes the same.

Signed-off-by [email protected]
---
 drivers/scsi/pm8001/pm8001_init.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/pm8001/pm8001_init.c +0 -0
index e4b9bc7..584d04e 100644

drivers/scsi/pm8001/pm8001_init.c static int pm8001_ioremap(struct pm8001_hba_info *pm8001_ha) · line 427

Quoted 8 lines
drivers/scsi/pm8001/pm8001_init.c +2 -2
@@ -422,9 +422,10 @@ static int pm8001_ioremap(struct pm8001_hba_info *pm8001_ha)
 				pm8001_printk("PCI: bar %d, logicalBar %d ",
 				bar, logicalBar));
 			PM8001_INIT_DBG(pm8001_ha, pm8001_printk(
-				"base addr %llx virt_addr=%llx len=%d\n",
+				"base addr %llx virt_addr %p len=%d\n",
 				(u64)pm8001_ha->io_mem[logicalBar].membase,
-				(u64)pm8001_ha->io_mem[logicalBar].memvirtaddr,
+				(void __iomem *)

Hi Anand,
the memvirtaddr is of type 'void __iomem*' - is the explicit cast needed? Tomas

Quoted 4 lines
drivers/scsi/pm8001/pm8001_init.c +1 -0
+				pm8001_ha->io_mem[logicalBar].memvirtaddr,
 				pm8001_ha->io_mem[logicalBar].memsize));
 		} else {
 			pm8001_ha->io_mem[logicalBar].membase	= 0;
#2 lore raw
In reply to Anand
Quoted 19 lines · Anand

From cc606631fae60a38ab9532bab79fd93523f4c579 Mon Sep 17 00:00:00 2001
From: Anand Kumar Santhanam <[email protected]>
Date: Mon, 5 Aug 2013 14:16:52 +0530
Subject: [PATCH] pm80xx: Fix for 32 bit compilation issue.

pm80xx driver does not compile under 32 bit linux. This patch fixes the same.

Signed-off-by [email protected]
---
 drivers/scsi/pm8001/pm8001_init.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/pm8001/pm8001_init.c +0 -0
index e4b9bc7..584d04e 100644

drivers/scsi/pm8001/pm8001_init.c static int pm8001_ioremap(struct pm8001_hba_info *pm8001_ha) · line 425

Quoted 5 lines
drivers/scsi/pm8001/pm8001_init.c +1 -1
@@ -422,9 +422,10 @@ static int pm8001_ioremap(struct pm8001_hba_info *pm8001_ha)
 				pm8001_printk("PCI: bar %d, logicalBar %d ",
 				bar, logicalBar));
 			PM8001_INIT_DBG(pm8001_ha, pm8001_printk(
-				"base addr %llx virt_addr=%llx len=%d\n",
+				"base addr %llx virt_addr %p len=%d\n",

Why are you dropping the '=' sign?

Quoted 8 lines
drivers/scsi/pm8001/pm8001_init.c +2 -1
 				(u64)pm8001_ha->io_mem[logicalBar].membase,
-				(u64)pm8001_ha->io_mem[logicalBar].memvirtaddr,
+				(void __iomem *)
+				pm8001_ha->io_mem[logicalBar].memvirtaddr,
 				pm8001_ha->io_mem[logicalBar].memsize));
 		} else {
 			pm8001_ha->io_mem[logicalBar].membase	= 0;
Signature · 1 line
~Randy
maintainer
#3 lore raw
In reply to Anand
Quoted 7 lines · Anand
Quoted 1 line

From cc606631fae60a38ab9532bab79fd93523f4c579 Mon Sep 17 00:00:00 2001

From: Anand Kumar Santhanam <[email protected]>
Date: Mon, 5 Aug 2013 14:16:52 +0530
Subject: [PATCH] pm80xx: Fix for 32 bit compilation issue.

pm80xx driver does not compile under 32 bit linux. This patch fixes the same.

It doesn't? I see one warning:

drivers/scsi/pm8001/pm8001_init.c:424:4: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

Which is actually one of these annoying gcc isms, since casting a pointer to an unsigned long long for the purposes of printing is perfectly fine. The usual way of squashing this is the below.

James

---

drivers/scsi/pm8001/pm8001_init.c +1 -1
index 3861aa1..4ba8f4d 100644
@@ -424,7 +424,7 @@ static int pm8001_ioremap(struct pm8001_hba_info *pm8001_ha)
 			PM8001_INIT_DBG(pm8001_ha, pm8001_printk(
 				"base addr %llx virt_addr=%llx len=%d\n",
 				(u64)pm8001_ha->io_mem[logicalBar].membase,
-				(u64)pm8001_ha->io_mem[logicalBar].memvirtaddr,
+				(u64)(unsigned long)pm8001_ha->io_mem[logicalBar].memvirtaddr,
 				pm8001_ha->io_mem[logicalBar].memsize));
 		} else {
 			pm8001_ha->io_mem[logicalBar].membase	= 0;
#4 lore raw

James,

Thanks for the suggestion. This looks better. Will submit an updated patch.

Regards
Anand

-----Original Message-----
From: James Bottomley [mailto:[email protected]]
Sent: Wednesday, August 07, 2013 11:35 PM
To: Anand Kumar Santhanam
Cc: [email protected]; Sangeetha Gnanasekaran; [email protected]; Rich Bono; Nikith Ganigarakoppal
Subject: Re: [PATCH] pm80xx: Fix for 32 bit compilation issue.

Quoted 8 lines · Anand
Quoted 2 lines

From cc606631fae60a38ab9532bab79fd93523f4c579 Mon Sep 17 00:00:00 2001

From: Anand Kumar Santhanam <[email protected]>
Date: Mon, 5 Aug 2013 14:16:52 +0530
Subject: [PATCH] pm80xx: Fix for 32 bit compilation issue.

pm80xx driver does not compile under 32 bit linux. This patch fixes the same.

It doesn't? I see one warning:

drivers/scsi/pm8001/pm8001_init.c:424:4: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

Which is actually one of these annoying gcc isms, since casting a pointer to an unsigned long long for the purposes of printing is perfectly fine. The usual way of squashing this is the below.

James

---

(quoted diff) +0 -0

b/drivers/scsi/pm8001/pm8001_init.c
index 3861aa1..4ba8f4d 100644

drivers/scsi/pm8001/pm8001_init.c +0 -0
@@ -424,7 +424,7 @@ static int pm8001_ioremap(struct pm8001_hba_info

*pm8001_ha)
PM8001_INIT_DBG(pm8001_ha, pm8001_printk(
"base addr %llx virt_addr=%llx
len=%d\n",

(u64)pm8001_ha->io_mem[logicalBar].membase,
-
(u64)pm8001_ha->io_mem[logicalBar].memvirtaddr,
+ (u64)(unsigned
long)pm8001_ha->io_mem[logicalBar].memvirtaddr,
pm8001_ha->io_mem[logicalBar].memsize));
} else {
pm8001_ha->io_mem[logicalBar].membase = 0;