diff mbox series

[7/7] lib: sbi: Make sbi_domain_memregion_initfw() a local function

Message ID 20210410071808.759856-8-anup.patel@wdc.com
State Superseded
Headers show
Series Protect M-mode only MMIO devices | expand

Commit Message

Anup Patel April 10, 2021, 7:18 a.m. UTC
The sbi_domain_memregion_initfw() is no longer used outside
sbi_domain.c so let's make it a local function.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
---
 include/sbi/sbi_domain.h | 3 ---
 lib/sbi/sbi_domain.c     | 4 ++--
 2 files changed, 2 insertions(+), 5 deletions(-)

Comments

Xiang W April 11, 2021, 10:07 a.m. UTC | #1
在 2021-04-10六的 12:48 +0530,Anup Patel写道:
> The sbi_domain_memregion_initfw() is no longer used outside
> sbi_domain.c so let's make it a local function.
> 
> Signed-off-by: Anup Patel <anup.patel@wdc.com>
looks good to me.

Reviewed-by: Xiang W <wxjstz@126.com>

Regards,
Xiang W
> ---
>  include/sbi/sbi_domain.h | 3 ---
>  lib/sbi/sbi_domain.c     | 4 ++--
>  2 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/include/sbi/sbi_domain.h b/include/sbi/sbi_domain.h
> index ef53ca5..3de5e46 100644
> --- a/include/sbi/sbi_domain.h
> +++ b/include/sbi/sbi_domain.h
> @@ -127,9 +127,6 @@ bool sbi_domain_is_assigned_hart(const struct
> sbi_domain *dom, u32 hartid);
>  ulong sbi_domain_get_assigned_hartmask(const struct sbi_domain *dom,
>  				       ulong hbase);
>  
> -/** Initialize a domain memory region as firmware region */
> -void sbi_domain_memregion_initfw(struct sbi_domain_memregion *reg);
> -
>  /**
>   * Initialize a domain memory region based on it's physical
>   * address and size.
> diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c
> index 5e3a30d..069e2a7 100644
> --- a/lib/sbi/sbi_domain.c
> +++ b/lib/sbi/sbi_domain.c
> @@ -64,7 +64,7 @@ ulong sbi_domain_get_assigned_hartmask(const struct
> sbi_domain *dom,
>  	return ret;
>  }
>  
> -void sbi_domain_memregion_initfw(struct sbi_domain_memregion *reg)
> +static void domain_memregion_initfw(struct sbi_domain_memregion
> *reg)
>  {
>  	if (!reg)
>  		return;
> @@ -577,7 +577,7 @@ int sbi_domain_init(struct sbi_scratch *scratch,
> u32 cold_hartid)
>  	/* Root domain firmware memory region */
>  	sbi_domain_memregion_init(scratch->fw_start, scratch->fw_size,
> 0,
>  				  &root_fw_region);
> -	sbi_domain_memregion_initfw(&root_memregs[root_memregs_count++]
> );
> +	domain_memregion_initfw(&root_memregs[root_memregs_count++]);
>  
>  	/* Root domain allow everything memory region */
>  	sbi_domain_memregion_init(0, ~0UL,
> -- 
> 2.25.1
> 
>
Alistair Francis April 11, 2021, 9:32 p.m. UTC | #2
On Sat, 2021-04-10 at 12:48 +0530, Anup Patel wrote:
> The sbi_domain_memregion_initfw() is no longer used outside
> sbi_domain.c so let's make it a local function.
> 
> Signed-off-by: Anup Patel <anup.patel@wdc.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  include/sbi/sbi_domain.h | 3 ---
>  lib/sbi/sbi_domain.c     | 4 ++--
>  2 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/include/sbi/sbi_domain.h b/include/sbi/sbi_domain.h
> index ef53ca5..3de5e46 100644
> --- a/include/sbi/sbi_domain.h
> +++ b/include/sbi/sbi_domain.h
> @@ -127,9 +127,6 @@ bool sbi_domain_is_assigned_hart(const struct
> sbi_domain *dom, u32 hartid);
>  ulong sbi_domain_get_assigned_hartmask(const struct sbi_domain *dom,
>                                        ulong hbase);
>  
> -/** Initialize a domain memory region as firmware region */
> -void sbi_domain_memregion_initfw(struct sbi_domain_memregion *reg);
> -
>  /**
>   * Initialize a domain memory region based on it's physical
>   * address and size.
> diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c
> index 5e3a30d..069e2a7 100644
> --- a/lib/sbi/sbi_domain.c
> +++ b/lib/sbi/sbi_domain.c
> @@ -64,7 +64,7 @@ ulong sbi_domain_get_assigned_hartmask(const struct
> sbi_domain *dom,
>         return ret;
>  }
>  
> -void sbi_domain_memregion_initfw(struct sbi_domain_memregion *reg)
> +static void domain_memregion_initfw(struct sbi_domain_memregion *reg)
>  {
>         if (!reg)
>                 return;
> @@ -577,7 +577,7 @@ int sbi_domain_init(struct sbi_scratch *scratch,
> u32 cold_hartid)
>         /* Root domain firmware memory region */
>         sbi_domain_memregion_init(scratch->fw_start, scratch->fw_size,
> 0,
>                                   &root_fw_region);
> -
>        sbi_domain_memregion_initfw(&root_memregs[root_memregs_count++]);
> +       domain_memregion_initfw(&root_memregs[root_memregs_count++]);
>  
>         /* Root domain allow everything memory region */
>         sbi_domain_memregion_init(0, ~0UL,
diff mbox series

Patch

diff --git a/include/sbi/sbi_domain.h b/include/sbi/sbi_domain.h
index ef53ca5..3de5e46 100644
--- a/include/sbi/sbi_domain.h
+++ b/include/sbi/sbi_domain.h
@@ -127,9 +127,6 @@  bool sbi_domain_is_assigned_hart(const struct sbi_domain *dom, u32 hartid);
 ulong sbi_domain_get_assigned_hartmask(const struct sbi_domain *dom,
 				       ulong hbase);
 
-/** Initialize a domain memory region as firmware region */
-void sbi_domain_memregion_initfw(struct sbi_domain_memregion *reg);
-
 /**
  * Initialize a domain memory region based on it's physical
  * address and size.
diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c
index 5e3a30d..069e2a7 100644
--- a/lib/sbi/sbi_domain.c
+++ b/lib/sbi/sbi_domain.c
@@ -64,7 +64,7 @@  ulong sbi_domain_get_assigned_hartmask(const struct sbi_domain *dom,
 	return ret;
 }
 
-void sbi_domain_memregion_initfw(struct sbi_domain_memregion *reg)
+static void domain_memregion_initfw(struct sbi_domain_memregion *reg)
 {
 	if (!reg)
 		return;
@@ -577,7 +577,7 @@  int sbi_domain_init(struct sbi_scratch *scratch, u32 cold_hartid)
 	/* Root domain firmware memory region */
 	sbi_domain_memregion_init(scratch->fw_start, scratch->fw_size, 0,
 				  &root_fw_region);
-	sbi_domain_memregion_initfw(&root_memregs[root_memregs_count++]);
+	domain_memregion_initfw(&root_memregs[root_memregs_count++]);
 
 	/* Root domain allow everything memory region */
 	sbi_domain_memregion_init(0, ~0UL,