linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ia64: Miscellaneous fixes and cleanups
@ 2021-08-25 11:48 Geert Uytterhoeven
  2021-08-25 11:48 ` [PATCH 1/3] ia64: Fix #endif comment for reserve_elfcorehdr() Geert Uytterhoeven
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2021-08-25 11:48 UTC (permalink / raw)
  To: Andrew Morton, Simon Horman, Tony Luck, Jay Lan, Magnus Damm,
	Mike Rapoport
  Cc: Rob Herring, Frank Rowand, linux-ia64, linux-kernel, devicetree,
	Geert Uytterhoeven

	Hi Andrew,

This patch series contains some miscellaneous fixes and cleanups for
ia64.  The second patch fixes a naming conflict triggered by a patch for
the FDT code.

This has been compile-tested only, due to lack of hardware.

Thanks!

Geert Uytterhoeven (3):
  ia64: Fix #endif comment for reserve_elfcorehdr()
  ia64: Make reserve_elfcorehdr() static
  ia64: Make num_rsvd_regions static

 arch/ia64/include/asm/meminit.h |  2 --
 arch/ia64/kernel/setup.c        | 53 ++++++++++++++++-----------------
 2 files changed, 26 insertions(+), 29 deletions(-)

-- 
2.25.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* [PATCH 1/3] ia64: Fix #endif comment for reserve_elfcorehdr()
  2021-08-25 11:48 [PATCH 0/3] ia64: Miscellaneous fixes and cleanups Geert Uytterhoeven
@ 2021-08-25 11:48 ` Geert Uytterhoeven
  2021-09-06  7:03   ` Simon Horman
  2021-08-25 11:48 ` [PATCH 2/3] ia64: Make reserve_elfcorehdr() static Geert Uytterhoeven
  2021-08-25 11:48 ` [PATCH 3/3] ia64: Make num_rsvd_regions static Geert Uytterhoeven
  2 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2021-08-25 11:48 UTC (permalink / raw)
  To: Andrew Morton, Simon Horman, Tony Luck, Jay Lan, Magnus Damm,
	Mike Rapoport
  Cc: Rob Herring, Frank Rowand, linux-ia64, linux-kernel, devicetree,
	Geert Uytterhoeven

The definition of reserve_elfcorehdr() depends on CONFIG_CRASH_DUMP, not
CONFIG_PROC_VMCORE.

Fixes: d9a9855d0b06ca6d ("always reserve elfcore header memory in crash kernel")
Fixes: 17c1f07ed70afa4f ("[IA64] Reserve elfcorehdr memory in CONFIG_CRASH_DUMP")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/ia64/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index dd595fbd800651fe..fbd931f1eb270d98 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -546,7 +546,7 @@ int __init reserve_elfcorehdr(u64 *start, u64 *end)
 	return 0;
 }
 
-#endif /* CONFIG_PROC_VMCORE */
+#endif /* CONFIG_CRASH_DUMP */
 
 void __init
 setup_arch (char **cmdline_p)
-- 
2.25.1


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

* [PATCH 2/3] ia64: Make reserve_elfcorehdr() static
  2021-08-25 11:48 [PATCH 0/3] ia64: Miscellaneous fixes and cleanups Geert Uytterhoeven
  2021-08-25 11:48 ` [PATCH 1/3] ia64: Fix #endif comment for reserve_elfcorehdr() Geert Uytterhoeven
@ 2021-08-25 11:48 ` Geert Uytterhoeven
  2021-09-06  7:07   ` Simon Horman
  2021-08-25 11:48 ` [PATCH 3/3] ia64: Make num_rsvd_regions static Geert Uytterhoeven
  2 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2021-08-25 11:48 UTC (permalink / raw)
  To: Andrew Morton, Simon Horman, Tony Luck, Jay Lan, Magnus Damm,
	Mike Rapoport
  Cc: Rob Herring, Frank Rowand, linux-ia64, linux-kernel, devicetree,
	Geert Uytterhoeven

There never was a reason for reserve_elfcorehdr() to be global.
Make the function static, and move it before its sole caller.

Fixes: cee87af2a5f75713 ("[IA64] kexec: Use EFI_LOADER_DATA for ELF core header")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This fixes a conflict triggered by
https://lore.kernel.org/r/c7e46e50aaf87ef49bdaa61358d25b122f32b7df.1628670468.git.geert+renesas@glider.be/
and fixed by
https://lore.kernel.org/r/f6eabbbce0fba6da3da0264c1e1cf23c01173999.1629884393.git.geert+renesas@glider.be
 arch/ia64/include/asm/meminit.h |  1 -
 arch/ia64/kernel/setup.c        | 51 ++++++++++++++++-----------------
 2 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/arch/ia64/include/asm/meminit.h b/arch/ia64/include/asm/meminit.h
index 6c47a239fc26df12..2738f62b5f989492 100644
--- a/arch/ia64/include/asm/meminit.h
+++ b/arch/ia64/include/asm/meminit.h
@@ -40,7 +40,6 @@ extern unsigned long efi_memmap_init(u64 *s, u64 *e);
 extern int find_max_min_low_pfn (u64, u64, void *);
 
 extern unsigned long vmcore_find_descriptor_size(unsigned long address);
-extern int reserve_elfcorehdr(u64 *start, u64 *end);
 
 /*
  * For rounding an address to the next IA64_GRANULE_SIZE or order
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index fbd931f1eb270d98..5e6ee8939092a2df 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -325,6 +325,31 @@ static inline void __init setup_crashkernel(unsigned long total, int *n)
 {}
 #endif
 
+#ifdef CONFIG_CRASH_DUMP
+static int __init reserve_elfcorehdr(u64 *start, u64 *end)
+{
+	u64 length;
+
+	/* We get the address using the kernel command line,
+	 * but the size is extracted from the EFI tables.
+	 * Both address and size are required for reservation
+	 * to work properly.
+	 */
+
+	if (!is_vmcore_usable())
+		return -EINVAL;
+
+	if ((length = vmcore_find_descriptor_size(elfcorehdr_addr)) == 0) {
+		vmcore_unusable();
+		return -EINVAL;
+	}
+
+	*start = (unsigned long)__va(elfcorehdr_addr);
+	*end = *start + length;
+	return 0;
+}
+#endif /* CONFIG_CRASH_DUMP */
+
 /**
  * reserve_memory - setup reserved memory areas
  *
@@ -522,32 +547,6 @@ static __init int setup_nomca(char *s)
 }
 early_param("nomca", setup_nomca);
 
-#ifdef CONFIG_CRASH_DUMP
-int __init reserve_elfcorehdr(u64 *start, u64 *end)
-{
-	u64 length;
-
-	/* We get the address using the kernel command line,
-	 * but the size is extracted from the EFI tables.
-	 * Both address and size are required for reservation
-	 * to work properly.
-	 */
-
-	if (!is_vmcore_usable())
-		return -EINVAL;
-
-	if ((length = vmcore_find_descriptor_size(elfcorehdr_addr)) == 0) {
-		vmcore_unusable();
-		return -EINVAL;
-	}
-
-	*start = (unsigned long)__va(elfcorehdr_addr);
-	*end = *start + length;
-	return 0;
-}
-
-#endif /* CONFIG_CRASH_DUMP */
-
 void __init
 setup_arch (char **cmdline_p)
 {
-- 
2.25.1


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

* [PATCH 3/3] ia64: Make num_rsvd_regions static
  2021-08-25 11:48 [PATCH 0/3] ia64: Miscellaneous fixes and cleanups Geert Uytterhoeven
  2021-08-25 11:48 ` [PATCH 1/3] ia64: Fix #endif comment for reserve_elfcorehdr() Geert Uytterhoeven
  2021-08-25 11:48 ` [PATCH 2/3] ia64: Make reserve_elfcorehdr() static Geert Uytterhoeven
@ 2021-08-25 11:48 ` Geert Uytterhoeven
  2021-09-06  7:05   ` Simon Horman
  2 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2021-08-25 11:48 UTC (permalink / raw)
  To: Andrew Morton, Simon Horman, Tony Luck, Jay Lan, Magnus Damm,
	Mike Rapoport
  Cc: Rob Herring, Frank Rowand, linux-ia64, linux-kernel, devicetree,
	Geert Uytterhoeven

Commit f62800992e5917f2 ("ia64: switch to NO_BOOTMEM") removed the last
user of num_rsvd_regions outside arch/ia64/kernel/setup.c.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/ia64/include/asm/meminit.h | 1 -
 arch/ia64/kernel/setup.c        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/ia64/include/asm/meminit.h b/arch/ia64/include/asm/meminit.h
index 2738f62b5f989492..f1d5bf2ba847a135 100644
--- a/arch/ia64/include/asm/meminit.h
+++ b/arch/ia64/include/asm/meminit.h
@@ -29,7 +29,6 @@ struct rsvd_region {
 };
 
 extern struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1];
-extern int num_rsvd_regions;
 
 extern void find_memory (void);
 extern void reserve_memory (void);
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 5e6ee8939092a2df..31fb84de2d21469a 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -131,7 +131,7 @@ unsigned long ia64_cache_stride_shift = ~0;
  * We use a special marker for the end of memory and it uses the extra (+1) slot
  */
 struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1] __initdata;
-int num_rsvd_regions __initdata;
+static int num_rsvd_regions __initdata;
 
 
 /*
-- 
2.25.1


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

* Re: [PATCH 1/3] ia64: Fix #endif comment for reserve_elfcorehdr()
  2021-08-25 11:48 ` [PATCH 1/3] ia64: Fix #endif comment for reserve_elfcorehdr() Geert Uytterhoeven
