Use a local variable of the appropriate type, assign from argument,
and get rid of some casts as a bonus, following caddr_t removal.
This commit is contained in:
parent
2d94cf729d
commit
5d3a459b83
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_eh.c,v 1.11 2007/03/04 05:59:04 christos Exp $ */
|
||||
/* $NetBSD: if_eh.c,v 1.12 2007/03/05 15:55:19 he Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 Ben Harris
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_eh.c,v 1.11 2007/03/04 05:59:04 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_eh.c,v 1.12 2007/03/05 15:55:19 he Exp $");
|
||||
|
||||
#include <sys/systm.h>
|
||||
#include <sys/device.h>
|
||||
@ -527,24 +527,25 @@ eh_write_mbuf(struct dp8390_softc *dsc, struct mbuf *m, int buf)
|
||||
* ring-wrap.
|
||||
*/
|
||||
int
|
||||
eh_ring_copy(struct dp8390_softc *dsc, int src, void *dst, u_short amount)
|
||||
eh_ring_copy(struct dp8390_softc *dsc, int src, void *dst_arg, u_short amount)
|
||||
{
|
||||
struct eh_softc *sc = (struct eh_softc *)dsc;
|
||||
u_short tmp_amount;
|
||||
u_int8_t *dst = dst_arg;
|
||||
|
||||
/* Does copy wrap to lower addr in ring buffer? */
|
||||
if (src + amount > dsc->mem_end) {
|
||||
tmp_amount = dsc->mem_end - src;
|
||||
|
||||
/* Copy amount up to end of NIC memory. */
|
||||
eh_readmem(sc, src, (u_int8_t *)dst, tmp_amount);
|
||||
eh_readmem(sc, src, dst, tmp_amount);
|
||||
|
||||
amount -= tmp_amount;
|
||||
src = dsc->mem_ring;
|
||||
dst += tmp_amount;
|
||||
}
|
||||
|
||||
eh_readmem(sc, src, (u_int8_t *)dst, amount);
|
||||
eh_readmem(sc, src, dst, amount);
|
||||
|
||||
return (src + amount);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user