[PATCH v2 1/2] erofs-utils: add ERR_CAST macro

Jingbo Xu jefflexu at linux.alibaba.com
Thu Jul 13 22:00:14 AEST 2023


Add ERR_CAST macro to prepare for the upcoming tarerofs feature.

Signed-off-by: Jingbo Xu <jefflexu at linux.alibaba.com>
---
 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
-- 
1.8.3.1



More information about the Linux-erofs mailing list