diff mbox series

[1/3] lib: sbi: fix typo in is_region_subset

Message ID 20220211111155.16121-2-nikita.shubin@maquefel.me
State Accepted
Headers show
Series sbi_domain fixes | expand

Commit Message

Nikita Shubin Feb. 11, 2022, 11:11 a.m. UTC
From: Nikita Shubin <n.shubin@yadro.com>

Fix typo in is_region_subset, regB_end should be calculated from regB.

Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
---
 lib/sbi/sbi_domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dong Du Feb. 12, 2022, 8:34 a.m. UTC | #1
On Feb 11, 2022, at 7:11 PM, Nikita Shubin nikita.shubin@maquefel.me wrote:

> From: Nikita Shubin <n.shubin@yadro.com>
> 
> Fix typo in is_region_subset, regB_end should be calculated from regB.
> 
> Signed-off-by: Nikita Shubin <n.shubin@yadro.com>

Looks good to me. Thx for the patch.

Reviewed-by: Dong Du <Dd_nirvana@sjtu.edu.cn>

Regards,
Dong

> ---
> lib/sbi/sbi_domain.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c
> index b60915c..a1ac1bb 100644
> --- a/lib/sbi/sbi_domain.c
> +++ b/lib/sbi/sbi_domain.c
> @@ -159,7 +159,7 @@ static bool is_region_subset(const struct
> sbi_domain_memregion *regA,
> 	ulong regA_start = regA->base;
> 	ulong regA_end = regA->base + (BIT(regA->order) - 1);
> 	ulong regB_start = regB->base;
> -	ulong regB_end = regB->base + (BIT(regA->order) - 1);
> +	ulong regB_end = regB->base + (BIT(regB->order) - 1);
> 
> 	if ((regB_start <= regA_start) &&
> 	    (regA_start < regB_end) &&
> --
> 2.31.1
> 
> 
> --
> opensbi mailing list
> opensbi@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi
Xiang W Feb. 14, 2022, 4:46 p.m. UTC | #2
在 2022-02-11星期五的 14:11 +0300,Nikita Shubin写道:
> From: Nikita Shubin <n.shubin@yadro.com>
> 
> Fix typo in is_region_subset, regB_end should be calculated from regB.
> 
> Signed-off-by: Nikita Shubin <n.shubin@yadro.com>

LGTM

Reviewed-by: Xiang W <wxjstz@126.com>
> ---
>  lib/sbi/sbi_domain.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c
> index b60915c..a1ac1bb 100644
> --- a/lib/sbi/sbi_domain.c
> +++ b/lib/sbi/sbi_domain.c
> @@ -159,7 +159,7 @@ static bool is_region_subset(const struct
> sbi_domain_memregion *regA,
>         ulong regA_start = regA->base;
>         ulong regA_end = regA->base + (BIT(regA->order) - 1);
>         ulong regB_start = regB->base;
> -       ulong regB_end = regB->base + (BIT(regA->order) - 1);
> +       ulong regB_end = regB->base + (BIT(regB->order) - 1);
>  
>         if ((regB_start <= regA_start) &&
>             (regA_start < regB_end) &&
> -- 
> 2.31.1
> 
>
Anup Patel Feb. 15, 2022, 4:12 p.m. UTC | #3
On Fri, Feb 11, 2022 at 4:42 PM Nikita Shubin <nikita.shubin@maquefel.me> wrote:
>
> From: Nikita Shubin <n.shubin@yadro.com>
>
> Fix typo in is_region_subset, regB_end should be calculated from regB.
>
> Signed-off-by: Nikita Shubin <n.shubin@yadro.com>

Thanks for catching this issue.

Reviewed-by: Anup Patel <anup@brainfault.org>

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

> ---
>  lib/sbi/sbi_domain.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c
> index b60915c..a1ac1bb 100644
> --- a/lib/sbi/sbi_domain.c
> +++ b/lib/sbi/sbi_domain.c
> @@ -159,7 +159,7 @@ static bool is_region_subset(const struct sbi_domain_memregion *regA,
>         ulong regA_start = regA->base;
>         ulong regA_end = regA->base + (BIT(regA->order) - 1);
>         ulong regB_start = regB->base;
> -       ulong regB_end = regB->base + (BIT(regA->order) - 1);
> +       ulong regB_end = regB->base + (BIT(regB->order) - 1);
>
>         if ((regB_start <= regA_start) &&
>             (regA_start < regB_end) &&
> --
> 2.31.1
>
>
> --
> opensbi mailing list
> opensbi@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi
diff mbox series

Patch

diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c
index b60915c..a1ac1bb 100644
--- a/lib/sbi/sbi_domain.c
+++ b/lib/sbi/sbi_domain.c
@@ -159,7 +159,7 @@  static bool is_region_subset(const struct sbi_domain_memregion *regA,
 	ulong regA_start = regA->base;
 	ulong regA_end = regA->base + (BIT(regA->order) - 1);
 	ulong regB_start = regB->base;
-	ulong regB_end = regB->base + (BIT(regA->order) - 1);
+	ulong regB_end = regB->base + (BIT(regB->order) - 1);
 
 	if ((regB_start <= regA_start) &&
 	    (regA_start < regB_end) &&