Use (char *) on pointer arith.
This commit is contained in:
parent
cc37e30de1
commit
e8284b2c49
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: pxa2x0_i2s.c,v 1.3 2007/03/04 05:59:38 christos Exp $ */
|
/* $NetBSD: pxa2x0_i2s.c,v 1.4 2007/03/05 00:44:31 nonaka Exp $ */
|
||||||
/* $OpenBSD: pxa2x0_i2s.c,v 1.7 2006/04/04 11:45:40 pascoe Exp $ */
|
/* $OpenBSD: pxa2x0_i2s.c,v 1.7 2006/04/04 11:45:40 pascoe Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -18,7 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: pxa2x0_i2s.c,v 1.3 2007/03/04 05:59:38 christos Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: pxa2x0_i2s.c,v 1.4 2007/03/05 00:44:31 nonaka Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
@ -371,8 +371,8 @@ pxa2x0_i2s_start_output(void *hdl, void *block, int bsize,
|
|||||||
sc->sc_txarg = tx_arg;
|
sc->sc_txarg = tx_arg;
|
||||||
|
|
||||||
/* Find mapping which contains block completely */
|
/* Find mapping which contains block completely */
|
||||||
for (p = sc->sc_dmas; p && (((void *)block < p->addr) ||
|
for (p = sc->sc_dmas; p != NULL && (((char *)block < (char *)p->addr) ||
|
||||||
((void *)block + bsize > p->addr + p->size)); p = p->next)
|
((char *)block + bsize > (char *)p->addr + p->size)); p = p->next)
|
||||||
continue; /* Nothing */
|
continue; /* Nothing */
|
||||||
|
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
@ -383,7 +383,7 @@ pxa2x0_i2s_start_output(void *hdl, void *block, int bsize,
|
|||||||
sc->sc_txdma = p;
|
sc->sc_txdma = p;
|
||||||
|
|
||||||
p->segs[0].ds_addr = p->map->dm_segs[0].ds_addr
|
p->segs[0].ds_addr = p->map->dm_segs[0].ds_addr
|
||||||
+ ((void *)block - p->addr);
|
+ ((char *)block - (char *)p->addr);
|
||||||
p->segs[0].ds_len = bsize;
|
p->segs[0].ds_len = bsize;
|
||||||
|
|
||||||
dx = p->dx;
|
dx = p->dx;
|
||||||
@ -420,8 +420,8 @@ pxa2x0_i2s_start_input(void *hdl, void *block, int bsize,
|
|||||||
sc->sc_rxarg = rx_arg;
|
sc->sc_rxarg = rx_arg;
|
||||||
|
|
||||||
/* Find mapping which contains block completely */
|
/* Find mapping which contains block completely */
|
||||||
for (p = sc->sc_dmas; p != NULL && (((void *)block < p->addr) ||
|
for (p = sc->sc_dmas; p != NULL && (((char *)block < (char *)p->addr) ||
|
||||||
((void *)block + bsize > p->addr + p->size)); p = p->next)
|
((char *)block + bsize > (char *)p->addr + p->size)); p = p->next)
|
||||||
continue; /* Nothing */
|
continue; /* Nothing */
|
||||||
|
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
@ -432,7 +432,7 @@ pxa2x0_i2s_start_input(void *hdl, void *block, int bsize,
|
|||||||
|
|
||||||
sc->sc_rxdma = p;
|
sc->sc_rxdma = p;
|
||||||
p->segs[0].ds_addr = p->map->dm_segs[0].ds_addr
|
p->segs[0].ds_addr = p->map->dm_segs[0].ds_addr
|
||||||
+ ((void *)block - p->addr);
|
+ ((char *)block - (char *)p->addr);
|
||||||
p->segs[0].ds_len = bsize;
|
p->segs[0].ds_len = bsize;
|
||||||
|
|
||||||
dx = p->dx;
|
dx = p->dx;
|
||||||
|
Loading…
Reference in New Issue
Block a user