linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xsysace: use resource_size_t instead of unsigned long
@ 2008-11-13  8:43 Yuri Tikhonov
  2008-11-13 10:21 ` Stephen Rothwell
  0 siblings, 1 reply; 3+ messages in thread
From: Yuri Tikhonov @ 2008-11-13  8:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ilya Yanok, Wolfgang Denk, Detlev Zundel, linuxppc-dev

Hello,

This patch adds using resource_size_t for physical address of SystemACE
chip. This makes the driver workable on 32 bit systems with 64-bit resources
(e.g. PPC440SPe).

Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
Signed-off-by: Ilya Yanok <yanok@emcraft.com>
---
 drivers/block/xsysace.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index ecab9e6..f847305 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -194,7 +194,7 @@ struct ace_device {
 	int in_irq;
 
 	/* Details of hardware device */
-	unsigned long physaddr;
+	resource_size_t physaddr;
 	void __iomem *baseaddr;
 	int irq;
 	int bus_width;		/* 0 := 8 bit; 1 := 16 bit */
@@ -935,7 +935,7 @@ static int __devinit ace_setup(struct ace_device *ace)
 	int rc;
 
 	dev_dbg(ace->dev, "ace_setup(ace=0x%p)\n", ace);
-	dev_dbg(ace->dev, "physaddr=0x%lx irq=%i\n", ace->physaddr, ace->irq);
+	dev_dbg(ace->dev, "physaddr=0x%llx irq=%i\n", (u64)ace->physaddr, ace->irq);
 
 	spin_lock_init(&ace->lock);
 	init_completion(&ace->id_completion);
@@ -1017,8 +1017,8 @@ static int __devinit ace_setup(struct ace_device *ace)
 	/* Print the identification */
 	dev_info(ace->dev, "Xilinx SystemACE revision %i.%i.%i\n",
 		 (version >> 12) & 0xf, (version >> 8) & 0x0f, version & 0xff);
-	dev_dbg(ace->dev, "physaddr 0x%lx, mapped to 0x%p, irq=%i\n",
-		ace->physaddr, ace->baseaddr, ace->irq);
+	dev_dbg(ace->dev, "physaddr 0x%llx, mapped to 0x%p, irq=%i\n",
+		(u64)ace->physaddr, ace->baseaddr, ace->irq);
 
 	ace->media_change = 1;
 	ace_revalidate_disk(ace->gd);
@@ -1035,8 +1035,8 @@ err_alloc_disk:
 err_blk_initq:
 	iounmap(ace->baseaddr);
 err_ioremap:
-	dev_info(ace->dev, "xsysace: error initializing device at 0x%lx\n",
-	       ace->physaddr);
+	dev_info(ace->dev, "xsysace: error initializing device at 0x%llx\n",
+	       (u64)ace->physaddr);
 	return -ENOMEM;
 }
 
@@ -1059,7 +1059,7 @@ static void __devexit ace_teardown(struct ace_device *ace)
 }
 
 static int __devinit
-ace_alloc(struct device *dev, int id, unsigned long physaddr,
+ace_alloc(struct device *dev, int id, resource_size_t physaddr,
 	  int irq, int bus_width)
 {
 	struct ace_device *ace;
@@ -1119,7 +1119,7 @@ static void __devexit ace_free(struct device *dev)
 
 static int __devinit ace_probe(struct platform_device *dev)
 {
-	unsigned long physaddr = 0;
+	resource_size_t physaddr = 0;
 	int bus_width = ACE_BUS_WIDTH_16; /* FIXME: should not be hard coded */
 	int id = dev->id;
 	int irq = NO_IRQ;
@@ -1165,7 +1165,7 @@ static int __devinit
 ace_of_probe(struct of_device *op, const struct of_device_id *match)
 {
 	struct resource res;
-	unsigned long physaddr;
+	resource_size_t physaddr;
 	const u32 *id;
 	int irq, bus_width, rc;
 
-- 
1.5.6.1

-- 
Yuri Tikhonov, Senior Software Engineer
Emcraft Systems, www.emcraft.com

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

* Re: [PATCH] xsysace: use resource_size_t instead of unsigned long
  2008-11-13  8:43 [PATCH] xsysace: use resource_size_t instead of unsigned long Yuri Tikhonov
@ 2008-11-13 10:21 ` Stephen Rothwell
  2008-11-14  4:57   ` Re[2]: " Yuri Tikhonov
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2008-11-13 10:21 UTC (permalink / raw)
  To: Yuri Tikhonov
  Cc: Ilya Yanok, Detlev Zundel, Wolfgang, linux-kernel, linuxppc-dev,
	Denk

[-- Attachment #1: Type: text/plain, Size: 511 bytes --]

Hi Yuri,

On Thu, 13 Nov 2008 11:43:17 +0300 Yuri Tikhonov <yur@emcraft.com> wrote:
>
> -	dev_dbg(ace->dev, "physaddr=0x%lx irq=%i\n", ace->physaddr, ace->irq);
> +	dev_dbg(ace->dev, "physaddr=0x%llx irq=%i\n", (u64)ace->physaddr, ace->irq);

You should cast the physaddr to "unsigned long long" as "u64" is
"unsigned long" on some architectures.  The same is needed in other
places as well.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re[2]: [PATCH] xsysace: use resource_size_t instead of unsigned long
  2008-11-13 10:21 ` Stephen Rothwell
@ 2008-11-14  4:57   ` Yuri Tikhonov
  0 siblings, 0 replies; 3+ messages in thread
From: Yuri Tikhonov @ 2008-11-14  4:57 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: linuxppc-dev, Detlev Zundel, linux-kernel, Ilya Yanok,
	Wolfgang Denk

=0D=0AHello Stephen,

On Thursday, November 13, 2008 you wrote:

> Hi Yuri,

> On Thu, 13 Nov 2008 11:43:17 +0300 Yuri Tikhonov <yur@emcraft.com> wrote:
>>
>> -     dev_dbg(ace->dev, "physaddr=3D0x%lx irq=3D%i\n", ace->physaddr, ac=
e->irq);
>> +     dev_dbg(ace->dev, "physaddr=3D0x%llx irq=3D%i\n", (u64)ace->physad=
dr, ace->irq);

> You should cast the physaddr to "unsigned long long" as "u64" is
> "unsigned long" on some architectures.  The same is needed in other
> places as well.

 Thanks for your comment. We'll fix this.

 Regards, Yuri

 --
 Yuri Tikhonov, Senior Software Engineer
 Emcraft Systems, www.emcraft.com

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

end of thread, other threads:[~2008-11-14  4:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-13  8:43 [PATCH] xsysace: use resource_size_t instead of unsigned long Yuri Tikhonov
2008-11-13 10:21 ` Stephen Rothwell
2008-11-14  4:57   ` Re[2]: " Yuri Tikhonov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).