Skip to contentSkip to conversation

tools headers: Update the include/vdso/unaligned.h to sync headers

PATCH In review Athira Rajeev 2 participants 3 messages Apr 21, 2025 – Apr 25, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools headers: Update the include/vdso/unaligned.h to sync headers

To pick up the changes in:
commit acea9943271b ("vdso: Address variable shadowing in macros")

Addressing this perf tools build warning:

diff -u tools/include/vdso/unaligned.h include/vdso/unaligned.h

---
 tools/include/vdso/unaligned.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
tools/include/vdso/unaligned.h +6 -6
index eee3d2a4dbe4..ff0c06b6513e 100644
@@ -2,14 +2,14 @@
 #ifndef __VDSO_UNALIGNED_H
 #define __VDSO_UNALIGNED_H
 
-#define __get_unaligned_t(type, ptr) ({						\
-	const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr);	\
-	__pptr->x;								\
+#define __get_unaligned_t(type, ptr) ({							\
+	const struct { type x; } __packed * __get_pptr = (typeof(__get_pptr))(ptr);	\
+	__get_pptr->x;									\
 })
 
-#define __put_unaligned_t(type, val, ptr) do {					\
-	struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr);		\
-	__pptr->x = (val);							\
+#define __put_unaligned_t(type, val, ptr) do {						\
+	struct { type x; } __packed * __put_pptr = (typeof(__put_pptr))(ptr);		\
+	__put_pptr->x = (val);								\
 } while (0)
 
 #endif /* __VDSO_UNALIGNED_H */
Signature · 1 line
2.47.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 29 lines · Athira Rajeev

To pick up the changes in:
commit acea9943271b ("vdso: Address variable shadowing in macros")

Addressing this perf tools build warning:

diff -u tools/include/vdso/unaligned.h include/vdso/unaligned.h

---
  tools/include/vdso/unaligned.h | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)
tools/include/vdso/unaligned.h +3 -3
index eee3d2a4dbe4..ff0c06b6513e 100644
@@ -2,14 +2,14 @@
  #ifndef __VDSO_UNALIGNED_H
  #define __VDSO_UNALIGNED_H
 
-#define __get_unaligned_t(type, ptr) ({						\
-	const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr);	\
-	__pptr->x;								\
+#define __get_unaligned_t(type, ptr) ({							\
+	const struct { type x; } __packed * __get_pptr = (typeof(__get_pptr))(ptr);	\
+	__get_pptr->x;									\
  })

tools/include/vdso/unaligned.h line 15

Quoted 10 lines
tools/include/vdso/unaligned.h +3 -3
 
-#define __put_unaligned_t(type, val, ptr) do {					\
-	struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr);		\
-	__pptr->x = (val);							\
+#define __put_unaligned_t(type, val, ptr) do {						\
+	struct { type x; } __packed * __put_pptr = (typeof(__put_pptr))(ptr);		\
+	__put_pptr->x = (val);								\
  } while (0)
 
  #endif /* __VDSO_UNALIGNED_H */
#2 lore raw
Quoted 33 lines · James Clark
Quoted 26 lines · Athira Rajeev

To pick up the changes in:
commit acea9943271b ("vdso: Address variable shadowing in macros") Addressing this perf tools build warning:
diff -u tools/include/vdso/unaligned.h include/vdso/unaligned.h

---
 tools/include/vdso/unaligned.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
tools/include/vdso/unaligned.h +3 -3
index eee3d2a4dbe4..ff0c06b6513e 100644
@@ -2,14 +2,14 @@
 #ifndef __VDSO_UNALIGNED_H
 #define __VDSO_UNALIGNED_H
 -#define __get_unaligned_t(type, ptr) ({ \
- const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \
- __pptr->x; \
+#define __get_unaligned_t(type, ptr) ({ \
+ const struct { type x; } __packed * __get_pptr = (typeof(__get_pptr))(ptr); \
+ __get_pptr->x; \
 })
 -#define __put_unaligned_t(type, val, ptr) do { \
- struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \
Quoted 8 lines

tools/include/vdso/unaligned.h line 15

Quoted 6 lines
tools/include/vdso/unaligned.h +3 -1
- __pptr->x = (val); \
+#define __put_unaligned_t(type, val, ptr) do { \
+ struct { type x; } __packed * __put_pptr = (typeof(__put_pptr))(ptr); \
+ __put_pptr->x = (val); \
 } while (0)
   #endif /* __VDSO_UNALIGNED_H */

Hi,

Looking for feedback on this change.

Thanks
Athira