public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] s390/mm: Silence compiler warning when compiling without CONFIG_PGSTE
@ 2019-04-07 12:55 Thomas Huth
  2019-04-08  7:09 ` David Hildenbrand
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Huth @ 2019-04-07 12:55 UTC (permalink / raw)
  To: Martin Schwidefsky, Heiko Carstens, linux-s390
  Cc: David Hildenbrand, linux-kernel

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@redhat.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
 
 pmd_t pmdp_xchg_direct(struct mm_struct *mm, unsigned long addr,
 		       pmd_t *pmdp, pmd_t new)
-- 
2.21.0


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

* Re: [PATCH] s390/mm: Silence compiler warning when compiling without CONFIG_PGSTE
  2019-04-07 12:55 [PATCH] s390/mm: Silence compiler warning when compiling without CONFIG_PGSTE Thomas Huth
@ 2019-04-08  7:09 ` David Hildenbrand
  2019-04-08 10:36   ` Thomas Huth
  0 siblings, 1 reply; 4+ messages in thread
From: David Hildenbrand @ 2019-04-08  7:09 UTC (permalink / raw)
  To: Thomas Huth, Martin Schwidefsky, Heiko Carstens, linux-s390; +Cc: linux-kernel

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@redhat.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

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

-- 

Thanks,

David / dhildenb

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

* Re: [PATCH] s390/mm: Silence compiler warning when compiling without CONFIG_PGSTE
  2019-04-08  7:09 ` David Hildenbrand
@ 2019-04-08 10:36   ` Thomas Huth
  2019-04-08 13:28     ` Heiko Carstens
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Huth @ 2019-04-08 10:36 UTC (permalink / raw)
  To: David Hildenbrand, Martin Schwidefsky, Heiko Carstens, linux-s390
  Cc: linux-kernel

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@redhat.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@redhat.com>

 Thanks,
  Thomas

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

* Re: [PATCH] s390/mm: Silence compiler warning when compiling without CONFIG_PGSTE
  2019-04-08 10:36   ` Thomas Huth
@ 2019-04-08 13:28     ` Heiko Carstens
  0 siblings, 0 replies; 4+ messages in thread
From: Heiko Carstens @ 2019-04-08 13:28 UTC (permalink / raw)
  To: Thomas Huth
  Cc: David Hildenbrand, Martin Schwidefsky, linux-s390, linux-kernel

On Mon, Apr 08, 2019 at 12:36:32PM +0200, Thomas Huth wrote:
> 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@redhat.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?

Applied without changes. Thanks!


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

end of thread, other threads:[~2019-04-08 13:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-07 12:55 [PATCH] s390/mm: Silence compiler warning when compiling without CONFIG_PGSTE Thomas Huth
2019-04-08  7:09 ` David Hildenbrand
2019-04-08 10:36   ` Thomas Huth
2019-04-08 13:28     ` Heiko Carstens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox