Commit bf0059b2 authored by Ahmed S. Darwish's avatar Ahmed S. Darwish Committed by Linus Torvalds

[PATCH] M68KNOMMU: user 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>
Signed-off-by: default avatarGreg Ungerer <gerg@uclinux.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent dc29a365
...@@ -62,7 +62,7 @@ static inline long get_reg(struct task_struct *task, int regno) ...@@ -62,7 +62,7 @@ static inline long get_reg(struct task_struct *task, int regno)
if (regno == PT_USP) if (regno == PT_USP)
addr = &task->thread.usp; addr = &task->thread.usp;
else if (regno < sizeof(regoff)/sizeof(regoff[0])) else if (regno < ARRAY_SIZE(regoff))
addr = (unsigned long *)(task->thread.esp0 + regoff[regno]); addr = (unsigned long *)(task->thread.esp0 + regoff[regno]);
else else
return 0; return 0;
...@@ -79,7 +79,7 @@ static inline int put_reg(struct task_struct *task, int regno, ...@@ -79,7 +79,7 @@ static inline int put_reg(struct task_struct *task, int regno,
if (regno == PT_USP) if (regno == PT_USP)
addr = &task->thread.usp; addr = &task->thread.usp;
else if (regno < sizeof(regoff)/sizeof(regoff[0])) else if (regno < ARRAY_SIZE(regoff))
addr = (unsigned long *) (task->thread.esp0 + regoff[regno]); addr = (unsigned long *) (task->thread.esp0 + regoff[regno]);
else else
return -1; return -1;
......
...@@ -158,7 +158,7 @@ void show_stack(struct task_struct *task, unsigned long *stack) ...@@ -158,7 +158,7 @@ void show_stack(struct task_struct *task, unsigned long *stack)
void bad_super_trap(struct frame *fp) void bad_super_trap(struct frame *fp)
{ {
console_verbose(); console_verbose();
if (fp->ptregs.vector < 4*sizeof(vec_names)/sizeof(vec_names[0])) if (fp->ptregs.vector < 4 * ARRAY_SIZE(vec_names))
printk (KERN_WARNING "*** %s *** FORMAT=%X\n", printk (KERN_WARNING "*** %s *** FORMAT=%X\n",
vec_names[(fp->ptregs.vector) >> 2], vec_names[(fp->ptregs.vector) >> 2],
fp->ptregs.format); fp->ptregs.format);
......
Markdown is supported
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