public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pm80xx: Fix for 32 bit compilation issue.
@ 2013-08-07  7:51 Anand
  2013-08-07 12:14 ` Tomas Henzl
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Anand @ 2013-08-07  7:51 UTC (permalink / raw)
  To: linux-scsi
  Cc: Sangeetha.Gnanasekaran, xjtuwjp, Rich.Bono, Nikith.Ganigarakoppal

>From cc606631fae60a38ab9532bab79fd93523f4c579 Mon Sep 17 00:00:00 2001
From: Anand Kumar Santhanam <AnandKumar.Santhanam@pmcs.com>
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: Anandkumar.Santhanam@pmcs.com

---
 drivers/scsi/pm8001/pm8001_init.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index e4b9bc7..584d04e 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -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;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] pm80xx: Fix for 32 bit compilation issue.
  2013-08-07  7:51 [PATCH] pm80xx: Fix for 32 bit compilation issue Anand
@ 2013-08-07 12:14 ` Tomas Henzl
  2013-08-07 17:22 ` Randy Dunlap
  2013-08-07 18:05 ` James Bottomley
  2 siblings, 0 replies; 5+ messages in thread
From: Tomas Henzl @ 2013-08-07 12:14 UTC (permalink / raw)
  To: Anand
  Cc: linux-scsi, Sangeetha.Gnanasekaran, xjtuwjp, Rich.Bono,
	Nikith.Ganigarakoppal

On 08/07/2013 09:51 AM, Anand wrote:
> From cc606631fae60a38ab9532bab79fd93523f4c579 Mon Sep 17 00:00:00 2001
> From: Anand Kumar Santhanam <AnandKumar.Santhanam@pmcs.com>
> 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: Anandkumar.Santhanam@pmcs.com
>
> ---
>  drivers/scsi/pm8001/pm8001_init.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
> index e4b9bc7..584d04e 100644
> --- a/drivers/scsi/pm8001/pm8001_init.c
> +++ b/drivers/scsi/pm8001/pm8001_init.c
> @@ -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 

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] pm80xx: Fix for 32 bit compilation issue.
  2013-08-07  7:51 [PATCH] pm80xx: Fix for 32 bit compilation issue Anand
  2013-08-07 12:14 ` Tomas Henzl
@ 2013-08-07 17:22 ` Randy Dunlap
  2013-08-07 18:05 ` James Bottomley
  2 siblings, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2013-08-07 17:22 UTC (permalink / raw)
  To: Anand
  Cc: linux-scsi, Sangeetha.Gnanasekaran, xjtuwjp, Rich.Bono,
	Nikith.Ganigarakoppal

On 08/07/13 00:51, Anand wrote:
> From cc606631fae60a38ab9532bab79fd93523f4c579 Mon Sep 17 00:00:00 2001
> From: Anand Kumar Santhanam <AnandKumar.Santhanam@pmcs.com>
> 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: Anandkumar.Santhanam@pmcs.com
> 
> ---
>  drivers/scsi/pm8001/pm8001_init.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
> index e4b9bc7..584d04e 100644
> --- a/drivers/scsi/pm8001/pm8001_init.c
> +++ b/drivers/scsi/pm8001/pm8001_init.c
> @@ -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?

>  				(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;
> 


-- 
~Randy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] pm80xx: Fix for 32 bit compilation issue.
  2013-08-07  7:51 [PATCH] pm80xx: Fix for 32 bit compilation issue Anand
  2013-08-07 12:14 ` Tomas Henzl
  2013-08-07 17:22 ` Randy Dunlap
@ 2013-08-07 18:05 ` James Bottomley
  2013-08-09  7:22   ` Anand Kumar Santhanam
  2 siblings, 1 reply; 5+ messages in thread
From: James Bottomley @ 2013-08-07 18:05 UTC (permalink / raw)
  To: Anand
  Cc: linux-scsi, Sangeetha.Gnanasekaran, xjtuwjp, Rich.Bono,
	Nikith.Ganigarakoppal

On Wed, 2013-08-07 at 00:51 -0700, Anand wrote:
> >From cc606631fae60a38ab9532bab79fd93523f4c579 Mon Sep 17 00:00:00 2001
> From: Anand Kumar Santhanam <AnandKumar.Santhanam@pmcs.com>
> 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

---

diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index 3861aa1..4ba8f4d 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -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;



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH] pm80xx: Fix for 32 bit compilation issue.
  2013-08-07 18:05 ` James Bottomley
@ 2013-08-09  7:22   ` Anand Kumar Santhanam
  0 siblings, 0 replies; 5+ messages in thread
From: Anand Kumar Santhanam @ 2013-08-09  7:22 UTC (permalink / raw)
  To: James Bottomley
  Cc: linux-scsi, Sangeetha Gnanasekaran, xjtuwjp, Rich Bono,
	Nikith Ganigarakoppal

James,

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

Regards
Anand

-----Original Message-----
From: James Bottomley [mailto:James.Bottomley@HansenPartnership.com] 
Sent: Wednesday, August 07, 2013 11:35 PM
To: Anand Kumar Santhanam
Cc: linux-scsi@vger.kernel.org; Sangeetha Gnanasekaran;
xjtuwjp@gmail.com; Rich Bono; Nikith Ganigarakoppal
Subject: Re: [PATCH] pm80xx: Fix for 32 bit compilation issue.

On Wed, 2013-08-07 at 00:51 -0700, Anand wrote:
> >From cc606631fae60a38ab9532bab79fd93523f4c579 Mon Sep 17 00:00:00 
> >2001
> From: Anand Kumar Santhanam <AnandKumar.Santhanam@pmcs.com>
> 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

---

diff --git a/drivers/scsi/pm8001/pm8001_init.c
b/drivers/scsi/pm8001/pm8001_init.c
index 3861aa1..4ba8f4d 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -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;



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-08-09  7:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-07  7:51 [PATCH] pm80xx: Fix for 32 bit compilation issue Anand
2013-08-07 12:14 ` Tomas Henzl
2013-08-07 17:22 ` Randy Dunlap
2013-08-07 18:05 ` James Bottomley
2013-08-09  7:22   ` Anand Kumar Santhanam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox