Date: Sat, 16 Feb 2013 20:43:16 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246881 - head/sys/arm/arm Message-ID: <201302162043.r1GKhG1e030867@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ian Date: Sat Feb 16 20:43:16 2013 New Revision: 246881 URL: http://svnweb.freebsd.org/changeset/base/246881 Log: In _bus_dmamap_addseg(), the return value must be zero for error, or the size actually added to the segment (possibly smaller than the requested size if boundary crossings had to be avoided). Modified: head/sys/arm/arm/busdma_machdep-v6.c head/sys/arm/arm/busdma_machdep.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Sat Feb 16 20:17:31 2013 (r246880) +++ head/sys/arm/arm/busdma_machdep-v6.c Sat Feb 16 20:43:16 2013 (r246881) @@ -856,7 +856,7 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, b curaddr); if (dr == NULL) { _bus_dmamap_unload(dmat, map); - return (EINVAL); + return (0); } /* * In a valid DMA range. Translate the physical Modified: head/sys/arm/arm/busdma_machdep.c ============================================================================== --- head/sys/arm/arm/busdma_machdep.c Sat Feb 16 20:17:31 2013 (r246880) +++ head/sys/arm/arm/busdma_machdep.c Sat Feb 16 20:43:16 2013 (r246881) @@ -913,7 +913,7 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, b dr = _bus_dma_inrange(dmat->ranges, dmat->_nranges, curaddr); if (dr == NULL) - return (EINVAL); + return (0); /* * In a valid DMA range. Translate the physical * memory address to an address in the DMA window. @@ -935,12 +935,12 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, b segs[seg].ds_len += sgsize; } else { if (++seg >= dmat->nsegments) - return (EFBIG); + return (0); segs[seg].ds_addr = curaddr; segs[seg].ds_len = sgsize; } *segp = seg; - return (0); + return (sgsize); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302162043.r1GKhG1e030867>