Re: [PATCH] include/linux: replace remaining __auto_type with auto

"H. Peter Anvin" <[email protected]>
Newsgroups org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On August 17, 2026 1:11:35 AM PDT, Zhan Xusheng <[email protected]> wrote:
>From: Zhan Xusheng <[email protected]>
>
>From: Zhan Xusheng <[email protected]>
>
>Replace "__auto_type" as described in commit:
>
>2fb6915fa22d compiler_types.h: add "auto" as a macro for "__auto_type"
>
>srcu.h and compiler-context-analysis.h gained new users shortly after the
>last sweep.  With these, __auto_type under include/ is left only in the
>definition itself and the comment above it.
>
>Signed-off-by: Zhan Xusheng <[email protected]>
>---
> include/linux/compiler-context-analysis.h | 4 ++--
> include/linux/srcu.h                      | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/include/linux/compiler-context-analysis.h b/include/linux/compiler-context-analysis.h
>index 8302ebc2ea8c..ba6f5bd4b745 100644
>--- a/include/linux/compiler-context-analysis.h
>+++ b/include/linux/compiler-context-analysis.h
>@@ -447,7 +447,7 @@ static inline void _context_unsafe_alias(void **p) { }
>  */
> #define __acquire_ret(call, ret_expr)		\
> 	({					\
>-		__auto_type __ret = call;	\
>+		auto __ret = call;		\
> 		__acquire(ret_expr);		\
> 		__ret;				\
> 	})
>@@ -459,7 +459,7 @@ static inline void _context_unsafe_alias(void **p) { }
>  */
> #define __acquire_shared_ret(call, ret_expr)	\
> 	({					\
>-		__auto_type __ret = call;	\
>+		auto __ret = call;		\
> 		__acquire_shared(ret_expr);	\
> 		__ret;				\
> 	})
>diff --git a/include/linux/srcu.h b/include/linux/srcu.h
>index a54ce9e808b9..0275832d2004 100644
>--- a/include/linux/srcu.h
>+++ b/include/linux/srcu.h
>@@ -237,7 +237,7 @@ static inline void __srcu_read_lock_must_hold(const struct srcu_struct *ssp) __m
> ({										\
> 	__srcu_read_lock_must_hold(ssp);					\
> 	__acquire_shared_ctx_lock(RCU);					\
>-	__auto_type __v = __rcu_dereference_check((p), __UNIQUE_ID(rcu),	\
>+	auto __v = __rcu_dereference_check((p), __UNIQUE_ID(rcu),	\
> 				(c) || srcu_read_lock_held(ssp), __rcu);	\
> 	__release_shared_ctx_lock(RCU);					\
> 	__v;									\

Acked-by: H. Peter Anvin <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.