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

Zhan Xusheng posted 1 patch 1 month, 1 week ago
include/linux/compiler-context-analysis.h | 4 ++--
include/linux/srcu.h                      | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
[PATCH] include/linux: replace remaining __auto_type with auto
Posted by Zhan Xusheng 1 month, 1 week ago
From: Zhan Xusheng <zhanxusheng1024@gmail.com>

From: Zhan Xusheng <zhanxusheng@xiaomi.com>

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 <zhanxusheng@xiaomi.com>
---
 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;									\
-- 
2.43.0
Re: [PATCH] include/linux: replace remaining __auto_type with auto
Posted by H. Peter Anvin 1 month, 1 week ago
On August 17, 2026 1:11:35 AM PDT, Zhan Xusheng <zhanxusheng1024@gmail.com> wrote:
>From: Zhan Xusheng <zhanxusheng1024@gmail.com>
>
>From: Zhan Xusheng <zhanxusheng@xiaomi.com>
>
>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 <zhanxusheng@xiaomi.com>
>---
> 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 <hpa@zytor.com>
Re: [PATCH] include/linux: replace remaining __auto_type with auto
Posted by Marco Elver 1 month, 1 week ago
On Mon, 17 Aug 2026 at 10:11, Zhan Xusheng <zhanxusheng1024@gmail.com> wrote:
>
> From: Zhan Xusheng <zhanxusheng1024@gmail.com>
>
> From: Zhan Xusheng <zhanxusheng@xiaomi.com>
>
> 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 <zhanxusheng@xiaomi.com>

Acked-by: Marco Elver <elver@google.com>

> ---
>  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;                                                                    \
> --
> 2.43.0
>
Re: [PATCH] include/linux: replace remaining __auto_type with auto
Posted by Paul E. McKenney 1 month, 1 week ago
On Mon, Aug 17, 2026 at 04:11:35PM +0800, Zhan Xusheng wrote:
> From: Zhan Xusheng <zhanxusheng1024@gmail.com>
> 
> From: Zhan Xusheng <zhanxusheng@xiaomi.com>
> 
> 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 <zhanxusheng@xiaomi.com>

For the SRCU portion:

Acked-by: Paul E. McKenney <paulmck@kernel.org>

> ---
>  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;									\
> -- 
> 2.43.0
>