linux/bitfield.h: replace __auto_type with auto
PATCH 1/1 linux/bitfield.h: replace __auto_type with auto
Replace "__auto_type" as described in commit:
2fb6915fa22d compiler_types.h: add "auto" as a macro for "__auto_type"
--- include/linux/bitfield.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/bitfield.h +2 -2
@@ -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); \
Signature · 1 line
2.52.0
Yury Norov
maintainerQuoted 7 lines · H. Peter Anvin
Replace "
__auto_type" as described in commit:
2fb6915fa22dcompiler_types.h: add "auto" as a macro for "__auto_type"Cc Yury Norov <[email protected]> (maintainer:BITMAP API)Cc Rasmus Villemoes <[email protected]> (reviewer:BITMAP API)Signed-off-by H. Peter Anvin (Intel) <[email protected]>
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
Quoted 28 lines
--- include/linux/bitfield.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)include/linux/bitfield.h +2
-2@@ -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); \Signature · 1 line
2.52.0
PATCH v2 1/1 linux/bitfield.h: replace __auto_type with auto
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 ]
--- include/linux/bitfield.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
include/linux/bitfield.h +3 -2
@@ -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); \
Signature · 1 line
2.52.0