public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] MIPS: add declaration for function `memory_region_available`
@ 2017-12-26 11:37 Mathieu Malaterre
  2017-12-26 11:37 ` [PATCH 2/2] MIPS: Remove a warning when PHYS_OFFSET is 0x0 Mathieu Malaterre
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Mathieu Malaterre @ 2017-12-26 11:37 UTC (permalink / raw)
  Cc: Mathieu Malaterre, Ralf Baechle, Marcin Nowakowski, David Daney,
	Goran Ferenc, Miodrag Dinic, linux-mips, linux-kernel

Fix non-fatal warning:

arch/mips/kernel/setup.c:158:13: warning: no previous prototype for ‘memory_region_available’ [-Wmissing-prototypes]
 bool __init memory_region_available(phys_addr_t start, phys_addr_t size)
             ^~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/mips/include/asm/bootinfo.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/include/asm/bootinfo.h b/arch/mips/include/asm/bootinfo.h
index e26a093bb17a..32e3c9a2c5a0 100644
--- a/arch/mips/include/asm/bootinfo.h
+++ b/arch/mips/include/asm/bootinfo.h
@@ -108,6 +108,7 @@ extern struct boot_mem_map boot_mem_map;
 
 extern void add_memory_region(phys_addr_t start, phys_addr_t size, long type);
 extern void detect_memory_region(phys_addr_t start, phys_addr_t sz_min,  phys_addr_t sz_max);
+extern bool memory_region_available(phys_addr_t start, phys_addr_t size);
 
 extern void prom_init(void);
 extern void prom_free_prom_memory(void);
-- 
2.11.0

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

* [PATCH 2/2] MIPS: Remove a warning when PHYS_OFFSET is 0x0
  2017-12-26 11:37 [PATCH 1/2] MIPS: add declaration for function `memory_region_available` Mathieu Malaterre
@ 2017-12-26 11:37 ` Mathieu Malaterre
  2018-01-02  9:31   ` James Hogan
  2018-01-02 18:53   ` [PATCH v2 " Mathieu Malaterre
  2018-01-02  9:51 ` [PATCH 1/2] MIPS: add declaration for function `memory_region_available` James Hogan
  2018-01-02 18:52 ` [PATCH v2 1/2] MIPS: Make declaration for function `memory_region_available` static Mathieu Malaterre
  2 siblings, 2 replies; 9+ messages in thread
From: Mathieu Malaterre @ 2017-12-26 11:37 UTC (permalink / raw)
  Cc: Mathieu Malaterre, Ralf Baechle, Marcin Nowakowski, Miodrag Dinic,
	James Hogan, Aleksandar Markovic, David Daney, linux-mips,
	linux-kernel

Rewrite the comparison in `else if` statement, case where `min_low_pfn >
ARCH_PFN_OFFSET` has already been checked in the first `if` statement:

  if (min_low_pfn > ARCH_PFN_OFFSET) {

Fix non-fatal warning:

arch/mips/kernel/setup.c: In function ‘bootmem_init’:
arch/mips/kernel/setup.c:461:25: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  } else if (min_low_pfn < ARCH_PFN_OFFSET) {
                         ^

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/mips/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index f19d61224c71..073695ccc1aa 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -458,7 +458,7 @@ static void __init bootmem_init(void)
 		pr_info("Wasting %lu bytes for tracking %lu unused pages\n",
 			(min_low_pfn - ARCH_PFN_OFFSET) * sizeof(struct page),
 			min_low_pfn - ARCH_PFN_OFFSET);
-	} else if (min_low_pfn < ARCH_PFN_OFFSET) {
+	} else if (ARCH_PFN_OFFSET - min_low_pfn > 0UL) {
 		pr_info("%lu free pages won't be used\n",
 			ARCH_PFN_OFFSET - min_low_pfn);
 	}
-- 
2.11.0

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

* Re: [PATCH 2/2] MIPS: Remove a warning when PHYS_OFFSET is 0x0
  2017-12-26 11:37 ` [PATCH 2/2] MIPS: Remove a warning when PHYS_OFFSET is 0x0 Mathieu Malaterre
@ 2018-01-02  9:31   ` James Hogan
  2018-01-02 18:55     ` Mathieu Malaterre
  2018-01-02 18:53   ` [PATCH v2 " Mathieu Malaterre
  1 sibling, 1 reply; 9+ messages in thread
From: James Hogan @ 2018-01-02  9:31 UTC (permalink / raw)
  To: Mathieu Malaterre
  Cc: Ralf Baechle, Marcin Nowakowski, Miodrag Dinic,
	Aleksandar Markovic, David Daney, linux-mips, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1488 bytes --]

On Tue, Dec 26, 2017 at 12:37:14PM +0100, Mathieu Malaterre wrote:
> Rewrite the comparison in `else if` statement, case where `min_low_pfn >
> ARCH_PFN_OFFSET` has already been checked in the first `if` statement:
> 
>   if (min_low_pfn > ARCH_PFN_OFFSET) {
> 
> Fix non-fatal warning:
> 
> arch/mips/kernel/setup.c: In function ‘bootmem_init’:
> arch/mips/kernel/setup.c:461:25: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
>   } else if (min_low_pfn < ARCH_PFN_OFFSET) {
>                          ^

What compiler version is that with out of interest? It isn't exactly new
code.

> 
> Signed-off-by: Mathieu Malaterre <malat@debian.org>

Reviewed-by: James Hogan <jhogan@kernel.org>

Cheers
James

> ---
>  arch/mips/kernel/setup.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
> index f19d61224c71..073695ccc1aa 100644
> --- a/arch/mips/kernel/setup.c
> +++ b/arch/mips/kernel/setup.c
> @@ -458,7 +458,7 @@ static void __init bootmem_init(void)
>  		pr_info("Wasting %lu bytes for tracking %lu unused pages\n",
>  			(min_low_pfn - ARCH_PFN_OFFSET) * sizeof(struct page),
>  			min_low_pfn - ARCH_PFN_OFFSET);
> -	} else if (min_low_pfn < ARCH_PFN_OFFSET) {
> +	} else if (ARCH_PFN_OFFSET - min_low_pfn > 0UL) {
>  		pr_info("%lu free pages won't be used\n",
>  			ARCH_PFN_OFFSET - min_low_pfn);
>  	}
> -- 
> 2.11.0
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 1/2] MIPS: add declaration for function `memory_region_available`
  2017-12-26 11:37 [PATCH 1/2] MIPS: add declaration for function `memory_region_available` Mathieu Malaterre
  2017-12-26 11:37 ` [PATCH 2/2] MIPS: Remove a warning when PHYS_OFFSET is 0x0 Mathieu Malaterre
@ 2018-01-02  9:51 ` James Hogan
  2018-01-02 18:52 ` [PATCH v2 1/2] MIPS: Make declaration for function `memory_region_available` static Mathieu Malaterre
  2 siblings, 0 replies; 9+ messages in thread
From: James Hogan @ 2018-01-02  9:51 UTC (permalink / raw)
  To: Mathieu Malaterre
  Cc: Ralf Baechle, Marcin Nowakowski, David Daney, Goran Ferenc,
	Miodrag Dinic, linux-mips, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]

On Tue, Dec 26, 2017 at 12:37:13PM +0100, Mathieu Malaterre wrote:
> Fix non-fatal warning:
> 
> arch/mips/kernel/setup.c:158:13: warning: no previous prototype for ‘memory_region_available’ [-Wmissing-prototypes]
>  bool __init memory_region_available(phys_addr_t start, phys_addr_t size)
>              ^~~~~~~~~~~~~~~~~~~~~~~

It only seems to be referenced from that one file, so making it static
and __maybe_unused to handle the configs it isn't used would probably be
better.

Thanks
James

> 
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
> ---
>  arch/mips/include/asm/bootinfo.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/mips/include/asm/bootinfo.h b/arch/mips/include/asm/bootinfo.h
> index e26a093bb17a..32e3c9a2c5a0 100644
> --- a/arch/mips/include/asm/bootinfo.h
> +++ b/arch/mips/include/asm/bootinfo.h
> @@ -108,6 +108,7 @@ extern struct boot_mem_map boot_mem_map;
>  
>  extern void add_memory_region(phys_addr_t start, phys_addr_t size, long type);
>  extern void detect_memory_region(phys_addr_t start, phys_addr_t sz_min,  phys_addr_t sz_max);
> +extern bool memory_region_available(phys_addr_t start, phys_addr_t size);
>  
>  extern void prom_init(void);
>  extern void prom_free_prom_memory(void);
> -- 
> 2.11.0
> 
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [PATCH v2 1/2] MIPS: Make declaration for function `memory_region_available` static
  2017-12-26 11:37 [PATCH 1/2] MIPS: add declaration for function `memory_region_available` Mathieu Malaterre
  2017-12-26 11:37 ` [PATCH 2/2] MIPS: Remove a warning when PHYS_OFFSET is 0x0 Mathieu Malaterre
  2018-01-02  9:51 ` [PATCH 1/2] MIPS: add declaration for function `memory_region_available` James Hogan
@ 2018-01-02 18:52 ` Mathieu Malaterre
  2 siblings, 0 replies; 9+ messages in thread
From: Mathieu Malaterre @ 2018-01-02 18:52 UTC (permalink / raw)
  To: James Hogan; +Cc: Mathieu Malaterre, Ralf Baechle, linux-mips, linux-kernel

Fix non-fatal warning during compilation using W=1:

arch/mips/kernel/setup.c:158:13: warning: no previous prototype for ‘memory_region_available’ [-Wmissing-prototypes]
 bool __init memory_region_available(phys_addr_t start, phys_addr_t size)
             ^~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
v2: Prefer static declaration, clarify W=1 in commit message
 arch/mips/kernel/setup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index f19d61224c71..68db4bdd3255 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -155,7 +155,8 @@ void __init detect_memory_region(phys_addr_t start, phys_addr_t sz_min, phys_add
 	add_memory_region(start, size, BOOT_MEM_RAM);
 }
 
-bool __init memory_region_available(phys_addr_t start, phys_addr_t size)
+static bool __init __maybe_unused memory_region_available(phys_addr_t start,
+	phys_addr_t size)
 {
 	int i;
 	bool in_ram = false, free = true;
-- 
2.11.0

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

* [PATCH v2 2/2] MIPS: Remove a warning when PHYS_OFFSET is 0x0
  2017-12-26 11:37 ` [PATCH 2/2] MIPS: Remove a warning when PHYS_OFFSET is 0x0 Mathieu Malaterre
  2018-01-02  9:31   ` James Hogan
@ 2018-01-02 18:53   ` Mathieu Malaterre
  1 sibling, 0 replies; 9+ messages in thread
From: Mathieu Malaterre @ 2018-01-02 18:53 UTC (permalink / raw)
  To: James Hogan; +Cc: Mathieu Malaterre, Ralf Baechle, linux-mips, linux-kernel

Rewrite the comparison in `else if` statement, case where `min_low_pfn >
ARCH_PFN_OFFSET` has already been checked in the first `if` statement:

  if (min_low_pfn > ARCH_PFN_OFFSET) {

Fix non-fatal warning during compilation using W=1:

arch/mips/kernel/setup.c: In function ‘bootmem_init’:
arch/mips/kernel/setup.c:461:25: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  } else if (min_low_pfn < ARCH_PFN_OFFSET) {
                         ^

Reviewed-by: James Hogan <jhogan@kernel.org>
Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
v2: clarify W=1 in commit message
 arch/mips/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 68db4bdd3255..791dc78b132b 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -459,7 +459,7 @@ static void __init bootmem_init(void)
 		pr_info("Wasting %lu bytes for tracking %lu unused pages\n",
 			(min_low_pfn - ARCH_PFN_OFFSET) * sizeof(struct page),
 			min_low_pfn - ARCH_PFN_OFFSET);
-	} else if (min_low_pfn < ARCH_PFN_OFFSET) {
+	} else if (ARCH_PFN_OFFSET - min_low_pfn > 0UL) {
 		pr_info("%lu free pages won't be used\n",
 			ARCH_PFN_OFFSET - min_low_pfn);
 	}
-- 
2.11.0

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

* Re: [PATCH 2/2] MIPS: Remove a warning when PHYS_OFFSET is 0x0
  2018-01-02  9:31   ` James Hogan
@ 2018-01-02 18:55     ` Mathieu Malaterre
  2018-02-14 10:35       ` Mathieu Malaterre
  0 siblings, 1 reply; 9+ messages in thread
From: Mathieu Malaterre @ 2018-01-02 18:55 UTC (permalink / raw)
  To: James Hogan
  Cc: Ralf Baechle, Marcin Nowakowski, Miodrag Dinic,
	Aleksandar Markovic, David Daney, linux-mips, linux-kernel

Hi James,

On Tue, Jan 2, 2018 at 10:31 AM, James Hogan <james.hogan@mips.com> wrote:
> On Tue, Dec 26, 2017 at 12:37:14PM +0100, Mathieu Malaterre wrote:
>> Rewrite the comparison in `else if` statement, case where `min_low_pfn >
>> ARCH_PFN_OFFSET` has already been checked in the first `if` statement:
>>
>>   if (min_low_pfn > ARCH_PFN_OFFSET) {
>>
>> Fix non-fatal warning:
>>
>> arch/mips/kernel/setup.c: In function ‘bootmem_init’:
>> arch/mips/kernel/setup.c:461:25: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
>>   } else if (min_low_pfn < ARCH_PFN_OFFSET) {
>>                          ^
>
> What compiler version is that with out of interest? It isn't exactly new
> code.

I've clarified in v2, that this happen during compilation using W=1

For reference:

$ mipsel-linux-gnu-gcc -dumpversion
6.3.0


>>
>> Signed-off-by: Mathieu Malaterre <malat@debian.org>
>
> Reviewed-by: James Hogan <jhogan@kernel.org>

Thanks !

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

* Re: [PATCH 2/2] MIPS: Remove a warning when PHYS_OFFSET is 0x0
  2018-01-02 18:55     ` Mathieu Malaterre
@ 2018-02-14 10:35       ` Mathieu Malaterre
  2018-02-14 13:59         ` James Hogan
  0 siblings, 1 reply; 9+ messages in thread
From: Mathieu Malaterre @ 2018-02-14 10:35 UTC (permalink / raw)
  To: James Hogan
  Cc: Ralf Baechle, Marcin Nowakowski, Miodrag Dinic,
	Aleksandar Markovic, David Daney, linux-mips, LKML

On Tue, Jan 2, 2018 at 7:55 PM, Mathieu Malaterre <malat@debian.org> wrote:
> Hi James,
>
> On Tue, Jan 2, 2018 at 10:31 AM, James Hogan <james.hogan@mips.com> wrote:
>> On Tue, Dec 26, 2017 at 12:37:14PM +0100, Mathieu Malaterre wrote:
>>> Rewrite the comparison in `else if` statement, case where `min_low_pfn >
>>> ARCH_PFN_OFFSET` has already been checked in the first `if` statement:
>>>
>>>   if (min_low_pfn > ARCH_PFN_OFFSET) {
>>>
>>> Fix non-fatal warning:
>>>
>>> arch/mips/kernel/setup.c: In function ‘bootmem_init’:
>>> arch/mips/kernel/setup.c:461:25: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
>>>   } else if (min_low_pfn < ARCH_PFN_OFFSET) {
>>>                          ^
>>
>> What compiler version is that with out of interest? It isn't exactly new
>> code.
>
> I've clarified in v2, that this happen during compilation using W=1
>
> For reference:
>
> $ mipsel-linux-gnu-gcc -dumpversion
> 6.3.0
>
>
>>>
>>> Signed-off-by: Mathieu Malaterre <malat@debian.org>
>>
>> Reviewed-by: James Hogan <jhogan@kernel.org>
>
> Thanks !

ping ?

https://patchwork.linux-mips.org/project/linux-mips/list/?series=623

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

* Re: [PATCH 2/2] MIPS: Remove a warning when PHYS_OFFSET is 0x0
  2018-02-14 10:35       ` Mathieu Malaterre
@ 2018-02-14 13:59         ` James Hogan
  0 siblings, 0 replies; 9+ messages in thread
From: James Hogan @ 2018-02-14 13:59 UTC (permalink / raw)
  To: Mathieu Malaterre
  Cc: Ralf Baechle, Marcin Nowakowski, Miodrag Dinic,
	Aleksandar Markovic, David Daney, linux-mips, LKML

[-- Attachment #1: Type: text/plain, Size: 1393 bytes --]

On Wed, Feb 14, 2018 at 11:35:44AM +0100, Mathieu Malaterre wrote:
> On Tue, Jan 2, 2018 at 7:55 PM, Mathieu Malaterre <malat@debian.org> wrote:
> > Hi James,
> >
> > On Tue, Jan 2, 2018 at 10:31 AM, James Hogan <james.hogan@mips.com> wrote:
> >> On Tue, Dec 26, 2017 at 12:37:14PM +0100, Mathieu Malaterre wrote:
> >>> Rewrite the comparison in `else if` statement, case where `min_low_pfn >
> >>> ARCH_PFN_OFFSET` has already been checked in the first `if` statement:
> >>>
> >>>   if (min_low_pfn > ARCH_PFN_OFFSET) {
> >>>
> >>> Fix non-fatal warning:
> >>>
> >>> arch/mips/kernel/setup.c: In function ‘bootmem_init’:
> >>> arch/mips/kernel/setup.c:461:25: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
> >>>   } else if (min_low_pfn < ARCH_PFN_OFFSET) {
> >>>                          ^
> >>
> >> What compiler version is that with out of interest? It isn't exactly new
> >> code.
> >
> > I've clarified in v2, that this happen during compilation using W=1
> >
> > For reference:
> >
> > $ mipsel-linux-gnu-gcc -dumpversion
> > 6.3.0
> >
> >
> >>>
> >>> Signed-off-by: Mathieu Malaterre <malat@debian.org>
> >>
> >> Reviewed-by: James Hogan <jhogan@kernel.org>
> >
> > Thanks !
> 
> ping ?
> 
> https://patchwork.linux-mips.org/project/linux-mips/list/?series=623

Yep, both applied for 4.17.

Thanks
James

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2018-02-14 14:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-26 11:37 [PATCH 1/2] MIPS: add declaration for function `memory_region_available` Mathieu Malaterre
2017-12-26 11:37 ` [PATCH 2/2] MIPS: Remove a warning when PHYS_OFFSET is 0x0 Mathieu Malaterre
2018-01-02  9:31   ` James Hogan
2018-01-02 18:55     ` Mathieu Malaterre
2018-02-14 10:35       ` Mathieu Malaterre
2018-02-14 13:59         ` James Hogan
2018-01-02 18:53   ` [PATCH v2 " Mathieu Malaterre
2018-01-02  9:51 ` [PATCH 1/2] MIPS: add declaration for function `memory_region_available` James Hogan
2018-01-02 18:52 ` [PATCH v2 1/2] MIPS: Make declaration for function `memory_region_available` static Mathieu Malaterre

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