From: Lionel Sambuc Date: Fri, 25 Sep 2015 19:22:27 +0000 (-0700) Subject: Fix noassert builds X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=refs%2Fchanges%2F98%2F3198%2F2;p=minix.git Fix noassert builds Change-Id: I5626950ffa29afe7a0fb9e9144839b311824da92 --- diff --git a/minix/lib/libminixfs/cache.c b/minix/lib/libminixfs/cache.c index 691ea1b65..e0e3f430c 100644 --- a/minix/lib/libminixfs/cache.c +++ b/minix/lib/libminixfs/cache.c @@ -223,11 +223,10 @@ int lmfs_get_block(struct buf **bpp, dev_t dev, block64_t block, int how) static void munmap_t(void *a, int len) { - vir_bytes av = (vir_bytes) a; assert(a); assert(a != MAP_FAILED); + assert(!((vir_bytes)a % PAGE_SIZE)); assert(len > 0); - assert(!(av % PAGE_SIZE)); len = roundup(len, PAGE_SIZE); @@ -850,10 +849,13 @@ static void rw_scattered( static iovec_t iovec[NR_IOREQS]; off_t pos; unsigned int i, iov_per_block; +#if !defined(NDEBUG) unsigned int start_in_use = bufs_in_use, start_bufqsize = bufqsize; +#endif /* !defined(NDEBUG) */ if(bufqsize == 0) return; +#if !defined(NDEBUG) /* for READING, check all buffers on the list are obtained and held * (count > 0) */ @@ -872,7 +874,8 @@ static void rw_scattered( assert(dev != NO_DEV); assert(fs_block_size > 0); assert(howmany(fs_block_size, PAGE_SIZE) <= NR_IOREQS); - +#endif /* !defined(NDEBUG) */ + /* For WRITING, (Shell) sort buffers on lmfs_blocknr. * For READING, the buffers are already sorted. */ @@ -966,12 +969,14 @@ static void rw_scattered( } } +#if !defined(NDEBUG) if(rw_flag == READING) { assert(start_in_use >= start_bufqsize); /* READING callers assume all bufs are released. */ assert(start_in_use - start_bufqsize == bufs_in_use); } +#endif /* !defined(NDEBUG) */ } /*===========================================================================* diff --git a/minix/servers/vfs/pipe.c b/minix/servers/vfs/pipe.c index 807bc070c..3cba587e2 100644 --- a/minix/servers/vfs/pipe.c +++ b/minix/servers/vfs/pipe.c @@ -324,7 +324,7 @@ void wait_for(endpoint_t who) /*===========================================================================* * pipe_suspend * *===========================================================================*/ -void pipe_suspend(struct filp * __unused filp, vir_bytes buf, size_t size) +void pipe_suspend(struct filp * filp __unused, vir_bytes buf, size_t size) { /* Take measures to suspend the processing of the present system call. * Store the parameters to be used upon resuming in the process table.