From 81b1f871173e422979709ae583cfe799b3d60f06 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Fri, 25 Sep 2015 12:22:27 -0700 Subject: [PATCH] Fix noassert builds Change-Id: I5626950ffa29afe7a0fb9e9144839b311824da92 --- minix/lib/libminixfs/cache.c | 11 ++++++++--- minix/servers/vfs/pipe.c | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) 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.