diff options
| author | joerg <joerg@NetBSD.org> | 2020-02-21 00:26:21 +0000 |
|---|---|---|
| committer | joerg <joerg@NetBSD.org> | 2020-02-21 00:26:21 +0000 |
| commit | 7cd8f2ab9939a75ffdef271a8e1d0702825fbc52 (patch) | |
| tree | 9a9ea6c0298e9455874ae0b9e30b1251036ed418 /sys/dev/clockctl.c | |
| parent | d9d5f576e1104f6636e2c3cab1efb025a8e95452 (diff) | |
Explicitly cast pointers to uintptr_t before casting to enums. They are
not necessarily the same size. Don't cast pointers to bool, check for
NULL instead.
Diffstat (limited to 'sys/dev/clockctl.c')
| -rw-r--r-- | sys/dev/clockctl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/clockctl.c b/sys/dev/clockctl.c index 7041ae1bc4b..0da5e7765fe 100644 --- a/sys/dev/clockctl.c +++ b/sys/dev/clockctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: clockctl.c,v 1.37 2019/03/01 11:06:56 pgoyette Exp $ */ +/* $NetBSD: clockctl.c,v 1.38 2020/02/21 00:26:22 joerg Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: clockctl.c,v 1.37 2019/03/01 11:06:56 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clockctl.c,v 1.38 2020/02/21 00:26:22 joerg Exp $"); #ifdef _KERNEL_OPT #include "opt_ntp.h" @@ -90,13 +90,13 @@ clockctl_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie, bool device_context; result = KAUTH_RESULT_DEFER; - req = (enum kauth_system_req)arg0; + req = (enum kauth_system_req)(uintptr_t)arg0; if ((action != KAUTH_SYSTEM_TIME) || (req != KAUTH_REQ_SYSTEM_TIME_SYSTEM)) return result; - device_context = (bool)arg3; + device_context = arg3 != NULL; /* Device is controlled by permissions, so allow. */ if (device_context) |
