Commit 2366fb16 authored by Ahmed S. Darwish's avatar Ahmed S. Darwish Committed by Paul Mackerras
Browse files

[POWERPC] PPC: 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>
Acked-by: default avatarKumar Gala <galak@gate.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 3839a594
...@@ -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>
...@@ -654,7 +655,7 @@ void rh_dump(rh_info_t * info) ...@@ -654,7 +655,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",
......
...@@ -77,7 +77,7 @@ static struct mtd_partition mpc8xxads_partitions[] = { ...@@ -77,7 +77,7 @@ static struct mtd_partition mpc8xxads_partitions[] = {
} }
}; };
#define mpc8xxads_part_num (sizeof (mpc8xxads_partitions) / sizeof (mpc8xxads_partitions[0])) #define mpc8xxads_part_num ARRAY_SIZE(mpc8xxads_partitions)
#endif #endif
......
...@@ -19,6 +19,7 @@ along with this file; see the file COPYING. If not, write to the Free ...@@ -19,6 +19,7 @@ along with this file; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <linux/posix_types.h> #include <linux/posix_types.h>
#include <linux/kernel.h>
#include "ansidecl.h" #include "ansidecl.h"
#include "ppc.h" #include "ppc.h"
...@@ -2669,8 +2670,7 @@ const struct powerpc_opcode powerpc_opcodes[] = { ...@@ -2669,8 +2670,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. */
...@@ -2717,5 +2717,4 @@ const struct powerpc_macro powerpc_macros[] = { ...@@ -2717,5 +2717,4 @@ const struct powerpc_macro powerpc_macros[] = {
}; };
const int powerpc_num_macros = const int powerpc_num_macros = ARRAY_SIZE(powerpc_macros);
sizeof (powerpc_macros) / sizeof (powerpc_macros[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