diff options
author | kan <kan@FreeBSD.org> | 2004-07-28 07:01:33 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2004-07-28 07:01:33 +0000 |
commit | 155eb2ef69ae4d2ee341f850bf3086ef28a07bf4 (patch) | |
tree | ef056cab170377399258c31a22ff9ddb327398f8 /sys/security/mac_mls | |
parent | 3140931e1f4468fc877cdf58192a63cbb525fc7c (diff) | |
download | FreeBSD-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_mls')
-rw-r--r-- | sys/security/mac_mls/mac_mls.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/security/mac_mls/mac_mls.c b/sys/security/mac_mls/mac_mls.c index ee390c3..3c5a88b 100644 --- a/sys/security/mac_mls/mac_mls.c +++ b/sys/security/mac_mls/mac_mls.c @@ -113,6 +113,7 @@ SYSCTL_INT(_security_mac_mls, OID_AUTO, max_compartments, CTLFLAG_RD, static int mac_mls_slot; #define SLOT(l) ((struct mac_mls *)LABEL_TO_SLOT((l), mac_mls_slot).l_ptr) +#define SLOT_SET(l, val) (LABEL_TO_SLOT((l), mac_mls_slot).l_ptr = (val)) static uma_zone_t zone_mls; @@ -467,14 +468,14 @@ static void mac_mls_init_label(struct label *label) { - SLOT(label) = mls_alloc(M_WAITOK); + SLOT_SET(label, mls_alloc(M_WAITOK)); } static int mac_mls_init_label_waitcheck(struct label *label, int flag) { - SLOT(label) = mls_alloc(flag); + SLOT_SET(label, mls_alloc(flag)); if (SLOT(label) == NULL) return (ENOMEM); @@ -486,7 +487,7 @@ mac_mls_destroy_label(struct label *label) { mls_free(SLOT(label)); - SLOT(label) = NULL; + SLOT_SET(label, NULL); } /* |