diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/cs8900.c | 11 | ||||
-rw-r--r-- | drivers/net/dnet.c | 12 | ||||
-rw-r--r-- | drivers/net/lan91c96.c | 7 |
3 files changed, 12 insertions, 18 deletions
diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c index 9424fb2..e04a784 100644 --- a/drivers/net/cs8900.c +++ b/drivers/net/cs8900.c @@ -66,15 +66,14 @@ static u16 get_reg_init_bus(struct eth_device *dev, int regno) { /* force 16 bit busmode */ - volatile u8 c; struct cs8900_priv *priv = (struct cs8900_priv *)(dev->priv); uint8_t volatile * const iob = (uint8_t volatile * const)dev->iobase; - c = readb(iob); - c = readb(iob + 1); - c = readb(iob); - c = readb(iob + 1); - c = readb(iob); + readb(iob); + readb(iob + 1); + readb(iob); + readb(iob + 1); + readb(iob); REG_WRITE(regno, &priv->regs->pptr); return REG_READ(&priv->regs->pdata); diff --git a/drivers/net/dnet.c b/drivers/net/dnet.c index bfe87fa..15d0a6e 100644 --- a/drivers/net/dnet.c +++ b/drivers/net/dnet.c @@ -20,6 +20,7 @@ #include <miiphy.h> #include <asm/io.h> +#include <asm/unaligned.h> #include "dnet.h" @@ -133,15 +134,12 @@ static int dnet_send(struct eth_device *netdev, volatile void *packet, int length) { struct dnet_device *dnet = to_dnet(netdev); - int i, len, wrsz; + int i, wrsz; unsigned int *bufp; unsigned int tx_cmd; debug(DRIVERNAME "[%s] Sending %u bytes\n", __func__, length); - /* frame size (words) */ - len = (length + 3) >> 2; - bufp = (unsigned int *) (((u32)packet) & 0xFFFFFFFC); wrsz = (u32)length + 3; wrsz += ((u32)packet) & 0x3; @@ -206,11 +204,11 @@ static void dnet_set_hwaddr(struct eth_device *netdev) struct dnet_device *dnet = to_dnet(netdev); u16 tmp; - tmp = cpu_to_be16(*((u16 *)netdev->enetaddr)); + tmp = get_unaligned_be16(netdev->enetaddr); dnet_writew_mac(dnet, DNET_INTERNAL_MAC_ADDR_0_REG, tmp); - tmp = cpu_to_be16(*((u16 *)(netdev->enetaddr + 2))); + tmp = get_unaligned_be16(&netdev->enetaddr[2]); dnet_writew_mac(dnet, DNET_INTERNAL_MAC_ADDR_1_REG, tmp); - tmp = cpu_to_be16(*((u16 *)(netdev->enetaddr + 4))); + tmp = get_unaligned_be16(&netdev->enetaddr[4]); dnet_writew_mac(dnet, DNET_INTERNAL_MAC_ADDR_2_REG, tmp); } diff --git a/drivers/net/lan91c96.c b/drivers/net/lan91c96.c index 883f3a7..24b28da 100644 --- a/drivers/net/lan91c96.c +++ b/drivers/net/lan91c96.c @@ -63,6 +63,7 @@ #include <malloc.h> #include "lan91c96.h" #include <net.h> +#include <linux/compiler.h> /*------------------------------------------------------------------------ * @@ -154,7 +155,7 @@ static void smc_set_mac_addr(const unsigned char *addr) ***********************************************/ void dump_memory_info(struct eth_device *dev) { - word mem_info; + __maybe_unused word mem_info; word old_bank; old_bank = SMC_inw(dev, LAN91C96_BANK_SELECT) & 0xF; @@ -317,7 +318,6 @@ static int smc_send_packet(struct eth_device *dev, volatile void *packet, int packet_length) { byte packet_no; - unsigned long ioaddr; byte *buf; int length; int numPages; @@ -381,9 +381,6 @@ static int smc_send_packet(struct eth_device *dev, volatile void *packet, dev->name, try); /* I can send the packet now.. */ - - ioaddr = dev->iobase; - buf = (byte *) packet; /* If I get here, I _know_ there is a packet slot waiting for me */ |