[1/1] netdev: DM9000: Added typecasting to supress some warnings on Blackfin

Submitted by Bryan Wu on Oct. 13, 2008, 9:10 a.m.

Details

Message ID 1223889009-31336-1-git-send-email-cooloney@kernel.org
State Rejected
Delegated to: David Miller
Headers show

Commit Message

Bryan Wu Oct. 13, 2008, 9:10 a.m.
From: Javier Herrero <jherrero@hvsistemas.es>

Signed-off-by: Javier Herrero <jherrero@hvsistemas.es>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
---
 drivers/net/dm9000.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

Comments

Ben Dooks Oct. 13, 2008, 9:17 a.m.
On Mon, Oct 13, 2008 at 05:10:09PM +0800, Bryan Wu wrote:
> From: Javier Herrero <jherrero@hvsistemas.es>

No, your arch definitions of writesb and co are wrong if they
are not taking 'void __iomem *' arguments.
 
> Signed-off-by: Javier Herrero <jherrero@hvsistemas.es>
> Signed-off-by: Bryan Wu <cooloney@kernel.org>
> ---
>  drivers/net/dm9000.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
> index f42c23f..c4737ca 100644
> --- a/drivers/net/dm9000.c
> +++ b/drivers/net/dm9000.c
> @@ -188,35 +188,35 @@ iow(board_info_t * db, int reg, int value)
>  
>  static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count)
>  {
> -	writesb(reg, data, count);
> +	writesb((int)reg, data, count);
>  }
>  
>  static void dm9000_outblk_16bit(void __iomem *reg, void *data, int count)
>  {
> -	writesw(reg, data, (count+1) >> 1);
> +	writesw((int)reg, data, (count+1) >> 1);
>  }
>  
>  static void dm9000_outblk_32bit(void __iomem *reg, void *data, int count)
>  {
> -	writesl(reg, data, (count+3) >> 2);
> +	writesl((int)reg, data, (count+3) >> 2);
>  }
>  
>  /* input block from chip to memory */
>  
>  static void dm9000_inblk_8bit(void __iomem *reg, void *data, int count)
>  {
> -	readsb(reg, data, count);
> +	readsb((int)reg, data, count);
>  }
>  
>  
>  static void dm9000_inblk_16bit(void __iomem *reg, void *data, int count)
>  {
> -	readsw(reg, data, (count+1) >> 1);
> +	readsw((int)reg, data, (count+1) >> 1);
>  }
>  
>  static void dm9000_inblk_32bit(void __iomem *reg, void *data, int count)
>  {
> -	readsl(reg, data, (count+3) >> 2);
> +	readsl((int)reg, data, (count+3) >> 2);
>  }
>  
>  /* dump block from chip to null */
> -- 
> 1.5.6
Bryan Wu Oct. 13, 2008, 9:51 a.m.
On Mon, Oct 13, 2008 at 5:17 PM, Ben Dooks <ben-linux@fluff.org> wrote:
> On Mon, Oct 13, 2008 at 05:10:09PM +0800, Bryan Wu wrote:
>> From: Javier Herrero <jherrero@hvsistemas.es>
>
> No, your arch definitions of writesb and co are wrong if they
> are not taking 'void __iomem *' arguments.
>

Right, we should check the I/O functions and make them support "void
__iomem *" arguments.

Thanks
-Bryan

>> Signed-off-by: Javier Herrero <jherrero@hvsistemas.es>
>> Signed-off-by: Bryan Wu <cooloney@kernel.org>
>> ---
>>  drivers/net/dm9000.c |   12 ++++++------
>>  1 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
>> index f42c23f..c4737ca 100644
>> --- a/drivers/net/dm9000.c
>> +++ b/drivers/net/dm9000.c
>> @@ -188,35 +188,35 @@ iow(board_info_t * db, int reg, int value)
>>
>>  static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count)
>>  {
>> -     writesb(reg, data, count);
>> +     writesb((int)reg, data, count);
>>  }
>>
>>  static void dm9000_outblk_16bit(void __iomem *reg, void *data, int count)
>>  {
>> -     writesw(reg, data, (count+1) >> 1);
>> +     writesw((int)reg, data, (count+1) >> 1);
>>  }
>>
>>  static void dm9000_outblk_32bit(void __iomem *reg, void *data, int count)
>>  {
>> -     writesl(reg, data, (count+3) >> 2);
>> +     writesl((int)reg, data, (count+3) >> 2);
>>  }
>>
>>  /* input block from chip to memory */
>>
>>  static void dm9000_inblk_8bit(void __iomem *reg, void *data, int count)
>>  {
>> -     readsb(reg, data, count);
>> +     readsb((int)reg, data, count);
>>  }
>>
>>
>>  static void dm9000_inblk_16bit(void __iomem *reg, void *data, int count)
>>  {
>> -     readsw(reg, data, (count+1) >> 1);
>> +     readsw((int)reg, data, (count+1) >> 1);
>>  }
>>
>>  static void dm9000_inblk_32bit(void __iomem *reg, void *data, int count)
>>  {
>> -     readsl(reg, data, (count+3) >> 2);
>> +     readsl((int)reg, data, (count+3) >> 2);
>>  }
>>
>>  /* dump block from chip to null */
>> --
>> 1.5.6
>
> --
> --
> Ben
>
> Q:      What's a light-year?
> A:      One-third less calories than a regular year.
>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Oct. 13, 2008, 10:01 a.m.
From: Bryan Wu <cooloney@kernel.org>
Date: Mon, 13 Oct 2008 17:10:09 +0800