@ 2021-09-06  7:03   ` Simon Horman
  0 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2021-09-06  7:03 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Andrew Morton, Tony Luck, Jay Lan, Magnus Damm, Mike Rapoport,
	Rob Herring, Frank Rowand, linux-ia64, linux-kernel, devicetree

On Wed, Aug 25, 2021 at 01:48:27PM +0200, Geert Uytterhoeven wrote:
> The definition of reserve_elfcorehdr() depends on CONFIG_CRASH_DUMP, not
> CONFIG_PROC_VMCORE.
> 
> Fixes: d9a9855d0b06ca6d ("always reserve elfcore header memory in crash kernel")
> Fixes: 17c1f07ed70afa4f ("[IA64] Reserve elfcorehdr memory in CONFIG_CRASH_DUMP")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Simon Horman <horms@verge.net.au>

> ---
>  arch/ia64/kernel/setup.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
> index dd595fbd800651fe..fbd931f1eb270d98 100644
> --- a/arch/ia64/kernel/setup.c
> +++ b/arch/ia64/kernel/setup.c
> @@ -546,7 +546,7 @@ int __init reserve_elfcorehdr(u64 *start, u64 *end)
>  	return 0;
>  }
>  
> -#endif /* CONFIG_PROC_VMCORE */
> +#endif /* CONFIG_CRASH_DUMP */
>  
>  void __init
>  setup_arch (char **cmdline_p)
> -- 
> 2.25.1
> 

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

* Re: [PATCH 3/3] ia64: Make num_rsvd_regions static
  2021-08-25 11:48 ` [PATCH 3/3] ia64: Make num_rsvd_regions static Geert Uytterhoeven
