Commit 3839a594 authored by Ahmed S. Darwish's avatar Ahmed S. Darwish Committed by Paul Mackerras
Browse files

[POWERPC] Use ARRAY_SIZE macro when appropriate



Use ARRAY_SIZE macro already defined in linux/kernel.h
Signed-off-by: default avatarAhmed S. Darwish <darwish.07@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 0524aad7
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
*/ */
#include <linux/types.h> #include <linux/types.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -671,7 +672,7 @@ void rh_dump(rh_info_t * info) ...@@ -671,7 +672,7 @@ void rh_dump(rh_info_t * info)
int maxnr; int maxnr;
int i, nr; int i, nr;
maxnr = sizeof(st) / sizeof(st[0]); maxnr = ARRAY_SIZE(st);
printk(KERN_INFO printk(KERN_INFO
"info @0x%p (%d slots empty / %d max)\n", "info @0x%p (%d slots empty / %d max)\n",
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
02110-1301, USA. */ 02110-1301, USA. */
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/kernel.h>
#include "nonstdio.h" #include "nonstdio.h"
#include "ppc.h" #include "ppc.h"
...@@ -4932,8 +4933,7 @@ const struct powerpc_opcode powerpc_opcodes[] = { ...@@ -4932,8 +4933,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
}; };
const int powerpc_num_opcodes = const int powerpc_num_opcodes = ARRAY_SIZE(powerpc_opcodes);
sizeof (powerpc_opcodes) / sizeof (powerpc_opcodes[0]);
/* The macro table. This is only used by the assembler. */ /* The macro table. This is only used by the assembler. */
...@@ -4989,5 +4989,4 @@ const struct powerpc_macro powerpc_macros[] = { ...@@ -4989,5 +4989,4 @@ const struct powerpc_macro powerpc_macros[] = {
{ "clrlslwi.",4, PPCCOM, "rlwinm. %0,%1,%3,(%2)-(%3),31-(%3)" }, { "clrlslwi.",4, PPCCOM, "rlwinm. %0,%1,%3,(%2)-(%3),31-(%3)" },
}; };
const int powerpc_num_macros = const int powerpc_num_macros = ARRAY_SIZE(powerpc_macros);
sizeof (powerpc_macros) / sizeof (powerpc_macros[0]);
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
with this program; if not, write to the Free Software Foundation, Inc., with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <linux/kernel.h>
#include "spu.h" #include "spu.h"
/* This file holds the Spu opcode table */ /* This file holds the Spu opcode table */
...@@ -40,5 +41,4 @@ const struct spu_opcode spu_opcodes[] = { ...@@ -40,5 +41,4 @@ const struct spu_opcode spu_opcodes[] = {
#undef APUOPFB #undef APUOPFB
}; };
const int spu_num_opcodes = const int spu_num_opcodes = ARRAY_SIZE(spu_opcodes);
sizeof (spu_opcodes) / sizeof (spu_opcodes[0]);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment