MIPS: pmcs-msp71xx: Add missing MAX_PROM_MEM definition

Commit b3c948e2c0 ("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 <paul.burton@mips.com>
Fixes: b3c948e2c0 ("MIPS: msp: Record prom memory")
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: linux-mips@vger.kernel.org
This commit is contained in:
Paul Burton 2019-10-03 22:46:23 +00:00
parent 25b69a889b
commit 101c40ed26
No known key found for this signature in database
GPG Key ID: 3EA79FACB57500DD
1 changed files with 2 additions and 1 deletions

View File

@ -61,6 +61,7 @@ int init_debug = 1;
/* memory blocks */
struct prom_pmemblock mdesc[PROM_MAX_PMEMBLOCKS];
#define MAX_PROM_MEM 5
static phys_addr_t prom_mem_base[MAX_PROM_MEM] __initdata;
static phys_addr_t prom_mem_size[MAX_PROM_MEM] __initdata;
static unsigned int nr_prom_mem __initdata;
@ -358,7 +359,7 @@ void __init prom_meminit(void)
p++;
if (type == BOOT_MEM_ROM_DATA) {
if (nr_prom_mem >= 5) {
if (nr_prom_mem >= MAX_PROM_MEM) {
pr_err("Too many ROM DATA regions");
continue;
}