lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <84da6d4e-9b85-1c3b-4f48-bdb19ac7f650@redhat.com>
Date:   Mon, 8 Apr 2019 12:36:32 +0200
From:   Thomas Huth <thuth@...hat.com>
To:     David Hildenbrand <david@...hat.com>,
        Martin Schwidefsky <schwidefsky@...ibm.com>,
        Heiko Carstens <heiko.carstens@...ibm.com>,
        linux-s390@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH] s390/mm: Silence compiler warning when compiling without
 CONFIG_PGSTE

On 08/04/2019 09.09, David Hildenbrand wrote:
> On 07.04.19 14:55, Thomas Huth wrote:
>> If CONFIG_PGSTE is not set (e.g. when compiling without KVM), GCC complains:
>>
>>   CC      arch/s390/mm/pgtable.o
>> arch/s390/mm/pgtable.c:413:15: warning: ‘pmd_alloc_map’ defined but not
>>  used [-Wunused-function]
>>  static pmd_t *pmd_alloc_map(struct mm_struct *mm, unsigned long addr)
>>                ^~~~~~~~~~~~~
>>
>> Wrap the function with "#ifdef CONFIG_PGSTE" to silence the warning.
>>
>> Signed-off-by: Thomas Huth <thuth@...hat.com>
>> ---
>>  arch/s390/mm/pgtable.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
>> index 8485d6dc2754..9ebd01219812 100644
>> --- a/arch/s390/mm/pgtable.c
>> +++ b/arch/s390/mm/pgtable.c
>> @@ -410,6 +410,7 @@ static inline pmd_t pmdp_flush_lazy(struct mm_struct *mm,
>>  	return old;
>>  }
>>  
>> +#ifdef CONFIG_PGSTE
>>  static pmd_t *pmd_alloc_map(struct mm_struct *mm, unsigned long addr)
>>  {
>>  	pgd_t *pgd;
>> @@ -427,6 +428,7 @@ static pmd_t *pmd_alloc_map(struct mm_struct *mm, unsigned long addr)
>>  	pmd = pmd_alloc(mm, pud, addr);
>>  	return pmd;
>>  }
>> +#endif
>>  
> 
> We could also move the function down to the functions where it is used

Yeah, I thought about that, too. Both have advantages:

- If we keep the code here, "git blame" shows a nicer history of these
  lines
- If we move the code, we need less #ifdefs

I'll leave the decision to the maintainers... Martin, Heiko?

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

 Thanks,
  Thomas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