From ff81e317d49ab02b5e3abacff51d4465bb6eadab Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Sat, 31 May 2003 18:46:45 +0000 Subject: [PATCH] Use temporary variable to avoid double expansion of macro with side effects. Found by: FlexeLint --- sys/fs/nullfs/null_vfsops.c | 5 ++++- sys/fs/umapfs/umap_vfsops.c | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index d6ca21115f6..6ace1728603 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -391,7 +391,10 @@ nullfs_vptofh(vp, fhp) struct vnode *vp; struct fid *fhp; { - return VFS_VPTOFH(NULLVPTOLOWERVP(vp), fhp); + struct vnode *lvp; + + lvp = NULLVPTOLOWERVP(vp); + return VFS_VPTOFH(lvp, fhp); } static int diff --git a/sys/fs/umapfs/umap_vfsops.c b/sys/fs/umapfs/umap_vfsops.c index 17bee461ba4..5fb2d01fb1d 100644 --- a/sys/fs/umapfs/umap_vfsops.c +++ b/sys/fs/umapfs/umap_vfsops.c @@ -418,8 +418,10 @@ umapfs_vptofh(vp, fhp) struct vnode *vp; struct fid *fhp; { + struct vnode *lvp; - return (VFS_VPTOFH(UMAPVPTOLOWERVP(vp), fhp)); + lvp = UMAPVPTOLOWERVP(vp); + return (VFS_VPTOFH(lvp, fhp)); } static int