aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ni52.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2008-03-19 05:43:49 -0400
committerJeff Garzik <jeff@garzik.org>2008-03-26 00:18:00 -0400
commitde5971462fe27885290d8c95d9446a8b6d012448 (patch)
treeea82ddb101d79d7d9cc8881d4adc6582143ee0f9 /drivers/net/ni52.c
parent725aa4a9abc5d391ce36387e01c5b3c90a9f5516 (diff)
ni52: kill the second argument of check586(), get rid of bogus pointer
Passing ISA bus address explicitly cast to char * only to cast it back to unsigned long is dumb; so's passing it at all when it's always dev->mem_start... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ni52.c')
-rw-r--r--drivers/net/ni52.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/ni52.c b/drivers/net/ni52.c
index 10beb18b630d..71ce4f276199 100644
--- a/drivers/net/ni52.c
+++ b/drivers/net/ni52.c
@@ -179,7 +179,7 @@ static void ni52_timeout(struct net_device *dev);
179 179
180/* helper-functions */ 180/* helper-functions */
181static int init586(struct net_device *dev); 181static int init586(struct net_device *dev);
182static int check586(struct net_device *dev, char *where, unsigned size); 182static int check586(struct net_device *dev, unsigned size);
183static void alloc586(struct net_device *dev); 183static void alloc586(struct net_device *dev);
184static void startrecv586(struct net_device *dev); 184static void startrecv586(struct net_device *dev);
185static void __iomem *alloc_rfa(struct net_device *dev, void __iomem *ptr); 185static void __iomem *alloc_rfa(struct net_device *dev, void __iomem *ptr);
@@ -296,16 +296,16 @@ static int ni52_open(struct net_device *dev)
296/********************************************** 296/**********************************************
297 * Check to see if there's an 82586 out there. 297 * Check to see if there's an 82586 out there.
298 */ 298 */
299static int check586(struct net_device *dev, char *where, unsigned size) 299static int check586(struct net_device *dev, unsigned size)
300{ 300{
301 unsigned long where = dev->mem_start;
301 struct priv pb; 302 struct priv pb;
302 struct priv *p = /* (struct priv *) dev->priv*/ &pb; 303 struct priv *p = /* (struct priv *) dev->priv*/ &pb;
303 char __iomem *iscp_addrs[2]; 304 char __iomem *iscp_addrs[2];
304 int i; 305 int i;
305 306
306 p->base = (unsigned long) isa_bus_to_virt((unsigned long)where) 307 p->base = (unsigned long) isa_bus_to_virt(where) + size - 0x01000000;
307 + size - 0x01000000; 308 p->memtop = (char __iomem *)isa_bus_to_virt(where) + size;
308 p->memtop = (char __iomem *)isa_bus_to_virt((unsigned long)where) + size;
309 p->scp = (struct scp_struct __iomem *)(p->base + SCP_DEFAULT_ADDRESS); 309 p->scp = (struct scp_struct __iomem *)(p->base + SCP_DEFAULT_ADDRESS);
310 memset_io(p->scp, 0, sizeof(struct scp_struct)); 310 memset_io(p->scp, 0, sizeof(struct scp_struct));
311 for (i = 0; i < sizeof(struct scp_struct); i++) 311 for (i = 0; i < sizeof(struct scp_struct); i++)
@@ -316,7 +316,7 @@ static int check586(struct net_device *dev, char *where, unsigned size)
316 if (readb(&p->scp->sysbus) != SYSBUSVAL) 316 if (readb(&p->scp->sysbus) != SYSBUSVAL)
317 return 0; 317 return 0;
318 318
319 iscp_addrs[0] = (char __iomem *)isa_bus_to_virt((unsigned long)where); 319 iscp_addrs[0] = (char __iomem *)isa_bus_to_virt(where);
320 iscp_addrs[1] = (char __iomem *)p->scp - sizeof(struct iscp_struct); 320 iscp_addrs[1] = (char __iomem *)p->scp - sizeof(struct iscp_struct);
321 321
322 for (i = 0; i < 2; i++) { 322 for (i = 0; i < 2; i++) {
@@ -474,7 +474,7 @@ static int __init ni52_probe1(struct net_device *dev, int ioaddr)
474 retval = -ENODEV; 474 retval = -ENODEV;
475 goto out; 475 goto out;
476 } 476 }
477 if (!check586(dev, (char *)dev->mem_start, size)) { 477 if (!check586(dev, size)) {
478 printk(KERN_ERR "?memcheck, Can't find memory at 0x%lx with size %d!\n", dev->mem_start, size); 478 printk(KERN_ERR "?memcheck, Can't find memory at 0x%lx with size %d!\n", dev->mem_start, size);
479 retval = -ENODEV; 479 retval = -ENODEV;
480 goto out; 480 goto out;
@@ -483,9 +483,9 @@ static int __init ni52_probe1(struct net_device *dev, int ioaddr)
483 if (dev->mem_start != 0) { 483 if (dev->mem_start != 0) {
484 /* no auto-mem-probe */ 484 /* no auto-mem-probe */
485 size = 0x4000; /* check for 16K mem */ 485 size = 0x4000; /* check for 16K mem */
486 if (!check586(dev, (char *) dev->mem_start, size)) { 486 if (!check586(dev, size)) {
487 size = 0x2000; /* check for 8K mem */ 487 size = 0x2000; /* check for 8K mem */
488 if (!check586(dev, (char *)dev->mem_start, size)) { 488 if (!check586(dev, size)) {
489 printk(KERN_ERR "?memprobe, Can't find memory at 0x%lx!\n", dev->mem_start); 489 printk(KERN_ERR "?memprobe, Can't find memory at 0x%lx!\n", dev->mem_start);
490 retval = -ENODEV; 490 retval = -ENODEV;
491 goto out; 491 goto out;
@@ -504,11 +504,11 @@ static int __init ni52_probe1(struct net_device *dev, int ioaddr)
504 } 504 }
505 dev->mem_start = memaddrs[i]; 505 dev->mem_start = memaddrs[i];
506 size = 0x2000; /* check for 8K mem */ 506 size = 0x2000; /* check for 8K mem */
507 if (check586(dev, (char *)dev->mem_start, size)) 507 if (check586(dev, size))
508 /* 8K-check */ 508 /* 8K-check */
509 break; 509 break;
510 size = 0x4000; /* check for 16K mem */ 510 size = 0x4000; /* check for 16K mem */
511 if (check586(dev, (char *)dev->mem_start, size)) 511 if (check586(dev, size))
512 /* 16K-check */ 512 /* 16K-check */
513 break; 513 break;
514 } 514 }