aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/contrib/openzfs/module/lua/ldo.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/contrib/openzfs/module/lua/ldo.c b/sys/contrib/openzfs/module/lua/ldo.c
index 0344a29fd8e8..474fe659bcef 100644
--- a/sys/contrib/openzfs/module/lua/ldo.c
+++ b/sys/contrib/openzfs/module/lua/ldo.c
@@ -33,14 +33,16 @@
#if defined (_KERNEL) && defined(__linux__)
#include <asm/current.h>
static intptr_t stack_remaining(void) {
- char local;
- return (intptr_t)(&local - (char *)current->stack);
+ intptr_t local;
+ local = (intptr_t)&local - (intptr_t)current->stack;
+ return local;
}
#elif defined (_KERNEL) && defined(__FreeBSD__)
#include <sys/pcpu.h>
static intptr_t stack_remaining(void) {
- char local;
- return (intptr_t)(&local - (char *)curthread->td_kstack);
+ intptr_t local;
+ local = (intptr_t)&local - (intptr_t)curthread->td_kstack;
+ return local;
}
#else
static intptr_t stack_remaining(void) {