git: b918ee2ce485 - main - tmpfs: remove IFF macro
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 15 Feb 2023 00:58:00 UTC
The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b918ee2ce4850253ddd884e39dabecd6e96bf474 commit b918ee2ce4850253ddd884e39dabecd6e96bf474 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2023-02-13 23:47:44 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2023-02-15 00:57:41 +0000 tmpfs: remove IFF macro Requested by: mjg Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38576 --- sys/fs/tmpfs/tmpfs.h | 1 - sys/fs/tmpfs/tmpfs_subr.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs.h b/sys/fs/tmpfs/tmpfs.h index 70ed066ef0f5..eda1c3b12c24 100644 --- a/sys/fs/tmpfs/tmpfs.h +++ b/sys/fs/tmpfs/tmpfs.h @@ -516,7 +516,6 @@ tmpfs_update(struct vnode *vp) * Convenience macros to simplify some logical expressions. */ #define IMPLIES(a, b) (!(a) || (b)) -#define IFF(a, b) (IMPLIES(a, b) && IMPLIES(b, a)) /* * Checks that the directory entry pointed by 'de' matches the name 'name' diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index cfd4787fb712..351ca825f203 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -547,8 +547,8 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type, * allocated, this must be the request to do it. */ MPASS(IMPLIES(tmp->tm_root == NULL, parent == NULL && type == VDIR)); - MPASS(IFF(type == VLNK, target != NULL)); - MPASS(IFF(type == VBLK || type == VCHR, rdev != VNOVAL)); + MPASS((type == VLNK) ^ (target == NULL)); + MPASS((type == VBLK || type == VCHR) ^ (rdev == VNOVAL)); if (tmp->tm_nodes_inuse >= tmp->tm_nodes_max) return (ENOSPC);