> From: Javier Herrero <jherrero@hvsistemas.es>
> 
> Signed-off-by: Javier Herrero <jherrero@hvsistemas.es>
> Signed-off-by: Bryan Wu <cooloney@kernel.org>

This is not only inelegant, it'll likely break things on
64-bit MIPS or any other case where the upper 32-bit matter.

I'd rather see Blackfin fix it's I/O accessor prototypes
to take a proper __iomem pointer.

This patch won't be applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mike Frysinger Oct. 13, 2008, 10:24 a.m.
On Mon, Oct 13, 2008 at 05:52, Bryan Wu wrote:
> On Mon, Oct 13, 2008 at 5:28 PM, Javier Herrero wrote:
>> So it seems that we must correct that in other place?
>
> Yes, we need to check the I/O read_write functions.

and drop the CONFIG_BLACKFIN hacks in the dm90000 driver ... we
rewrite the write* functions to out* ... probably because we dont
provide any write* functions in our headers
-mike
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bryan Wu Oct. 13, 2008, 10:27 a.m.
On Mon, Oct 13, 2008 at 6:24 PM, Mike Frysinger <vapier.adi@gmail.com> wrote:
> On Mon, Oct 13, 2008 at 05:52, Bryan Wu wrote:
>> On Mon, Oct 13, 2008 at 5:28 PM, Javier Herrero wrote:
>>> So it seems that we must correct that in other place?
>>
>> Yes, we need to check the I/O read_write functions.
>
> and drop the CONFIG_BLACKFIN hacks in the dm90000 driver ... we
> rewrite the write* functions to out* ... probably because we dont
> provide any write* functions in our headers
> -mike
>

No problem, I will take care of that.

-Bryan
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ben Dooks Oct. 13, 2008, 11:18 p.m.
On Mon, Oct 13, 2008 at 03:01:50AM -0700, David Miller wrote:
> From: Bryan Wu <cooloney@kernel.org>
> Date: Mon, 13 Oct 2008 17:10:09 +0800
> 
> > From: Javier Herrero <jherrero@hvsistemas.es>
> > 
> > Signed-off-by: Javier Herrero <jherrero@hvsistemas.es>
> > Signed-off-by: Bryan Wu <cooloney@kernel.org>
> 
> This is not only inelegant, it'll likely break things on
> 64-bit MIPS or any other case where the upper 32-bit matter.
> 
> I'd rather see Blackfin fix it's I/O accessor prototypes
> to take a proper __iomem pointer.

How much would it hurt to provide blackfin wide
readsb and friends with the correct prototype and
remove the nasty blackfin hack in the dm9000.c driver
for good?

Patch hide | download patch | download mbox

diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index f42c23f..c4737ca 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -188,35 +188,35 @@  iow(board_info_t * db, int reg, int value)
 
 static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count)
 {
-	writesb(reg, data, count);
+	writesb((int)reg, data, count);
 }
 
 static void dm9000_outblk_16bit(void __iomem *reg, void *data, int count)
 {
-	writesw(reg, data, (count+1) >> 1);
+	writesw((int)reg, data, (count+1) >> 1);
 }
 
 static void dm9000_outblk_32bit(void __iomem *reg, void *data, int count)
 {
-	writesl(reg, data, (count+3) >> 2);
+	writesl((int)reg, data, (count+3) >> 2);
 }
 
 /* input block from chip to memory */
 
 static void dm9000_inblk_8bit(void __iomem *reg, void *data, int count)
 {
-	readsb(reg, data, count);
+	readsb((int)reg, data, count);
 }
 
 
 static void dm9000_inblk_16bit(void __iomem *reg, void *data, int count)
 {
-	readsw(reg, data, (count+1) >> 1);
+	readsw((int)reg, data, (count+1) >> 1);
 }
 
 static void dm9000_inblk_32bit(void __iomem *reg, void *data, int count)
 {
-	readsl(reg, data, (count+3) >> 2);
+	readsl((int)reg, data, (count+3) >> 2);
 }
 
 /* dump block from chip to null */