From 7cd8f2ab9939a75ffdef271a8e1d0702825fbc52 Mon Sep 17 00:00:00 2001 From: joerg Date: Fri, 21 Feb 2020 00:26:21 +0000 Subject: 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. --- sys/dev/clockctl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/dev/clockctl.c') 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 -__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) -- cgit