linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: "Cédric Le Goater" <clg@kaod.org>, linuxppc-dev@lists.ozlabs.org
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Subject: Re: [PATCH 1/6] powerpc/prom: Introduce early_reserve_mem_old()
Date: Thu, 19 Aug 2021 16:42:45 +0200	[thread overview]
Message-ID: <d79611e0-b42b-e74b-d628-5db718e6ebfa@csgroup.eu> (raw)
In-Reply-To: <20210819125656.14498-2-clg@kaod.org>



Le 19/08/2021 à 14:56, Cédric Le Goater a écrit :
> and condition its call with IS_ENABLED(CONFIG_PPC32). This fixes a
> compile error with W=1.
> 
> arch/powerpc/kernel/prom.c: In function ‘early_reserve_mem’:
> arch/powerpc/kernel/prom.c:625:10: error: variable ‘reserve_map’ set but not used [-Werror=unused-but-set-variable]
>    __be64 *reserve_map;
>            ^~~~~~~~~~~
> cc1: all warnings being treated as errors
> 
> Cc: Christophe Leroy <christophe.leroy@c-s.fr>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
> 
>   Christophe, I think you had comments on this one ? Yes, I am being a bit lazy.


Yeah, my comment was to leave thing almost as is, just drop the #ifdef CONFIG_PPC32 and instead put 
something like:

	if (!IS_ENABLED(CONFIG_PPC32))
		return;

> 
>   arch/powerpc/kernel/prom.c | 37 ++++++++++++++++++++-----------------
>   1 file changed, 20 insertions(+), 17 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index f620e04dc9bf..52869d12bc1d 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -621,27 +621,14 @@ static void __init early_reserve_mem_dt(void)
>   	}
>   }
>   
> -static void __init early_reserve_mem(void)
> +static void __init early_reserve_mem_old(void)

Why old ? Because ppc32 ?

I think that's more changes than needed.



>   {
>   	__be64 *reserve_map;
>   
>   	reserve_map = (__be64 *)(((unsigned long)initial_boot_params) +
>   			fdt_off_mem_rsvmap(initial_boot_params));
>   
> -	/* Look for the new "reserved-regions" property in the DT */
> -	early_reserve_mem_dt();
> -
> -#ifdef CONFIG_BLK_DEV_INITRD
> -	/* Then reserve the initrd, if any */
> -	if (initrd_start && (initrd_end > initrd_start)) {
> -		memblock_reserve(ALIGN_DOWN(__pa(initrd_start), PAGE_SIZE),
> -			ALIGN(initrd_end, PAGE_SIZE) -
> -			ALIGN_DOWN(initrd_start, PAGE_SIZE));
> -	}
> -#endif /* CONFIG_BLK_DEV_INITRD */
> -
> -#ifdef CONFIG_PPC32
> -	/*
> +	/*
>   	 * Handle the case where we might be booting from an old kexec
>   	 * image that setup the mem_rsvmap as pairs of 32-bit values
>   	 */
> @@ -659,9 +646,25 @@ static void __init early_reserve_mem(void)
>   			DBG("reserving: %x -> %x\n", base_32, size_32);
>   			memblock_reserve(base_32, size_32);
>   		}
> -		return;
>   	}
> -#endif
> +}
> +
> +static void __init early_reserve_mem(void)
> +{
> +	/* Look for the new "reserved-regions" property in the DT */
> +	early_reserve_mem_dt();
> +
> +#ifdef CONFIG_BLK_DEV_INITRD
> +	/* Then reserve the initrd, if any */
> +	if (initrd_start && (initrd_end > initrd_start)) {
> +		memblock_reserve(ALIGN_DOWN(__pa(initrd_start), PAGE_SIZE),
> +			ALIGN(initrd_end, PAGE_SIZE) -
> +			ALIGN_DOWN(initrd_start, PAGE_SIZE));
> +	}
> +#endif /* CONFIG_BLK_DEV_INITRD */
> +
> +	if (IS_ENABLED(CONFIG_PPC32))
> +		early_reserve_mem_old();
>   }
>   
>   #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
> 

  reply	other threads:[~2021-08-19 14:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 12:56 [PATCH 0/6] W=1 fixes Cédric Le Goater
2021-08-19 12:56 ` [PATCH 1/6] powerpc/prom: Introduce early_reserve_mem_old() Cédric Le Goater
2021-08-19 14:42   ` Christophe Leroy [this message]
2021-08-20 12:22     ` Michael Ellerman
2021-08-23  8:20     ` Cédric Le Goater
2021-08-19 12:56 ` [PATCH 2/6] powerpc/pseries/vas: Declare pseries_vas_fault_thread_fn() as static Cédric Le Goater
2021-08-19 12:56 ` [PATCH 3/6] KVM: PPC: Book3S PR: Declare kvmppc_handle_exit_pr() Cédric Le Goater
2021-08-19 14:44   ` Christophe Leroy
2021-08-20 12:22     ` Michael Ellerman
2021-08-19 12:56 ` [PATCH 4/6] KVM: PPC: Book3S PR: Remove unused variable Cédric Le Goater
2021-08-19 12:56 ` [PATCH 5/6] audit: Declare ppc32_classify_syscall() Cédric Le Goater
2021-08-19 14:56   ` Christophe Leroy
2021-08-19 18:36     ` Christophe Leroy
2021-08-23  8:28     ` Christophe Leroy
2021-08-23  8:35       ` Cédric Le Goater
2021-08-19 12:56 ` [PATCH 6/6] powerpc/compat_sys: Declare syscalls Cédric Le Goater
2021-08-20 12:25   ` Michael Ellerman
2022-03-15 11:45   ` Christophe Leroy
2021-08-27 13:15 ` [PATCH 0/6] W=1 fixes Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d79611e0-b42b-e74b-d628-5db718e6ebfa@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=christophe.leroy@c-s.fr \
    --cc=clg@kaod.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).