From 47c0672b08c1be0afe19188693a7360f4179e721 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Mon, 20 Apr 2020 13:36:01 +0000 Subject: [PATCH] Allow the ERR_CAST() function in the LinuxKPI to take a const void pointer. No functional change. MFC after: 1 week Sponsored by: Mellanox Technologies --- sys/compat/linuxkpi/common/include/linux/err.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/err.h b/sys/compat/linuxkpi/common/include/linux/err.h index a0eb74c2e37d..5f71ebf59b5b 100644 --- a/sys/compat/linuxkpi/common/include/linux/err.h +++ b/sys/compat/linuxkpi/common/include/linux/err.h @@ -31,6 +31,8 @@ #ifndef _LINUX_ERR_H_ #define _LINUX_ERR_H_ +#include + #include #define MAX_ERRNO 4095 @@ -62,9 +64,9 @@ IS_ERR_OR_NULL(const void *ptr) } static inline void * -ERR_CAST(void *ptr) +ERR_CAST(const void *ptr) { - return (void *)ptr; + return __DECONST(void *, ptr); } static inline int