]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[POWERPC] PPC: Use ARRAY_SIZE macro when appropriate
authorAhmed S. Darwish <darwish.07@gmail.com>
Tue, 6 Feb 2007 00:14:10 +0000 (16:14 -0800)
committerPaul Mackerras <paulus@samba.org>
Thu, 8 Feb 2007 05:08:25 +0000 (16:08 +1100)
Use ARRAY_SIZE macro already defined in linux/kernel.h

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Kumar Gala <galak@gate.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/ppc/lib/rheap.c
arch/ppc/syslib/m8xx_setup.c
arch/ppc/xmon/ppc-opc.c

index 31e511856dc58bc2b819e80c32a35840db5bd9ca..d40700795a9c05bc823a99378a3f6dd0885c9a39 100644 (file)
@@ -14,6 +14,7 @@
  */
 #include <linux/types.h>
 #include <linux/errno.h>
+#include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
 
@@ -654,7 +655,7 @@ void rh_dump(rh_info_t * info)
        int maxnr;
        int i, nr;
 
-       maxnr = sizeof(st) / sizeof(st[0]);
+       maxnr = ARRAY_SIZE(st);
 
        printk(KERN_INFO
               "info @0x%p (%d slots empty / %d max)\n",
index d8d299bd1a123d37f2bda11f7e85f60f9f8c3830..01e48d88f22d482e912070f86830bb5461a504bd 100644 (file)
@@ -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
 
index 533a6c9973d43fa01cff0fb08f897e569ed85af8..034313cef6e7120907c2d2af16df5c4c547a80fa 100644 (file)
@@ -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.  */
 
 #include <linux/posix_types.h>
+#include <linux/kernel.h>
 #include "ansidecl.h"
 #include "ppc.h"
 
@@ -2669,8 +2670,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 
 };
 
-const int powerpc_num_opcodes =
-  sizeof (powerpc_opcodes) / sizeof (powerpc_opcodes[0]);
+const int powerpc_num_opcodes = ARRAY_SIZE(powerpc_opcodes);
 \f
 /* The macro table.  This is only used by the assembler.  */
 
@@ -2717,5 +2717,4 @@ const struct powerpc_macro powerpc_macros[] = {
 
 };
 
-const int powerpc_num_macros =
-  sizeof (powerpc_macros) / sizeof (powerpc_macros[0]);
+const int powerpc_num_macros = ARRAY_SIZE(powerpc_macros);