diff options
author | jkim <jkim@FreeBSD.org> | 2010-06-11 23:38:25 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2010-06-11 23:38:25 +0000 |
commit | 4c502da7ff2e402a32fac30f893cc0fdbc0219bb (patch) | |
tree | 2845ce23ff2e883952c8d8c0f45bf0b887368240 | |
parent | fc7145ca5fc3712b475ee89a40c4d763bb38e4c6 (diff) | |
download | FreeBSD-src-4c502da7ff2e402a32fac30f893cc0fdbc0219bb.zip FreeBSD-src-4c502da7ff2e402a32fac30f893cc0fdbc0219bb.tar.gz |
Apply band-aid around function-like macro fdrop() without turning it into
a real (inline) function or applying void casting for all its consumers.
In most of places, the "return value" is not checked nor assigned, which
causes too many warnings for some smart compilers, i.e., clang.
Found by: clang
-rw-r--r-- | sys/sys/file.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/sys/file.h b/sys/sys/file.h index 8ad30a5..061ce02 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -201,10 +201,17 @@ int fgetvp_write(struct thread *td, int fd, struct vnode **vpp); int fgetsock(struct thread *td, int fd, struct socket **spp, u_int *fflagp); void fputsock(struct socket *sp); +static __inline int +_fnoop(void) +{ + + return (0); +} + #define fhold(fp) \ (refcount_acquire(&(fp)->f_count)) #define fdrop(fp, td) \ - (refcount_release(&(fp)->f_count) ? _fdrop((fp), (td)) : 0) + (refcount_release(&(fp)->f_count) ? _fdrop((fp), (td)) : _fnoop()) static __inline fo_rdwr_t fo_read; static __inline fo_rdwr_t fo_write; |