erofs-utils: add ERR_CAST macro
authorJingbo Xu <jefflexu@linux.alibaba.com>
Tue, 11 Jul 2023 06:12:39 +0000 (14:12 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Tue, 11 Jul 2023 06:17:59 +0000 (14:17 +0800)
Add ERR_CAST macro to prepare for the upcoming tarerofs feature.

Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230711061240.23662-1-jefflexu@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
include/erofs/err.h

index 08b0bdba59e1bcde62a50920f513b9f97304c18f..2ae9e215a28bd1bea21590bd18c08917f334c20b 100644 (file)
@@ -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