* [PATCH 1/1] netdev: DM9000: Added typecasting to supress some warnings on Blackfin
@ 2008-10-13 9:10 Bryan Wu
2008-10-13 9:17 ` Ben Dooks
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Bryan Wu @ 2008-10-13 9:10 UTC (permalink / raw)
To: ben, s.hauer; +Cc: jeff, netdev, linux-kernel, Javier Herrero, Bryan Wu
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(-)
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
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH 1/1] netdev: DM9000: Added typecasting to supress some warnings on Blackfin 2008-10-13 9:10 [PATCH 1/1] netdev: DM9000: Added typecasting to supress some warnings on Blackfin Bryan Wu @ 2008-10-13 9:17 ` Ben Dooks 2008-10-13 9:28 ` Javier Herrero 2008-10-13 9:51 ` Bryan Wu 2008-10-13 10:01 ` David Miller 2008-10-13 12:41 ` Stephen Hemminger 2 siblings, 2 replies; 11+ messages in thread From: Ben Dooks @ 2008-10-13 9:17 UTC (permalink / raw) To: Bryan Wu; +Cc: ben, s.hauer, jeff, netdev, linux-kernel, Javier Herrero 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 -- -- Ben Q: What's a light-year? A: One-third less calories than a regular year. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/1] netdev: DM9000: Added typecasting to supress some warnings on Blackfin 2008-10-13 9:17 ` Ben Dooks @ 2008-10-13 9:28 ` Javier Herrero 2008-10-13 9:52 ` Bryan Wu 2008-10-13 9:51 ` Bryan Wu 1 sibling, 1 reply; 11+ messages in thread From: Javier Herrero @ 2008-10-13 9:28 UTC (permalink / raw) Cc: Bryan Wu, jeff, netdev, linux-kernel Hi, Bryan, So it seems that we must correct that in other place? Regards, Javier Ben Dooks escribió: > 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 > -- ------------------------------------------------------------------------ Javier Herrero EMAIL: jherrero@hvsistemas.com HV Sistemas S.L. PHONE: +34 949 336 806 Los Charcones, 17A FAX: +34 949 336 792 19170 El Casar - Guadalajara - Spain WEB: http://www.hvsistemas.com ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/1] netdev: DM9000: Added typecasting to supress some warnings on Blackfin 2008-10-13 9:28 ` Javier Herrero @ 2008-10-13 9:52 ` Bryan Wu 2008-10-13 10:24 ` Mike Frysinger 0 siblings, 1 reply; 11+ messages in thread From: Bryan Wu @ 2008-10-13 9:52 UTC (permalink / raw) To: Javier Herrero; +Cc: jeff, netdev, linux-kernel On Mon, Oct 13, 2008 at 5:28 PM, Javier Herrero <jherrero@hvsistemas.es> wrote: > Hi, Bryan, > > So it seems that we must correct that in other place? > Yes, we need to check the I/O read_write functions. -Bryan > Regards, > > Javier > > Ben Dooks escribió: >> >> 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 >> > > -- > ------------------------------------------------------------------------ > Javier Herrero EMAIL: jherrero@hvsistemas.com > HV Sistemas S.L. PHONE: +34 949 336 806 > Los Charcones, 17A FAX: +34 949 336 792 > 19170 El Casar - Guadalajara - Spain WEB: http://www.hvsistemas.com > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/1] netdev: DM9000: Added typecasting to supress some warnings on Blackfin 2008-10-13 9:52 ` Bryan Wu @ 2008-10-13 10:24 ` Mike Frysinger 2008-10-13 10:27 ` Bryan Wu 0 siblings, 1 reply; 11+ messages in thread From: Mike Frysinger @ 2008-10-13 10:24 UTC (permalink / raw) To: Bryan Wu; +Cc: Javier Herrero, jeff, netdev, linux-kernel 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/1] netdev: DM9000: Added typecasting to supress some warnings on Blackfin 2008-10-13 10:24 ` Mike Frysinger @ 2008-10-13 10:27 ` Bryan Wu 0 siblings, 0 replies; 11+ messages in thread From: Bryan Wu @ 2008-10-13 10:27 UTC (permalink / raw) To: Mike Frysinger; +Cc: Javier Herrero, jeff, netdev, linux-kernel 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/1] netdev: DM9000: Added typecasting to supress some warnings on Blackfin 2008-10-13 9:17 ` Ben Dooks 2008-10-13 9:28 ` Javier Herrero @ 2008-10-13 9:51 ` Bryan Wu 1 sibling, 0 replies; 11+ messages in thread From: Bryan Wu @ 2008-10-13 9:51 UTC (permalink / raw) To: Ben Dooks; +Cc: ben, s.hauer, jeff, netdev, linux-kernel, Javier Herrero 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. > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/1] netdev: DM9000: Added typecasting to supress some warnings on Blackfin 2008-10-13 9:10 [PATCH 1/1] netdev: DM9000: Added typecasting to supress some warnings on Blackfin Bryan Wu 2008-10-13 9:17 ` Ben Dooks @ 2008-10-13 10:01 ` David Miller 2008-10-13 23:18 ` Ben Dooks 2008-10-13 12:41 ` Stephen Hemminger 2 siblings, 1 reply; 11+ messages in thread From: David Miller @ 2008-10-13 10:01 UTC (permalink / raw) To: cooloney; +Cc: ben, s.hauer, jeff, netdev, linux-kernel, jherrero 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. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/1] netdev: DM9000: Added typecasting to supress some warnings on Blackfin 2008-10-13 10:01 ` David Miller @ 2008-10-13 23:18 ` Ben Dooks 0 siblings, 0 replies; 11+ messages in thread From: Ben Dooks @ 2008-10-13 23:18 UTC (permalink / raw) To: David Miller; +Cc: cooloney, ben, s.hauer, jeff, netdev, linux-kernel, jherrero 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? -- Ben Q: What's a light-year? A: One-third less calories than a regular year. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/1] netdev: DM9000: Added typecasting to supress some warnings on Blackfin 2008-10-13 9:10 [PATCH 1/1] netdev: DM9000: Added typecasting to supress some warnings on Blackfin Bryan Wu 2008-10-13 9:17 ` Ben Dooks 2008-10-13 10:01 ` David Miller @ 2008-10-13 12:41 ` Stephen Hemminger 2008-10-14 8:50 ` Bryan Wu 2 siblings, 1 reply; 11+ messages in thread From: Stephen Hemminger @ 2008-10-13 12:41 UTC (permalink / raw) To: Bryan Wu; +Cc: ben, s.hauer, jeff, netdev, linux-kernel, Javier Herrero, Bryan Wu On Mon, 13 Oct 2008 17:10:09 +0800 Bryan Wu <cooloney@kernel.org> wrote: > 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(-) > > 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); > } You lose the sparse checking for misuse by doing this. Why not this instead? --- a/drivers/net/dm9000.c 2008-10-13 05:29:15.000000000 -0700 +++ b/drivers/net/dm9000.c 2008-10-13 05:40:13.000000000 -0700 @@ -47,14 +47,6 @@ #define CARDNAME "dm9000" #define DRV_VERSION "1.31" -#ifdef CONFIG_BLACKFIN -#define readsb insb -#define readsw insw -#define readsl insl -#define writesb outsb -#define writesw outsw -#define writesl outsl -#endif /* * Transmit timeout, default 5 seconds. @@ -185,7 +177,40 @@ iow(board_info_t * db, int reg, int valu } /* routines for sending block to chip */ +#ifdef CONFIG_BLACKFIN +static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count) +{ + outsb((unsigned long)reg, data, count); +} +static void dm9000_outblk_16bit(void __iomem *reg, void *data, int count) +{ + outsw((unsigned long)reg, data, (count+1) >> 1); +} + +static void dm9000_outblk_32bit(void __iomem *reg, void *data, int count) +{ + outsl((unsigned long)reg, data, (count+3) >> 2); +} + +/* input block from chip to memory */ + +static void dm9000_inblk_8bit(void __iomem *reg, void *data, int count) +{ + insb((unsigned long)reg, data, count); +} + + +static void dm9000_inblk_16bit(void __iomem *reg, void *data, int count) +{ + insw((unsigned long)reg, data, (count+1) >> 1); +} + +static void dm9000_inblk_32bit(void __iomem *reg, void *data, int count) +{ + insl((unsigned long)reg, data, (count+3) >> 2); +} +#else static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count) { writesb(reg, data, count); @@ -218,6 +243,7 @@ static void dm9000_inblk_32bit(void __io { readsl(reg, data, (count+3) >> 2); } +#endif /* dump block from chip to null */ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/1] netdev: DM9000: Added typecasting to supress some warnings on Blackfin 2008-10-13 12:41 ` Stephen Hemminger @ 2008-10-14 8:50 ` Bryan Wu 0 siblings, 0 replies; 11+ messages in thread From: Bryan Wu @ 2008-10-14 8:50 UTC (permalink / raw) To: Stephen Hemminger Cc: ben, s.hauer, jeff, netdev, linux-kernel, Javier Herrero On Mon, Oct 13, 2008 at 8:41 PM, Stephen Hemminger <shemminger@vyatta.com> wrote: > On Mon, 13 Oct 2008 17:10:09 +0800 > Bryan Wu <cooloney@kernel.org> wrote: > >> 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(-) >> >> 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); >> } > > You lose the sparse checking for misuse by doing this. > > Why not this instead? > > > --- a/drivers/net/dm9000.c 2008-10-13 05:29:15.000000000 -0700 > +++ b/drivers/net/dm9000.c 2008-10-13 05:40:13.000000000 -0700 > @@ -47,14 +47,6 @@ > #define CARDNAME "dm9000" > #define DRV_VERSION "1.31" > > -#ifdef CONFIG_BLACKFIN > -#define readsb insb > -#define readsw insw > -#define readsl insl > -#define writesb outsb > -#define writesw outsw > -#define writesl outsl > -#endif > > /* > * Transmit timeout, default 5 seconds. > @@ -185,7 +177,40 @@ iow(board_info_t * db, int reg, int valu > } > > /* routines for sending block to chip */ > +#ifdef CONFIG_BLACKFIN > +static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count) > +{ > + outsb((unsigned long)reg, data, count); > +} > I added readsl/writesl to blackfin arch, so we don't need to mess up the common DM9000 netdev driver here. -Bryan > +static void dm9000_outblk_16bit(void __iomem *reg, void *data, int count) > +{ > + outsw((unsigned long)reg, data, (count+1) >> 1); > +} > + > +static void dm9000_outblk_32bit(void __iomem *reg, void *data, int count) > +{ > + outsl((unsigned long)reg, data, (count+3) >> 2); > +} > + > +/* input block from chip to memory */ > + > +static void dm9000_inblk_8bit(void __iomem *reg, void *data, int count) > +{ > + insb((unsigned long)reg, data, count); > +} > + > + > +static void dm9000_inblk_16bit(void __iomem *reg, void *data, int count) > +{ > + insw((unsigned long)reg, data, (count+1) >> 1); > +} > + > +static void dm9000_inblk_32bit(void __iomem *reg, void *data, int count) > +{ > + insl((unsigned long)reg, data, (count+3) >> 2); > +} > +#else > static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count) > { > writesb(reg, data, count); > @@ -218,6 +243,7 @@ static void dm9000_inblk_32bit(void __io > { > readsl(reg, data, (count+3) >> 2); > } > +#endif > > /* dump block from chip to null */ > > -- > 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 > ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2008-10-14 8:50 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-10-13 9:10 [PATCH 1/1] netdev: DM9000: Added typecasting to supress some warnings on Blackfin Bryan Wu 2008-10-13 9:17 ` Ben Dooks 2008-10-13 9:28 ` Javier Herrero 2008-10-13 9:52 ` Bryan Wu 2008-10-13 10:24 ` Mike Frysinger 2008-10-13 10:27 ` Bryan Wu 2008-10-13 9:51 ` Bryan Wu 2008-10-13 10:01 ` David Miller 2008-10-13 23:18 ` Ben Dooks 2008-10-13 12:41 ` Stephen Hemminger 2008-10-14 8:50 ` Bryan Wu
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).