Skip to contentSkip to conversation

kselftest/arm64: Remove local ARRAY_SIZE() definitions

PATCH In review Mark Brown 4 participants 4 messages Jan 24, 2022 – Feb 15, 2022

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 kselftest/arm64: Remove local ARRAY_SIZE() definitions

An ARRAY_SIZE() has been added to kselftest.h so remove the local versions in some of the arm64 selftests.

---
 tools/testing/selftests/arm64/abi/syscall-abi.c | 1 -
 tools/testing/selftests/arm64/fp/sve-ptrace.c   | 2 --
 2 files changed, 3 deletions(-)
tools/testing/selftests/arm64/abi/syscall-abi.c +0 -1
index d8eeeafb50dc..1e13b7523918 100644
@@ -18,7 +18,6 @@
 
 #include "../../kselftest.h"
 
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
 #define NUM_VL ((SVE_VQ_MAX - SVE_VQ_MIN) + 1)
 
 extern void do_syscall(int sve_vl);
tools/testing/selftests/arm64/fp/sve-ptrace.c +0 -2
index af798b9d232c..90ba1d6a6781 100644
@@ -21,8 +21,6 @@
 
 #include "../../kselftest.h"
 
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
-
 /* <linux/elf.h> and <sys/auxv.h> don't like each other, so: */
 #ifndef NT_ARM_SVE
 #define NT_ARM_SVE 0x405
Signature · 1 line
2.30.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Mark Brown

An ARRAY_SIZE() has been added to kselftest.h so remove the local versions in some of the arm64 selftests.

Thank you for the patch removing duplicate defines.

Quoted 24 lines
---
  tools/testing/selftests/arm64/abi/syscall-abi.c | 1 -
  tools/testing/selftests/arm64/fp/sve-ptrace.c   | 2 --
  2 files changed, 3 deletions(-)
tools/testing/selftests/arm64/abi/syscall-abi.c +0 -1
index d8eeeafb50dc..1e13b7523918 100644
@@ -18,7 +18,6 @@
 
  #include "../../kselftest.h"
 
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
  #define NUM_VL ((SVE_VQ_MAX - SVE_VQ_MIN) + 1)
 
  extern void do_syscall(int sve_vl);
tools/testing/selftests/arm64/fp/sve-ptrace.c +0 -0
index af798b9d232c..90ba1d6a6781 100644

tools/testing/selftests/arm64/fp/sve-ptrace.c line 26

Quoted 8 lines
tools/testing/selftests/arm64/fp/sve-ptrace.c +0 -2
@@ -21,8 +21,6 @@
 
  #include "../../kselftest.h"
 
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
-
  /* <linux/elf.h> and <sys/auxv.h> don't like each other, so: */
  #ifndef NT_ARM_SVE
  #define NT_ARM_SVE 0x405

Assuming this is going through ARM tree?

thanks,
-- Shuah

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer
#3 lore raw
In reply to Mark Brown
Quoted 4 lines · Mark Brown

An ARRAY_SIZE() has been added to kselftest.h so remove the local versions in some of the arm64 selftests.

Applied to arm64 (for-next/kselftest), thanks!

[1/1] kselftest/arm64: Remove local ARRAY_SIZE() definitions

      https://git.kernel.org/arm64/c/3673d4b9cf68

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev