From 67cc189db497feb752abe29b22d017b5e91af8bf Mon Sep 17 00:00:00 2001 From: Vladimir Kondratyev Date: Sun, 24 Dec 2023 11:19:59 +0300 Subject: [PATCH] LinuxKPI: Add IOMEM_ERR_PTR() to linux/io.h The function creates an error pointer. Sponsored by: Serenity Cyber Security, LLC Reviewed by: manu, bz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42805 (cherry picked from commit af787b8e8b803dbb2c6bd06629974ba39bd0fb70) --- sys/compat/linuxkpi/common/include/linux/io.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/io.h b/sys/compat/linuxkpi/common/include/linux/io.h index b0a4109f3af..d70cda77400 100644 --- a/sys/compat/linuxkpi/common/include/linux/io.h +++ b/sys/compat/linuxkpi/common/include/linux/io.h @@ -35,6 +35,7 @@ #include #include +#include #include #if !defined(__arm__) #include @@ -528,6 +529,8 @@ memunmap(void *addr) iounmap(addr); } +#define IOMEM_ERR_PTR(err) (void __iomem *)ERR_PTR(err) + #define __MTRR_ID_BASE 1 int lkpi_arch_phys_wc_add(unsigned long, unsigned long); void lkpi_arch_phys_wc_del(int);