linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/memblock: remove redundant assignment to variable max_addr
@ 2020-02-28 23:50 Colin King
  2020-02-29  7:47 ` Pankaj Gupta
  2020-03-01  6:33 ` Mike Rapoport
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2020-02-28 23:50 UTC (permalink / raw)
  To: Mike Rapoport, Andrew Morton, linux-mm; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 mm/memblock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index eba94ee3de0b..4d06bbaded0f 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -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;
-- 
2.25.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm/memblock: remove redundant assignment to variable max_addr
  2020-02-28 23:50 [PATCH] mm/memblock: remove redundant assignment to variable max_addr Colin King
@ 2020-02-29  7:47 ` Pankaj Gupta
  2020-03-01  6:33 ` Mike Rapoport
  1 sibling, 0 replies; 3+ messages in thread
From: Pankaj Gupta @ 2020-02-29  7:47 UTC (permalink / raw)
  To: Colin King
  Cc: Mike Rapoport, Andrew Morton, linux-mm, kernel-janitors, linux-kernel

>
> From: Colin Ian King <colin.king@canonical.com>
>
> 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")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  mm/memblock.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memblock.c b/mm/memblock.c
> index eba94ee3de0b..4d06bbaded0f 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -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;
> --
> 2.25.0

Reviewed-by: Pankaj Gupta <pankaj.gupta.linux@gmail.com>

>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm/memblock: remove redundant assignment to variable max_addr
  2020-02-28 23:50 [PATCH] mm/memblock: remove redundant assignment to variable max_addr Colin King
  2020-02-29  7:47 ` Pankaj Gupta
@ 2020-03-01  6:33 ` Mike Rapoport
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Rapoport @ 2020-03-01  6:33 UTC (permalink / raw)
  To: Colin King; +Cc: Andrew Morton, linux-mm, kernel-janitors, linux-kernel

On Fri, Feb 28, 2020 at 11:50:03PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>

> ---
>  mm/memblock.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memblock.c b/mm/memblock.c
> index eba94ee3de0b..4d06bbaded0f 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -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;
> -- 
> 2.25.0
> 

-- 
Sincerely yours,
Mike.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-01  6:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-28 23:50 [PATCH] mm/memblock: remove redundant assignment to variable max_addr Colin King
2020-02-29  7:47 ` Pankaj Gupta
2020-03-01  6:33 ` Mike Rapoport

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).