* [PATCH 1/1] linux/bitfield.h: replace __auto_type with auto
@ 2025-12-16 20:52 H. Peter Anvin
2025-12-16 21:10 ` Yury Norov
0 siblings, 1 reply; 3+ messages in thread
From: H. Peter Anvin @ 2025-12-16 20:52 UTC (permalink / raw)
To: linux-kernel; +Cc: Linus Torvalds, H. Peter Anvin, Yury Norov, Rasmus Villemoes
Replace "__auto_type" as described in commit:
2fb6915fa22d compiler_types.h: add "auto" as a macro for "__auto_type"
Cc: Yury Norov <yury.norov@gmail.com> (maintainer:BITMAP API)
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> (reviewer:BITMAP API)
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
---
include/linux/bitfield.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/bitfield.h b/include/linux/bitfield.h
index 126dc5b380af..ecdb8e66dbbe 100644
--- a/include/linux/bitfield.h
+++ b/include/linux/bitfield.h
@@ -243,7 +243,7 @@ __MAKE_OP(64)
#define __field_prep(mask, val) \
({ \
- __auto_type __mask = (mask); \
+ auto __mask = (mask); \
typeof(__mask) __val = (val); \
unsigned int __shift = BITS_PER_TYPE(__mask) <= 32 ? \
__ffs(__mask) : __ffs64(__mask); \
@@ -252,7 +252,7 @@ __MAKE_OP(64)
#define __field_get(mask, reg) \
({ \
- __auto_type __mask = (mask); \
+ auto __mask = (mask); \
typeof(__mask) __reg = (reg); \
unsigned int __shift = BITS_PER_TYPE(__mask) <= 32 ? \
__ffs(__mask) : __ffs64(__mask); \
--
2.52.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] linux/bitfield.h: replace __auto_type with auto
2025-12-16 20:52 [PATCH 1/1] linux/bitfield.h: replace __auto_type with auto H. Peter Anvin
@ 2025-12-16 21:10 ` Yury Norov
2025-12-17 1:21 ` [PATCH v2 " H. Peter Anvin
0 siblings, 1 reply; 3+ messages in thread
From: Yury Norov @ 2025-12-16 21:10 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: linux-kernel, Linus Torvalds, Rasmus Villemoes
On Tue, Dec 16, 2025 at 12:52:38PM -0800, H. Peter Anvin wrote:
> Replace "__auto_type" as described in commit:
>
> 2fb6915fa22d compiler_types.h: add "auto" as a macro for "__auto_type"
>
> Cc: Yury Norov <yury.norov@gmail.com> (maintainer:BITMAP API)
> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> (reviewer:BITMAP API)
> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Thanks for the work.
The compiler_types.h is included via build_bug.h -> compiler.h.
It works because there's plenty of BUG_ON()s here, but it's better to
include the compiler_types.h explicitly. Can you please send a v2?
Thanks,
Yury
> ---
> include/linux/bitfield.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/bitfield.h b/include/linux/bitfield.h
> index 126dc5b380af..ecdb8e66dbbe 100644
> --- a/include/linux/bitfield.h
> +++ b/include/linux/bitfield.h
> @@ -243,7 +243,7 @@ __MAKE_OP(64)
>
> #define __field_prep(mask, val) \
> ({ \
> - __auto_type __mask = (mask); \
> + auto __mask = (mask); \
> typeof(__mask) __val = (val); \
> unsigned int __shift = BITS_PER_TYPE(__mask) <= 32 ? \
> __ffs(__mask) : __ffs64(__mask); \
> @@ -252,7 +252,7 @@ __MAKE_OP(64)
>
> #define __field_get(mask, reg) \
> ({ \
> - __auto_type __mask = (mask); \
> + auto __mask = (mask); \
> typeof(__mask) __reg = (reg); \
> unsigned int __shift = BITS_PER_TYPE(__mask) <= 32 ? \
> __ffs(__mask) : __ffs64(__mask); \
> --
> 2.52.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 1/1] linux/bitfield.h: replace __auto_type with auto
2025-12-16 21:10 ` Yury Norov
@ 2025-12-17 1:21 ` H. Peter Anvin
0 siblings, 0 replies; 3+ messages in thread
From: H. Peter Anvin @ 2025-12-17 1:21 UTC (permalink / raw)
To: Linux Kernel Mailing List
Cc: Linus Torvalds, H. Peter Anvin, Yury Norov, Rasmus Villemoes
Replace "__auto_type" as described in commit:
2fb6915fa22d compiler_types.h: add "auto" as a macro for "__auto_type"
[ v2: add an explicit #include <linux/compiler.h> to this header ]
Cc: Yury Norov <yury.norov@gmail.com> (maintainer:BITMAP API)
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> (reviewer:BITMAP API)
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
---
include/linux/bitfield.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/linux/bitfield.h b/include/linux/bitfield.h
index 126dc5b380af..7c3fff2437d4 100644
--- a/include/linux/bitfield.h
+++ b/include/linux/bitfield.h
@@ -7,6 +7,7 @@
#ifndef _LINUX_BITFIELD_H
#define _LINUX_BITFIELD_H
+#include <linux/compiler.h>
#include <linux/build_bug.h>
#include <linux/typecheck.h>
#include <asm/byteorder.h>
@@ -243,7 +244,7 @@ __MAKE_OP(64)
#define __field_prep(mask, val) \
({ \
- __auto_type __mask = (mask); \
+ auto __mask = (mask); \
typeof(__mask) __val = (val); \
unsigned int __shift = BITS_PER_TYPE(__mask) <= 32 ? \
__ffs(__mask) : __ffs64(__mask); \
@@ -252,7 +253,7 @@ __MAKE_OP(64)
#define __field_get(mask, reg) \
({ \
- __auto_type __mask = (mask); \
+ auto __mask = (mask); \
typeof(__mask) __reg = (reg); \
unsigned int __shift = BITS_PER_TYPE(__mask) <= 32 ? \
__ffs(__mask) : __ffs64(__mask); \
--
2.52.0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-17 1:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-16 20:52 [PATCH 1/1] linux/bitfield.h: replace __auto_type with auto H. Peter Anvin
2025-12-16 21:10 ` Yury Norov
2025-12-17 1:21 ` [PATCH v2 " H. Peter Anvin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®