Linux-EROFS Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] erofs-utils: add ERR_CAST macro
@ 2023-07-11  3:55 Jingbo Xu
  2023-07-11  5:48 ` Gao Xiang
  0 siblings, 1 reply; 2+ messages in thread
From: Jingbo Xu @ 2023-07-11  3:55 UTC (permalink / raw)
  To: hsiangkao, chao, huyue2, linux-erofs

Add ERR_CAST macro.

Signed-off-by: Jingbo Xu <jefflexu@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
-- 
2.19.1.6.gb485710b


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] erofs-utils: add ERR_CAST macro
  2023-07-11  3:55 [PATCH] erofs-utils: add ERR_CAST macro Jingbo Xu
@ 2023-07-11  5:48 ` Gao Xiang
  0 siblings, 0 replies; 2+ messages in thread
From: Gao Xiang @ 2023-07-11  5:48 UTC (permalink / raw)
  To: Jingbo Xu, chao, huyue2, linux-erofs



On 2023/7/11 11:55, Jingbo Xu wrote:
> Add ERR_CAST macro.
> 
> Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-11  5:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-11  3:55 [PATCH] erofs-utils: add ERR_CAST macro Jingbo Xu
2023-07-11  5:48 ` Gao Xiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox