All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: Remove unnecessary zero-length struct member
@ 2025-04-11  9:00 Thorsten Blum
  2025-04-16  2:33 ` Maciej W. Rozycki
  0 siblings, 1 reply; 5+ messages in thread
From: Thorsten Blum @ 2025-04-11  9:00 UTC (permalink / raw)
  To: Oleg Nesterov, Thomas Bogendoerfer
  Cc: Thorsten Blum, linux-mips, linux-kernel

Remove the zero-length struct member '__last' and use sizeof() to
calculate the value for MAX_REG_OFFSET.

No functional changes intended.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/mips/include/asm/ptrace.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h
index 85fa9962266a..1bb10ee8c2ce 100644
--- a/arch/mips/include/asm/ptrace.h
+++ b/arch/mips/include/asm/ptrace.h
@@ -48,7 +48,6 @@ struct pt_regs {
 	unsigned long long mpl[6];        /* MTM{0-5} */
 	unsigned long long mtp[6];        /* MTP{0-5} */
 #endif
-	unsigned long __last[0];
 } __aligned(8);
 
 static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
@@ -65,7 +64,7 @@ static inline void instruction_pointer_set(struct pt_regs *regs,
 
 /* Query offset/name of register from its name/offset */
 extern int regs_query_register_offset(const char *name);
-#define MAX_REG_OFFSET (offsetof(struct pt_regs, __last))
+#define MAX_REG_OFFSET (sizeof(struct pt_regs))
 
 /**
  * regs_get_register() - get register value from its offset
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-17  8:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-11  9:00 [PATCH] MIPS: Remove unnecessary zero-length struct member Thorsten Blum
2025-04-16  2:33 ` Maciej W. Rozycki
2025-04-16 15:25   ` Thorsten Blum
2025-04-17  8:00   ` Thorsten Blum
2025-04-17  8:09     ` Maciej W. Rozycki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.