Commit 4ec03116 authored by Al Viro's avatar Al Viro Committed by Linus Torvalds

[PATCH] kill eth_io_copy_and_sum()

On all targets that sucker boils down to memcpy_fromio(sbk->data, from, len).
The function name is highly misguiding (it _never_ does any checksums), the
last argument is just a noise and simply expanding the call to memcpy_fromio()
gives shorter and more readable source.  For a lot of reasons it has almost
no remaining users, so it's better to just outright kill it.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b81831c6
...@@ -600,8 +600,7 @@ el2_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring ...@@ -600,8 +600,7 @@ el2_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring
count -= semi_count; count -= semi_count;
memcpy_fromio(skb->data + semi_count, base + ei_status.priv, count); memcpy_fromio(skb->data + semi_count, base + ei_status.priv, count);
} else { } else {
/* Packet is in one chunk -- we can copy + cksum. */ memcpy_fromio(skb->data, base + ring_offset, count);
eth_io_copy_and_sum(skb, base + ring_offset, count, 0);
} }
return; return;
} }
......
...@@ -327,8 +327,7 @@ static void ac_block_input(struct net_device *dev, int count, struct sk_buff *sk ...@@ -327,8 +327,7 @@ static void ac_block_input(struct net_device *dev, int count, struct sk_buff *sk
memcpy_fromio(skb->data + semi_count, memcpy_fromio(skb->data + semi_count,
ei_status.mem + TX_PAGES*256, count); ei_status.mem + TX_PAGES*256, count);
} else { } else {
/* Packet is in one chunk -- we can copy + cksum. */ memcpy_fromio(skb->data, start, count);
eth_io_copy_and_sum(skb, start, count, 0);
} }
} }
......
...@@ -355,8 +355,7 @@ e21_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring ...@@ -355,8 +355,7 @@ e21_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring
mem_on(ioaddr, shared_mem, (ring_offset>>8)); mem_on(ioaddr, shared_mem, (ring_offset>>8));
/* Packet is always in one chunk -- we can copy + cksum. */ memcpy_fromio(skb->data, ei_status.mem + (ring_offset & 0xff), count);
eth_io_copy_and_sum(skb, ei_status.mem + (ring_offset & 0xff), count, 0);
mem_off(ioaddr); mem_off(ioaddr);
} }
......
...@@ -375,7 +375,7 @@ static void es_block_input(struct net_device *dev, int count, struct sk_buff *sk ...@@ -375,7 +375,7 @@ static void es_block_input(struct net_device *dev, int count, struct sk_buff *sk
memcpy_fromio(skb->data + semi_count, ei_status.mem, count); memcpy_fromio(skb->data + semi_count, ei_status.mem, count);
} else { } else {
/* Packet is in one chunk. */ /* Packet is in one chunk. */
eth_io_copy_and_sum(skb, xfer_start, count, 0); memcpy_fromio(skb->data, xfer_start, count);
} }
} }
......
...@@ -482,8 +482,7 @@ static void ultramca_block_input(struct net_device *dev, int count, struct sk_bu ...@@ -482,8 +482,7 @@ static void ultramca_block_input(struct net_device *dev, int count, struct sk_bu
count -= semi_count; count -= semi_count;
memcpy_fromio(skb->data + semi_count, ei_status.mem + TX_PAGES * 256, count); memcpy_fromio(skb->data + semi_count, ei_status.mem + TX_PAGES * 256, count);
} else { } else {
/* Packet is in one chunk -- we can copy + cksum. */ memcpy_fromio(skb->data, xfer_start, count);
eth_io_copy_and_sum(skb, xfer_start, count, 0);
} }
} }
......
...@@ -454,8 +454,7 @@ ultra_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ri ...@@ -454,8 +454,7 @@ ultra_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ri
count -= semi_count; count -= semi_count;
memcpy_fromio(skb->data + semi_count, ei_status.mem + TX_PAGES * 256, count); memcpy_fromio(skb->data + semi_count, ei_status.mem + TX_PAGES * 256, count);
} else { } else {
/* Packet is in one chunk -- we can copy + cksum. */ memcpy_fromio(skb->data, xfer_start, count);
eth_io_copy_and_sum(skb, xfer_start, count, 0);
} }
outb(0x00, dev->base_addr - ULTRA_NIC_OFFSET); /* Disable memory. */ outb(0x00, dev->base_addr - ULTRA_NIC_OFFSET); /* Disable memory. */
......
...@@ -395,8 +395,7 @@ static void ultra32_block_input(struct net_device *dev, ...@@ -395,8 +395,7 @@ static void ultra32_block_input(struct net_device *dev,
memcpy_fromio(skb->data + semi_count, ei_status.mem + TX_PAGES * 256, count); memcpy_fromio(skb->data + semi_count, ei_status.mem + TX_PAGES * 256, count);
} }
} else { } else {
/* Packet is in one chunk -- we can copy + cksum. */ memcpy_fromio(skb->data, xfer_start, count);
eth_io_copy_and_sum(skb, xfer_start, count, 0);
} }
} }
......
...@@ -433,7 +433,7 @@ wd_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_ ...@@ -433,7 +433,7 @@ wd_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_
memcpy_fromio(skb->data + semi_count, ei_status.mem + TX_PAGES * 256, count); memcpy_fromio(skb->data + semi_count, ei_status.mem + TX_PAGES * 256, count);
} else { } else {
/* Packet is in one chunk -- we can copy + cksum. */ /* Packet is in one chunk -- we can copy + cksum. */
eth_io_copy_and_sum(skb, xfer_start, count, 0); memcpy_fromio(skb->data, xfer_start, count);
} }
/* Turn off 16 bit access so that reboot works. ISA brain-damage */ /* Turn off 16 bit access so that reboot works. ISA brain-damage */
......
...@@ -524,15 +524,6 @@ extern void outsb (unsigned long port, const void *src, unsigned long count); ...@@ -524,15 +524,6 @@ extern void outsb (unsigned long port, const void *src, unsigned long count);
extern void outsw (unsigned long port, const void *src, unsigned long count); extern void outsw (unsigned long port, const void *src, unsigned long count);
extern void outsl (unsigned long port, const void *src, unsigned long count); extern void outsl (unsigned long port, const void *src, unsigned long count);
/*
* XXX - We don't have csum_partial_copy_fromio() yet, so we cheat here and
* just copy it. The net code will then do the checksum later. Presently
* only used by some shared memory 8390 Ethernet cards anyway.
*/
#define eth_io_copy_and_sum(skb,src,len,unused) \
memcpy_fromio((skb)->data,src,len)
/* /*
* The Alpha Jensen hardware for some rather strange reason puts * The Alpha Jensen hardware for some rather strange reason puts
* the RTC clock at 0x170 instead of 0x70. Probably due to some * the RTC clock at 0x170 instead of 0x70. Probably due to some
......
...@@ -238,9 +238,6 @@ __ixp4xx_readsl(const volatile void __iomem *bus_addr, u32 *vaddr, u32 count) ...@@ -238,9 +238,6 @@ __ixp4xx_readsl(const volatile void __iomem *bus_addr, u32 *vaddr, u32 count)
#define memcpy_fromio(a,c,l) _memcpy_fromio((a),(c),(l)) #define memcpy_fromio(a,c,l) _memcpy_fromio((a),(c),(l))
#define memcpy_toio(c,a,l) _memcpy_toio((c),(a),(l)) #define memcpy_toio(c,a,l) _memcpy_toio((c),(a),(l))
#define eth_io_copy_and_sum(s,c,l,b) \
eth_copy_and_sum((s),__mem_pci(c),(l),(b))
static inline int static inline int
check_signature(const unsigned char __iomem *bus_addr, const unsigned char *signature, check_signature(const unsigned char __iomem *bus_addr, const unsigned char *signature,
int length) int length)
......
...@@ -182,9 +182,6 @@ extern void _memset_io(volatile void __iomem *, int, size_t); ...@@ -182,9 +182,6 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
#define memcpy_fromio(a,c,l) _memcpy_fromio((a),__mem_pci(c),(l)) #define memcpy_fromio(a,c,l) _memcpy_fromio((a),__mem_pci(c),(l))
#define memcpy_toio(c,a,l) _memcpy_toio(__mem_pci(c),(a),(l)) #define memcpy_toio(c,a,l) _memcpy_toio(__mem_pci(c),(a),(l))
#define eth_io_copy_and_sum(s,c,l,b) \
eth_copy_and_sum((s),__mem_pci(c),(l),(b))
#elif !defined(readb) #elif !defined(readb)
#define readb(c) (__readwrite_bug("readb"),0) #define readb(c) (__readwrite_bug("readb"),0)
...@@ -194,8 +191,6 @@ extern void _memset_io(volatile void __iomem *, int, size_t); ...@@ -194,8 +191,6 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
#define writew(v,c) __readwrite_bug("writew") #define writew(v,c) __readwrite_bug("writew")
#define writel(v,c) __readwrite_bug("writel") #define writel(v,c) __readwrite_bug("writel")
#define eth_io_copy_and_sum(s,c,l,b) __readwrite_bug("eth_io_copy_and_sum")
#define check_signature(io,sig,len) (0) #define check_signature(io,sig,len) (0)
#endif /* __mem_pci */ #endif /* __mem_pci */
......
...@@ -121,11 +121,6 @@ static inline void writel(unsigned int b, volatile void __iomem *addr) ...@@ -121,11 +121,6 @@ static inline void writel(unsigned int b, volatile void __iomem *addr)
#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c)) #define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c)) #define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
/*
* Again, CRIS does not require mem IO specific function.
*/
#define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),(void __force *)(b),(c),(d))
/* The following is junk needed for the arch-independent code but which /* The following is junk needed for the arch-independent code but which
* we never use in the CRIS port * we never use in the CRIS port
......
...@@ -218,12 +218,6 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int ...@@ -218,12 +218,6 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int
*/ */
#define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET)) #define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET))
/*
* Again, i386 does not require mem IO specific function.
*/
#define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),(void __force *)(b),(c),(d))
/* /*
* Cache management * Cache management
* *
......
...@@ -555,12 +555,6 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *); ...@@ -555,12 +555,6 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
*/ */
#define __ISA_IO_base ((char *)(isa_slot_offset)) #define __ISA_IO_base ((char *)(isa_slot_offset))
/*
* We don't have csum_partial_copy_fromio() yet, so we cheat here and
* just copy it. The net code will then do the checksum later.
*/
#define eth_io_copy_and_sum(skb,src,len,unused) memcpy_fromio((skb)->data,(src),(len))
/* /*
* The caches on some architectures aren't dma-coherent and have need to * The caches on some architectures aren't dma-coherent and have need to
* handle this in software. There are three types of operations that * handle this in software. There are three types of operations that
......
...@@ -191,15 +191,6 @@ void memset_io(volatile void __iomem *addr, unsigned char val, int count); ...@@ -191,15 +191,6 @@ void memset_io(volatile void __iomem *addr, unsigned char val, int count);
void memcpy_fromio(void *dst, const volatile void __iomem *src, int count); void memcpy_fromio(void *dst, const volatile void __iomem *src, int count);
void memcpy_toio(volatile void __iomem *dst, const void *src, int count); void memcpy_toio(volatile void __iomem *dst, const void *src, int count);
/*
* XXX - We don't have csum_partial_copy_fromio() yet, so we cheat here and
* just copy it. The net code will then do the checksum later. Presently
* only used by some shared memory 8390 Ethernet cards anyway.
*/
#define eth_io_copy_and_sum(skb,src,len,unused) \
memcpy_fromio((skb)->data,(src),(len))
/* Port-space IO */ /* Port-space IO */
#define inb_p inb #define inb_p inb
......
...@@ -358,8 +358,6 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int ...@@ -358,8 +358,6 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int
} }
#endif #endif
#define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),(void __force *)(void __iomem *)(b),(c),(d))
/* /*
* Map in an area of physical address space, for accessing * Map in an area of physical address space, for accessing
* I/O devices etc. * I/O devices etc.
......
...@@ -248,12 +248,6 @@ void memset_io(volatile void __iomem *a, int b, size_t c); ...@@ -248,12 +248,6 @@ void memset_io(volatile void __iomem *a, int b, size_t c);
*/ */
#define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET)) #define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET))
/*
* Again, x86-64 does not require mem IO specific function.
*/
#define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),(void *)(b),(c),(d))
/* Nothing to do */ /* Nothing to do */
#define dma_cache_inv(_start,_size) do { } while (0) #define dma_cache_inv(_start,_size) do { } while (0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment