All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] mm/page_isolation: fix clang deadcode warning
@ 2022-10-21  5:19 Maria Yu
  2022-10-21  5:19 ` [PATCH v2 1/1] " Maria Yu
  0 siblings, 1 reply; 4+ messages in thread
From: Maria Yu @ 2022-10-21  5:19 UTC (permalink / raw)
  To: akpm, ziy, david, linux-kernel, linux-mm; +Cc: Maria Yu, mike.kravetz, opendmb

When !CONFIG_VM_BUG_ON, there is warning of
clang-analyzer-deadcode.DeadStores:
Value stored to 'mt' during its initialization
is never read.

Difference with previous patch is just to make it
new lines as it is too long for single line.

Feel free to give comments and suggestions. Thanks.

previous discussion here:
[1] https://lore.kernel.org/linux-mm/20221021030953.34925-1-quic_aiquny@quicinc.com/

Maria Yu (1):
  mm/page_isolation: fix clang deadcode warning

 mm/page_isolation.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

-- 
2.17.1


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

* [PATCH v2 1/1] mm/page_isolation: fix clang deadcode warning
  2022-10-21  5:19 [PATCH v2 0/1] mm/page_isolation: fix clang deadcode warning Maria Yu
@ 2022-10-21  5:19 ` Maria Yu
  2022-10-21  6:54   ` David Hildenbrand
  0 siblings, 1 reply; 4+ messages in thread
From: Maria Yu @ 2022-10-21  5:19 UTC (permalink / raw)
  To: akpm, ziy, david, linux-kernel, linux-mm; +Cc: Maria Yu, mike.kravetz, opendmb

When !CONFIG_VM_BUG_ON, there is warning of
clang-analyzer-deadcode.DeadStores:
Value stored to 'mt' during its initialization
is never read.

Signed-off-by: Maria Yu <quic_aiquny@quicinc.com>
---
 mm/page_isolation.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/page_isolation.c b/mm/page_isolation.c
index 04141a9bea70..a7a478a22123 100644
--- a/mm/page_isolation.c
+++ b/mm/page_isolation.c
@@ -330,9 +330,8 @@ static int isolate_single_pageblock(unsigned long boundary_pfn, int flags,
 				      zone->zone_start_pfn);
 
 	if (skip_isolation) {
-		int mt = get_pageblock_migratetype(pfn_to_page(isolate_pageblock));
-
-		VM_BUG_ON(!is_migrate_isolate(mt));
+		VM_BUG_ON(!is_migrate_isolate(get_pageblock_migratetype(
+						pfn_to_page(isolate_pageblock))));
 	} else {
 		ret = set_migratetype_isolate(pfn_to_page(isolate_pageblock), migratetype,
 				flags, isolate_pageblock, isolate_pageblock + pageblock_nr_pages);
-- 
2.17.1


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

* Re: [PATCH v2 1/1] mm/page_isolation: fix clang deadcode warning
  2022-10-21  5:19 ` [PATCH v2 1/1] " Maria Yu
@ 2022-10-21  6:54   ` David Hildenbrand
  2022-10-21  8:21     ` Aiqun(Maria) Yu
  0 siblings, 1 reply; 4+ messages in thread
From: David Hildenbrand @ 2022-10-21  6:54 UTC (permalink / raw)
  To: Maria Yu, akpm, ziy, linux-kernel, linux-mm; +Cc: mike.kravetz, opendmb

On 21.10.22 07:19, Maria Yu wrote:
> When !CONFIG_VM_BUG_ON, there is warning of
> clang-analyzer-deadcode.DeadStores:
> Value stored to 'mt' during its initialization
> is never read.
> 
> Signed-off-by: Maria Yu <quic_aiquny@quicinc.com>
> ---
>   mm/page_isolation.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/page_isolation.c b/mm/page_isolation.c
> index 04141a9bea70..a7a478a22123 100644
> --- a/mm/page_isolation.c
> +++ b/mm/page_isolation.c
> @@ -330,9 +330,8 @@ static int isolate_single_pageblock(unsigned long boundary_pfn, int flags,
>   				      zone->zone_start_pfn);
>   
>   	if (skip_isolation) {
> -		int mt = get_pageblock_migratetype(pfn_to_page(isolate_pageblock));

__maybe_unused should work as well. Was that considered?

-- 
Thanks,

David / dhildenb


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

* Re: [PATCH v2 1/1] mm/page_isolation: fix clang deadcode warning
  2022-10-21  6:54   ` David Hildenbrand
@ 2022-10-21  8:21     ` Aiqun(Maria) Yu
  0 siblings, 0 replies; 4+ messages in thread
From: Aiqun(Maria) Yu @ 2022-10-21  8:21 UTC (permalink / raw)
  To: David Hildenbrand, akpm, ziy, linux-kernel, linux-mm
  Cc: mike.kravetz, opendmb

On 10/21/2022 2:54 PM, David Hildenbrand wrote:
> On 21.10.22 07:19, Maria Yu wrote:
>> When !CONFIG_VM_BUG_ON, there is warning of
>> clang-analyzer-deadcode.DeadStores:
>> Value stored to 'mt' during its initialization
>> is never read.
>>
>> Signed-off-by: Maria Yu <quic_aiquny@quicinc.com>
>> ---
>>   mm/page_isolation.c | 5 ++---
>>   1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/mm/page_isolation.c b/mm/page_isolation.c
>> index 04141a9bea70..a7a478a22123 100644
>> --- a/mm/page_isolation.c
>> +++ b/mm/page_isolation.c
>> @@ -330,9 +330,8 @@ static int isolate_single_pageblock(unsigned long 
>> boundary_pfn, int flags,
>>                         zone->zone_start_pfn);
>>       if (skip_isolation) {
>> -        int mt = 
>> get_pageblock_migratetype(pfn_to_page(isolate_pageblock));
> 
> __maybe_unused should work as well. Was that considered?
> 
good idea.

-- 
Thx and BRs,
Aiqun(Maria) Yu

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

end of thread, other threads:[~2022-10-21  8:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-21  5:19 [PATCH v2 0/1] mm/page_isolation: fix clang deadcode warning Maria Yu
2022-10-21  5:19 ` [PATCH v2 1/1] " Maria Yu
2022-10-21  6:54   ` David Hildenbrand
2022-10-21  8:21     ` Aiqun(Maria) Yu

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.