All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: Remove unwanted initialization in vmemmap_populate_compound_pages()
@ 2022-06-12 18:23 Gautam Menghani
  2022-06-13  7:18 ` Muchun Song
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Gautam Menghani @ 2022-06-12 18:23 UTC (permalink / raw)
  To: akpm; +Cc: Gautam Menghani, linux-mm, linux-kernel

Remove unwanted initialization for the variable 'next'. This fixes the
clang scan warning: Value stored to 'next' during its initialization is 
never read [deadcode.DeadStores]

Signed-off-by: Gautam Menghani <gautammenghani201@gmail.com>
---
 mm/sparse-vmemmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
index f4fa61dbbee3..3008aa7859e0 100644
--- a/mm/sparse-vmemmap.c
+++ b/mm/sparse-vmemmap.c
@@ -737,7 +737,7 @@ static int __meminit vmemmap_populate_compound_pages(unsigned long start_pfn,
 
 	size = min(end - start, pgmap_vmemmap_nr(pgmap) * sizeof(struct page));
 	for (addr = start; addr < end; addr += size) {
-		unsigned long next = addr, last = addr + size;
+		unsigned long next, last = addr + size;
 
 		/* Populate the head page vmemmap page */
 		pte = vmemmap_populate_address(addr, node, NULL, NULL);
-- 
2.25.1


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

* Re: [PATCH] mm: Remove unwanted initialization in vmemmap_populate_compound_pages()
  2022-06-12 18:23 [PATCH] mm: Remove unwanted initialization in vmemmap_populate_compound_pages() Gautam Menghani
@ 2022-06-13  7:18 ` Muchun Song
  2022-06-13 15:43 ` David Hildenbrand
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Muchun Song @ 2022-06-13  7:18 UTC (permalink / raw)
  To: Gautam Menghani; +Cc: akpm, linux-mm, linux-kernel

On Sun, Jun 12, 2022 at 11:23:20AM -0700, Gautam Menghani wrote:
> Remove unwanted initialization for the variable 'next'. This fixes the
> clang scan warning: Value stored to 'next' during its initialization is 
> never read [deadcode.DeadStores]
> 
> Signed-off-by: Gautam Menghani <gautammenghani201@gmail.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.

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

* Re: [PATCH] mm: Remove unwanted initialization in vmemmap_populate_compound_pages()
  2022-06-12 18:23 [PATCH] mm: Remove unwanted initialization in vmemmap_populate_compound_pages() Gautam Menghani
  2022-06-13  7:18 ` Muchun Song
@ 2022-06-13 15:43 ` David Hildenbrand
  2022-06-14 10:33 ` Joao Martins
  2022-06-15  7:34 ` Oscar Salvador
  3 siblings, 0 replies; 5+ messages in thread
From: David Hildenbrand @ 2022-06-13 15:43 UTC (permalink / raw)
  To: Gautam Menghani, akpm; +Cc: linux-mm, linux-kernel

On 12.06.22 20:23, Gautam Menghani wrote:
> Remove unwanted initialization for the variable 'next'. This fixes the
> clang scan warning: Value stored to 'next' during its initialization is 
> never read [deadcode.DeadStores]
> 

Nit: s/unwanted/unnecessary/

Reviewed-by: David Hildenbrand <david@redhat.com>

> Signed-off-by: Gautam Menghani <gautammenghani201@gmail.com>
> ---
>  mm/sparse-vmemmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
> index f4fa61dbbee3..3008aa7859e0 100644
> --- a/mm/sparse-vmemmap.c
> +++ b/mm/sparse-vmemmap.c
> @@ -737,7 +737,7 @@ static int __meminit vmemmap_populate_compound_pages(unsigned long start_pfn,
>  
>  	size = min(end - start, pgmap_vmemmap_nr(pgmap) * sizeof(struct page));
>  	for (addr = start; addr < end; addr += size) {
> -		unsigned long next = addr, last = addr + size;
> +		unsigned long next, last = addr + size;
>  
>  		/* Populate the head page vmemmap page */
>  		pte = vmemmap_populate_address(addr, node, NULL, NULL);


-- 
Thanks,

David / dhildenb


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

* Re: [PATCH] mm: Remove unwanted initialization in vmemmap_populate_compound_pages()
  2022-06-12 18:23 [PATCH] mm: Remove unwanted initialization in vmemmap_populate_compound_pages() Gautam Menghani
  2022-06-13  7:18 ` Muchun Song
  2022-06-13 15:43 ` David Hildenbrand
@ 2022-06-14 10:33 ` Joao Martins
  2022-06-15  7:34 ` Oscar Salvador
  3 siblings, 0 replies; 5+ messages in thread
From: Joao Martins @ 2022-06-14 10:33 UTC (permalink / raw)
  To: Gautam Menghani; +Cc: linux-mm, linux-kernel, akpm

On 6/12/22 19:23, Gautam Menghani wrote:
> Remove unwanted initialization for the variable 'next'. This fixes the
> clang scan warning: Value stored to 'next' during its initialization is 
> never read [deadcode.DeadStores]
> 
> Signed-off-by: Gautam Menghani <gautammenghani201@gmail.com>

Ugh, thanks for catching that:

Reviewed-by: Joao Martins <joao.m.martins@oracle.com>

> ---
>  mm/sparse-vmemmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
> index f4fa61dbbee3..3008aa7859e0 100644
> --- a/mm/sparse-vmemmap.c
> +++ b/mm/sparse-vmemmap.c
> @@ -737,7 +737,7 @@ static int __meminit vmemmap_populate_compound_pages(unsigned long start_pfn,
>  
>  	size = min(end - start, pgmap_vmemmap_nr(pgmap) * sizeof(struct page));
>  	for (addr = start; addr < end; addr += size) {
> -		unsigned long next = addr, last = addr + size;
> +		unsigned long next, last = addr + size;
>  
>  		/* Populate the head page vmemmap page */
>  		pte = vmemmap_populate_address(addr, node, NULL, NULL);

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

* Re: [PATCH] mm: Remove unwanted initialization in vmemmap_populate_compound_pages()
  2022-06-12 18:23 [PATCH] mm: Remove unwanted initialization in vmemmap_populate_compound_pages() Gautam Menghani
                   ` (2 preceding siblings ...)
  2022-06-14 10:33 ` Joao Martins
@ 2022-06-15  7:34 ` Oscar Salvador
  3 siblings, 0 replies; 5+ messages in thread
From: Oscar Salvador @ 2022-06-15  7:34 UTC (permalink / raw)
  To: Gautam Menghani; +Cc: akpm, linux-mm, linux-kernel

On Sun, Jun 12, 2022 at 11:23:20AM -0700, Gautam Menghani wrote:
> Remove unwanted initialization for the variable 'next'. This fixes the
> clang scan warning: Value stored to 'next' during its initialization is 
> never read [deadcode.DeadStores]
> 
> Signed-off-by: Gautam Menghani <gautammenghani201@gmail.com>

Reviewed-by: Oscar Salvador <osalvador@suse.de>


-- 
Oscar Salvador
SUSE Labs

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

end of thread, other threads:[~2022-06-15  7:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-12 18:23 [PATCH] mm: Remove unwanted initialization in vmemmap_populate_compound_pages() Gautam Menghani
2022-06-13  7:18 ` Muchun Song
2022-06-13 15:43 ` David Hildenbrand
2022-06-14 10:33 ` Joao Martins
2022-06-15  7:34 ` Oscar Salvador

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.