diff mbox series

[1/2] MIPS: pmcs-msp71xx: Add missing MAX_PROM_MEM definition

Message ID 20191003224611.727276-1-paul.burton@mips.com (mailing list archive)
State Mainlined
Commit 101c40ed269ccf67d3535bf2d131584008edbbd1
Headers show
Series [1/2] MIPS: pmcs-msp71xx: Add missing MAX_PROM_MEM definition | expand

Commit Message

Paul Burton Oct. 3, 2019, 10:46 p.m. UTC
Commit b3c948e2c00f ("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: b3c948e2c00f ("MIPS: msp: Record prom memory")
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
---

 arch/mips/pmcs-msp71xx/msp_prom.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Paul Burton Oct. 3, 2019, 10:54 p.m. UTC | #1
Hello,

Paul Burton wrote:
> Commit b3c948e2c00f ("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.

Series applied to mips-fixes.

> MIPS: pmcs-msp71xx: Add missing MAX_PROM_MEM definition
>   commit 101c40ed269c
>   https://git.kernel.org/mips/c/101c40ed269c
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
>   Fixes: b3c948e2c00f ("MIPS: msp: Record prom memory")
> 
> MIPS: pmcs-msp71xx: Remove unused addr variable
>   commit 437450cf09c3
>   https://git.kernel.org/mips/c/437450cf09c3
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
>   Fixes: b3c948e2c00f ("MIPS: msp: Record prom memory")

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paul.burton@mips.com to report it. ]
diff mbox series

Patch

diff --git a/arch/mips/pmcs-msp71xx/msp_prom.c b/arch/mips/pmcs-msp71xx/msp_prom.c
index dfb527961a27..f87c522a63e6 100644
--- a/arch/mips/pmcs-msp71xx/msp_prom.c
+++ b/arch/mips/pmcs-msp71xx/msp_prom.c
@@ -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;
 			}