Skip to contentSkip to conversation

LoongArch: use flexible-array member instead of zero-length array

PATCH In review [email protected] 3 participants 3 messages Oct 18, 2022

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

PATCH 1/1 LoongArch: use flexible-array member instead of zero-length array

From: Yushan Zhou <[email protected]>

Eliminate the following coccicheck warning:
./arch/loongarch/include/asm/ptrace.h:32:15-21: WARNING use flexible-array member instead

---
 arch/loongarch/include/asm/ptrace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/loongarch/include/asm/ptrace.h +1 -1
index 17838c6b7ccd..7437b9366c3b 100644
@@ -29,7 +29,7 @@ struct pt_regs {
 	unsigned long csr_euen;
 	unsigned long csr_ecfg;
 	unsigned long csr_estat;
-	unsigned long __last[0];
+	unsigned long __last[];
 } __aligned(8);
 
 static inline int regs_irqs_disabled(struct pt_regs *regs)
Signature · 1 line
2.27.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · On 2022/10/18 17:47, [email protected] wrote:

From: Yushan Zhou <[email protected]>

Eliminate the following coccicheck warning:
./arch/loongarch/include/asm/ptrace.h:32:15-21: WARNING use flexible-array member instead

---
  arch/loongarch/include/asm/ptrace.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/loongarch/include/asm/ptrace.h +0 -0
index 17838c6b7ccd..7437b9366c3b 100644

arch/loongarch/include/asm/ptrace.h struct pt_regs { · line 35

Quoted 8 lines
arch/loongarch/include/asm/ptrace.h +1 -1
@@ -29,7 +29,7 @@ struct pt_regs {
  	unsigned long csr_euen;
  	unsigned long csr_ecfg;
  	unsigned long csr_estat;
-	unsigned long __last[0];
+	unsigned long __last[];
  } __aligned(8);
 
  static inline int regs_irqs_disabled(struct pt_regs *regs)

Seems good. Thanks.

Signature · 3 lines
WANG "xen0n" Xuerui

Linux/LoongArch mailing list: https://lore.kernel.org/loongarch/
maintainer
#2 lore raw

Queued for loongarch-fixes

Quoted 36 lines · WANG Xuerui
Quoted 15 lines · On 2022/10/18 17:47, [email protected] wrote:

From: Yushan Zhou <[email protected]>

Eliminate the following coccicheck warning:
./arch/loongarch/include/asm/ptrace.h:32:15-21: WARNING use flexible-array member instead

---
  arch/loongarch/include/asm/ptrace.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/loongarch/include/asm/ptrace.h +0 -0
index 17838c6b7ccd..7437b9366c3b 100644

arch/loongarch/include/asm/ptrace.h struct pt_regs { · line 35

Quoted 8 lines
arch/loongarch/include/asm/ptrace.h +1 -1
@@ -29,7 +29,7 @@ struct pt_regs {
      unsigned long csr_euen;
      unsigned long csr_ecfg;
      unsigned long csr_estat;
-     unsigned long __last[0];
+     unsigned long __last[];
  } __aligned(8);
 
  static inline int regs_irqs_disabled(struct pt_regs *regs)

Seems good. Thanks.

--
WANG "xen0n" Xuerui

Linux/LoongArch mailing list: https://lore.kernel.org/loongarch/