Skip to contentSkip to conversation

erofs-utils: add ERR_CAST macro

PATCH In review Jingbo Xu 2 participants 2 messages Jul 11, 2023

lore
Share & tools
lore

Jingbo Xu

author
#0 lore raw

PATCH 1/1 erofs-utils: add ERR_CAST macro

Add ERR_CAST macro.

---
 include/erofs/err.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/erofs/err.h +6 -0
index 08b0bdb..2ae9e21 100644
@@ -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
Signature · 1 line
2.19.1.6.gb485710b
#1 lore raw
Quoted 3 lines · Jingbo Xu

Add ERR_CAST macro.

I'd like to apply it with the following commit message:

"Add ERR_CAST macro to prepare for the upcoming tarerofs feature."

Thanks,
Gao Xiang