Skip to contentSkip to conversation

Elimiation of isa_read* functions.

KJ Daniel E. Wilson 2 participants 2 messages Mar 28, 2005 Kernel janitors

lore
Share & tools
lore
#0 lore raw

Hi,

This is my first attempt at cleaning up something so I decided to try something really simple.

The lance.c file is using the depreciated isa_readw and isa_readl functions.

Dan

diff -Nrc a/drivers/net/lance.c b/drivers/net/lance.c
*** a/drivers/net/lance.c 2005-03-27 19:14:39 -08:00
--- b/drivers/net/lance.c 2005-03-27 19:14:39 -08:00
***************
*** 472,491 ****
static int did_version; /* Already printed version info. */
unsigned long flags;
int err = -ENOMEM;

/* First we look for special cases.
Check for HP's on-board ethernet by looking for 'HP' in the BIOS. There are two HP versions, check the BIOS for the configuration port. This method provided by L. Julliard, [email protected]. */
! if (isa_readw(0x000f0102) == 0x5048) {
static const short ioaddr_table[] = { 0x300, 0x320, 0x340, 0x360};
! int hp_port = (isa_readl(0x000f00f1) & 1) ? 0x499 : 0x99;
/* We can have boards other than the built-in! Verify this is on-board. */ if ((inb(hp_port) & 0xc0) == 0x80
&& ioaddr_table[inb(hp_port) & 3] == ioaddr) hp_builtin = hp_port;
}
/* We also recognize the HP Vectra on-board here, but check below. */ hpJ2405A = (inb(ioaddr) == 0x08 && inb(ioaddr+1) == 0x00
&& inb(ioaddr+2) == 0x09);
--- 472,495 ----
static int did_version; /* Already printed version info. */
unsigned long flags;
int err = -ENOMEM;
+ char *base_addr; /* Base address in the BIOS. */

/* First we look for special cases.
Check for HP's on-board ethernet by looking for 'HP' in the BIOS. There are two HP versions, check the BIOS for the configuration port. This method provided by L. Julliard, [email protected]. */
! base_addr = ioremap(0x000f0000, 0x104);
! if (readw(base_addr + 0x102) == 0x5048) {
static const short ioaddr_table[] = { 0x300, 0x320, 0x340, 0x360};
! int hp_port = (readl(base_addr + 0xf1) & 1) ? 0x499 : 0x99;
/* We can have boards other than the built-in! Verify this is on-board. */ if ((inb(hp_port) & 0xc0) == 0x80
&& ioaddr_table[inb(hp_port) & 3] == ioaddr) hp_builtin = hp_port;
}
+ iounmap(base_addr);
+
/* We also recognize the HP Vectra on-board here, but check below. */ hpJ2405A = (inb(ioaddr) == 0x08 && inb(ioaddr+1) == 0x00
&& inb(ioaddr+2) == 0x09);

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw
Quoted 2 lines · Daniel E. Wilson

This is my first attempt at cleaning up something so I decided to try something really simple.

Welcome on board!

I wonder if there is an FAQ for kernel-janitors somewhere, it might be easier to point you there.

Quoted 3 lines

The lance.c file is using the depreciated isa_readw and isa_readl functions.

remap.patch

Unless your mail program is broken, submit patches inline instead of as attachments. The text should contain a Signed-off-by: line, see also linux/Documentation/SubmittingPatches.

Quoted 4 lines

diff -Nrc a/drivers/net/lance.c b/drivers/net/lance.c *** a/drivers/net/lance.c       2005-03-27 19:14:39 -08:00 --- b/drivers/net/lance.c       2005-03-27 19:14:39 -08:00
***************

You should always use the unified diff format (diff -u) for patches you submit. That's what everyone expects to read.

Quoted 5 lines

        static int did_version;                 /* Already printed version info. */ unsigned long flags;
        int err = -ENOMEM;
+       char *base_addr;                        /* Base address in the BIOS. */

This needs to be 'char __iomem *base_addr;', otherwise sparse will produce warnings for your code.

Thanks,

        Arnd <><

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors