powerpc: Use ARRAY_SIZE for array length
PATCH 1/1 powerpc: Use ARRAY_SIZE for array length
Use of macro ARRAY_SIZE to calculate array size minimizes the redundant code and improves code reusability.
./arch/powerpc/xmon/ppc-opc.c:957:67-68: WARNING: Use ARRAY_SIZE.
Reported-by Abaci Robot <[email protected]>
Signed-off-by Jiapeng Chong <[email protected]>
--- arch/powerpc/xmon/ppc-opc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/powerpc/xmon/ppc-opc.c +1 -2
@@ -954,8 +954,7 @@ const struct powerpc_operand powerpc_operands[] = { 0xff, 11, NULL, NULL, PPC_OPERAND_SIGNOPT }, }; -const unsigned int num_powerpc_operands = (sizeof (powerpc_operands) - /sizeof (powerpc_operands[0 ])); +const unsigned int num_powerpc_operands =ARRAY_SIZE (powerpc_operands);/* The functions used to insert and extract complicated operands. */
Signature · 1 line
2.20.1.7.g153144c
Michael Ellerman
reviewerQuoted 11 lines · Jiapeng Chong
Use of macro
ARRAY_SIZEto calculate array size minimizes the redundant code and improves code reusability../arch/powerpc/xmon/ppc-opc.c:957:67-68: WARNING: Use
ARRAY_SIZE.Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>--- arch/powerpc/xmon/ppc-opc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
This code is copied from binutils, we don't take cleanup patches to it.
See also the at least three times this has already been submitted :)
https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/linuxppc-dev/[email protected]/
https://lore.kernel.org/linuxppc-dev/[email protected]/
cheers