Re: [PATCH v2] mm/hugepages: fix "orig_pud" set but not used

From: Qian Cai
Date: Mon Mar 04 2019 - 09:09:18 EST




On 3/4/19 7:02 AM, Souptick Joarder wrote:
> On Sat, Mar 2, 2019 at 3:50 AM Qian Cai <cai@xxxxxx> wrote:
>>
>> The commit a00cc7d9dd93 ("mm, x86: add support for PUD-sized transparent
>> hugepages") introduced pudp_huge_get_and_clear_full() but no one uses
>> its return code. In order to not diverge from
>> pmdp_huge_get_and_clear_full(), just change zap_huge_pud() to not assign
>> the return value from pudp_huge_get_and_clear_full().
>>
>> mm/huge_memory.c: In function 'zap_huge_pud':
>> mm/huge_memory.c:1982:8: warning: variable 'orig_pud' set but not used
>> [-Wunused-but-set-variable]
>> pud_t orig_pud;
>> ^~~~~~~~
>>
>
> 4th argument passed to pudp_huge_get_and_clear_full() is not used.
> Is it fine to remove *int full * in pudp_huge_get_and_clear_full() if
> there is no plan to use it in future ?
>
> This is applicable to below functions as well -
> pmdp_huge_get_and_clear_full()
> ptep_get_and_clear_full()
> pte_clear_not_present_full()

I suppose arches may override those that could make use of "int full".