[AVR32] Use ARRAY_SIZE macro when appropriate
A patch to use ARRAY_SIZE macro already defined in linux/kernel.h Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com> Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
This commit is contained in:
parent
6eb484fe92
commit
10b50b7dd2
@ -16,6 +16,7 @@
|
|||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/root_dev.h>
|
#include <linux/root_dev.h>
|
||||||
#include <linux/cpu.h>
|
#include <linux/cpu.h>
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
|
||||||
#include <asm/sections.h>
|
#include <asm/sections.h>
|
||||||
#include <asm/processor.h>
|
#include <asm/processor.h>
|
||||||
@ -174,8 +175,7 @@ static int __init parse_tag_mem_range(struct tag *tag,
|
|||||||
* Copy the data so the bootmem init code doesn't need to care
|
* Copy the data so the bootmem init code doesn't need to care
|
||||||
* about it.
|
* about it.
|
||||||
*/
|
*/
|
||||||
if (mem_range_next_free >=
|
if (mem_range_next_free >= ARRAY_SIZE(mem_range_cache))
|
||||||
(sizeof(mem_range_cache) / sizeof(mem_range_cache[0])))
|
|
||||||
panic("Physical memory map too complex!\n");
|
panic("Physical memory map too complex!\n");
|
||||||
|
|
||||||
new = &mem_range_cache[mem_range_next_free++];
|
new = &mem_range_cache[mem_range_next_free++];
|
||||||
|
Loading…
Reference in New Issue
Block a user