@ 2021-09-06  7:05   ` Simon Horman
  0 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2021-09-06  7:05 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Andrew Morton, Tony Luck, Jay Lan, Magnus Damm, Mike Rapoport,
	Rob Herring, Frank Rowand, linux-ia64, linux-kernel, devicetree

On Wed, Aug 25, 2021 at 01:48:29PM +0200, Geert Uytterhoeven wrote:
> Commit f62800992e5917f2 ("ia64: switch to NO_BOOTMEM") removed the last
> user of num_rsvd_regions outside arch/ia64/kernel/setup.c.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Simon Horman <horms@verge.net.au>

> ---
>  arch/ia64/include/asm/meminit.h | 1 -
>  arch/ia64/kernel/setup.c        | 2 +-
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/ia64/include/asm/meminit.h b/arch/ia64/include/asm/meminit.h
> index 2738f62b5f989492..f1d5bf2ba847a135 100644
> --- a/arch/ia64/include/asm/meminit.h
> +++ b/arch/ia64/include/asm/meminit.h
> @@ -29,7 +29,6 @@ struct rsvd_region {
>  };
>  
>  extern struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1];
> -extern int num_rsvd_regions;
>  
>  extern void find_memory (void);
>  extern void reserve_memory (void);
> diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
> index 5e6ee8939092a2df..31fb84de2d21469a 100644
> --- a/arch/ia64/kernel/setup.c
> +++ b/arch/ia64/kernel/setup.c
> @@ -131,7 +131,7 @@ unsigned long ia64_cache_stride_shift = ~0;
>   * We use a special marker for the end of memory and it uses the extra (+1) slot
>   */
>  struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1] __initdata;
> -int num_rsvd_regions __initdata;
> +static int num_rsvd_regions __initdata;
>  
>  
>  /*
> -- 
> 2.25.1
> 

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

* Re: [PATCH 2/3] ia64: Make reserve_elfcorehdr() static
  2021-08-25 11:48 ` [PATCH 2/3] ia64: Make reserve_elfcorehdr() static Geert Uytterhoeven
@ 2021-09-06  7:07   ` Simon Horman
  0 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2021-09-06  7:07 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Andrew Morton, Tony Luck, Jay Lan, Magnus Damm, Mike Rapoport,
	Rob Herring, Frank Rowand, linux-ia64, linux-kernel, devicetree

On Wed, Aug 25, 2021 at 01:48:28PM +0200, Geert Uytterhoeven wrote:
> There never was a reason for reserve_elfcorehdr() to be global.
> Make the function static, and move it before its sole caller.
> 
> Fixes: cee87af2a5f75713 ("[IA64] kexec: Use EFI_LOADER_DATA for ELF core header")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Simon Horman <horms@verge.net.au>

> ---
> This fixes a conflict triggered by
> https://lore.kernel.org/r/c7e46e50aaf87ef49bdaa61358d25b122f32b7df.1628670468.git.geert+renesas@glider.be/
> and fixed by
> https://lore.kernel.org/r/f6eabbbce0fba6da3da0264c1e1cf23c01173999.1629884393.git.geert+renesas@glider.be
>  arch/ia64/include/asm/meminit.h |  1 -
>  arch/ia64/kernel/setup.c        | 51 ++++++++++++++++-----------------
>  2 files changed, 25 insertions(+), 27 deletions(-)

...

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

end of thread, other threads:[~2021-09-06  7:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25 11:48 [PATCH 0/3] ia64: Miscellaneous fixes and cleanups Geert Uytterhoeven
2021-08-25 11:48 ` [PATCH 1/3] ia64: Fix #endif comment for reserve_elfcorehdr() Geert Uytterhoeven
2021-09-06  7:03   ` Simon Horman
2021-08-25 11:48 ` [PATCH 2/3] ia64: Make reserve_elfcorehdr() static Geert Uytterhoeven
2021-09-06  7:07   ` Simon Horman
2021-08-25 11:48 ` [PATCH 3/3] ia64: Make num_rsvd_regions static Geert Uytterhoeven
2021-09-06  7:05   ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).