Skip to contentSkip to conversation

mm/memblock: remove redundant assignment to variable max_addr

PATCH Applied Colin King 3 participants 3 messages Feb 28, 2020 – Mar 1, 2020

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 mm/memblock: remove redundant assignment to variable max_addr

From: Colin Ian King <[email protected]>

The variable max_addr is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 mm/memblock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memblock.c +1 -1
index eba94ee3de0b..4d06bbaded0f 100644
@@ -1698,7 +1698,7 @@ static phys_addr_t __init_memblock __find_max_addr(phys_addr_t limit)
 
 void __init memblock_enforce_memory_limit(phys_addr_t limit)
 {
-	phys_addr_t max_addr = PHYS_ADDR_MAX;
+	phys_addr_t max_addr;
 
 	if (!limit)
 		return;
Signature · 1 line
2.25.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines

From: Colin Ian King <[email protected]>

The variable max_addr is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 mm/memblock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memblock.c +1 -2
index eba94ee3de0b..4d06bbaded0f 100644
@@ -1698,7 +1698,7 @@ static phys_addr_t __init_memblock __find_max_addr(phys_addr_t limit)
 
 void __init memblock_enforce_memory_limit(phys_addr_t limit)
 {
-       phys_addr_t max_addr = PHYS_ADDR_MAX;
+       phys_addr_t max_addr;
 
        if (!limit)
                return;
--
Quoted 1 line

2.25.0

Quoted 2 lines
Reviewed-by on v1 1/1
#2 lore raw
In reply to Colin King
Quoted 8 lines · Colin King

From: Colin Ian King <[email protected]>

The variable max_addr is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

Quoted 20 lines
---
 mm/memblock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memblock.c +1 -1
index eba94ee3de0b..4d06bbaded0f 100644
@@ -1698,7 +1698,7 @@ static phys_addr_t __init_memblock __find_max_addr(phys_addr_t limit)
 
 void __init memblock_enforce_memory_limit(phys_addr_t limit)
 {
-	phys_addr_t max_addr = PHYS_ADDR_MAX;
+	phys_addr_t max_addr;
 
 	if (!limit)
 		return;
Signature · 1 line
2.25.0
Signature · 2 lines
Sincerely yours,
Mike.