Skip to contentSkip to conversation

xtensa: ptrace: Remove zero-length alignment array

PATCH In review Thorsten Blum 2 participants 2 messages Feb 19, 2025

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

PATCH 1/1 xtensa: ptrace: Remove zero-length alignment array

Use a compiler attribute to align the areg field to 16 bytes instead of using a zero-length alignment array.

---
 arch/xtensa/include/asm/ptrace.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/xtensa/include/asm/ptrace.h +1 -4
index 86c70117371b..4871e5a4d6fb 100644
@@ -72,13 +72,10 @@ struct pt_regs {
 	/* Additional configurable registers that are used by the compiler. */
 	xtregs_opt_t xtregs_opt;
 
-	/* Make sure the areg field is 16 bytes aligned. */
-	int align[0] __attribute__ ((aligned(16)));
-
 	/* current register frame.
 	 * Note: The ESF for kernel exceptions ends after 16 registers!
 	 */
-	unsigned long areg[XCHAL_NUM_AREGS];
+	unsigned long areg[XCHAL_NUM_AREGS] __aligned(16);
 };
 
 # define arch_has_single_step()	(1)
Signature · 1 line
2.48.1
maintainer
#1 lore raw
Quoted 8 lines · Thorsten Blum

Use a compiler attribute to align the areg field to 16 bytes instead of using a zero-length alignment array.

---
 arch/xtensa/include/asm/ptrace.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Thanks. Applied to my xtensa tree.

-- Max