Skip to content

Commit 101c40e

Browse files
committed
MIPS: pmcs-msp71xx: Add missing MAX_PROM_MEM definition
Commit b3c948e ("MIPS: msp: Record prom memory") introduced use of a MAX_PROM_MEM value but didn't define it. A bounds check in prom_meminit() suggests its value was supposed to be 5, so define it as such & adjust the bounds check to use the macro rather than a magic number. Signed-off-by: Paul Burton <[email protected]> Fixes: b3c948e ("MIPS: msp: Record prom memory") Cc: Jiaxun Yang <[email protected]> Cc: [email protected]
1 parent 25b69a8 commit 101c40e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/mips/pmcs-msp71xx/msp_prom.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ int init_debug = 1;
6161
/* memory blocks */
6262
struct prom_pmemblock mdesc[PROM_MAX_PMEMBLOCKS];
6363

64+
#define MAX_PROM_MEM 5
6465
static phys_addr_t prom_mem_base[MAX_PROM_MEM] __initdata;
6566
static phys_addr_t prom_mem_size[MAX_PROM_MEM] __initdata;
6667
static unsigned int nr_prom_mem __initdata;
@@ -358,7 +359,7 @@ void __init prom_meminit(void)
358359
p++;
359360

360361
if (type == BOOT_MEM_ROM_DATA) {
361-
if (nr_prom_mem >= 5) {
362+
if (nr_prom_mem >= MAX_PROM_MEM) {
362363
pr_err("Too many ROM DATA regions");
363364
continue;
364365
}

0 commit comments

Comments
 (0)