summaryrefslogtreecommitdiffstats
path: root/sys/security/mac_biba
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2004-07-28 07:01:33 +0000
committerkan <kan@FreeBSD.org>2004-07-28 07:01:33 +0000
commit155eb2ef69ae4d2ee341f850bf3086ef28a07bf4 (patch)
treeef056cab170377399258c31a22ff9ddb327398f8 /sys/security/mac_biba
parent3140931e1f4468fc877cdf58192a63cbb525fc7c (diff)
downloadFreeBSD-src-155eb2ef69ae4d2ee341f850bf3086ef28a07bf4.zip
FreeBSD-src-155eb2ef69ae4d2ee341f850bf3086ef28a07bf4.tar.gz
Introduce SLOT_SET macro and use it in place of casts as lvalues.
Diffstat (limited to 'sys/security/mac_biba')
-rw-r--r--sys/security/mac_biba/mac_biba.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/security/mac_biba/mac_biba.c b/sys/security/mac_biba/mac_biba.c
index f8a7321..85028e0 100644
--- a/sys/security/mac_biba/mac_biba.c
+++ b/sys/security/mac_biba/mac_biba.c
@@ -124,6 +124,7 @@ TUNABLE_INT("security.mac.biba.revocation_enabled", &revocation_enabled);
static int mac_biba_slot;
#define SLOT(l) ((struct mac_biba *)LABEL_TO_SLOT((l), mac_biba_slot).l_ptr)
+#define SLOT_SET(l, val) (LABEL_TO_SLOT((l), mac_biba_slot).l_ptr = (val))
static uma_zone_t zone_biba;
@@ -501,14 +502,14 @@ static void
mac_biba_init_label(struct label *label)
{
- SLOT(label) = biba_alloc(M_WAITOK);
+ SLOT_SET(label, biba_alloc(M_WAITOK));
}
static int
mac_biba_init_label_waitcheck(struct label *label, int flag)
{
- SLOT(label) = biba_alloc(flag);
+ SLOT_SET(label, biba_alloc(flag));
if (SLOT(label) == NULL)
return (ENOMEM);
@@ -520,7 +521,7 @@ mac_biba_destroy_label(struct label *label)
{
biba_free(SLOT(label));
- SLOT(label) = NULL;
+ SLOT_SET(label, NULL);
}
/*
OpenPOWER on IntegriCloud