Skip to contentSkip to conversation

selftests/drivers/net: replace typeof() with __auto_type

PATCH In review Pranav Tyagi 2 participants 3 messages Aug 6, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/drivers/net: replace typeof() with __auto_type

Replace typeof() with __auto_type in iou-zcrx.c. __auto_type was introduced in GCC 4.9 and reduces the compile time for all compilers. No functional changes intended.

---
 tools/testing/selftests/drivers/net/hw/iou-zcrx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/drivers/net/hw/iou-zcrx.c +2 -2
index 62456df947bc..85551594bf0f 100644
@@ -42,8 +42,8 @@ static long page_size;
 #define SEND_SIZE (512 * 4096)
 #define min(a, b) \
 	({ \
-		typeof(a) _a = (a); \
-		typeof(b) _b = (b); \
+		__auto_type _a = (a); \
+		__auto_type _b = (b); \
 		_a < _b ? _a : _b; \
 	})
 #define min_t(t, a, b) \
Signature · 1 line
2.49.0
maintainer
#1 lore raw
Quoted 3 lines · On Wed, 6 Aug 2025 13:50:16 +0530 Pranav Tyagi wrote:

Replace typeof() with __auto_type in iou-zcrx.c. __auto_type was introduced in GCC 4.9 and reduces the compile time for all compilers. No functional changes intended.

Yet another unnecessary compiler feature. Please no.

#2 lore raw
Quoted 7 lines · Jakub Kicinski
Quoted 3 lines · On Wed, 6 Aug 2025 13:50:16 +0530 Pranav Tyagi wrote:

Replace typeof() with __auto_type in iou-zcrx.c. __auto_type was introduced in GCC 4.9 and reduces the compile time for all compilers. No functional changes intended.

Yet another unnecessary compiler feature. Please no.

I understand. Thanks