Add ERR_CAST macro.
Signed-off-by: Jingbo Xu <[email protected]>
---
include/erofs/err.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/erofs/err.h b/include/erofs/err.h
index 08b0bdb..2ae9e21 100644
--- a/include/erofs/err.h
+++ b/include/erofs/err.h
@@ -33,6 +33,12 @@ static inline long PTR_ERR(const void *ptr)
return (long) ptr;
}
+static inline void * ERR_CAST(const void *ptr)
+{
+ /* cast away the const */
+ return (void *) ptr;
+}
+
#ifdef __cplusplus
}
#endif
--
2.19.1.6.gb485710b