Patchwork x86/efi: Mark can_free_region() as an __init function

login
register
mail settings
Submitter Sai Praneeth Prakhya
Date Dec. 28, 2018, 9:17 p.m.
Message ID <20181228211709.9456-1-sai.praneeth.prakhya@intel.com>
Download mbox | patch
Permalink /patch/690705/
State New
Headers show

Comments

Sai Praneeth Prakhya - Dec. 28, 2018, 9:17 p.m.
can_free_region() is called only once during _boot_ by
efi_reserve_boot_services(). Hence, mark it as __init function.

Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 arch/x86/platform/efi/quirks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Ard Biesheuvel - Jan. 29, 2019, 2:07 p.m.
On Fri, 28 Dec 2018 at 22:19, Sai Praneeth Prakhya
<sai.praneeth.prakhya@intel.com> wrote:
>
> can_free_region() is called only once during _boot_ by
> efi_reserve_boot_services(). Hence, mark it as __init function.
>
> Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Added to efi/next

Thanks Sai

> ---
>  arch/x86/platform/efi/quirks.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
> index 17456a1d3f04..9ce85e605052 100644
> --- a/arch/x86/platform/efi/quirks.c
> +++ b/arch/x86/platform/efi/quirks.c
> @@ -304,7 +304,7 @@ void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size)
>   * - Not within any part of the kernel
>   * - Not the BIOS reserved area (E820_TYPE_RESERVED, E820_TYPE_NVS, etc)
>   */
> -static bool can_free_region(u64 start, u64 size)
> +static __init bool can_free_region(u64 start, u64 size)
>  {
>         if (start + size > __pa_symbol(_text) && start <= __pa_symbol(_end))
>                 return false;
> --
> 2.19.1
>

Patch

diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
index 17456a1d3f04..9ce85e605052 100644
--- a/arch/x86/platform/efi/quirks.c
+++ b/arch/x86/platform/efi/quirks.c
@@ -304,7 +304,7 @@  void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size)
  * - Not within any part of the kernel
  * - Not the BIOS reserved area (E820_TYPE_RESERVED, E820_TYPE_NVS, etc)
  */
-static bool can_free_region(u64 start, u64 size)
+static __init bool can_free_region(u64 start, u64 size)
 {
 	if (start + size > __pa_symbol(_text) && start <= __pa_symbol(_end))
 		return false;