lib: sbi: simplify sanitize_domain()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 6 Oct 2023 20:59:26 +0000 (22:59 +0200)
committerAnup Patel <anup@brainfault.org>
Tue, 14 Nov 2023 12:27:54 +0000 (17:57 +0530)
Since commit 112daa2e647c ("lib: sbi: Maximize the use of HART index in
sbi_domain") the platform parameter is unused.

Fixes: 112daa2e647c ("lib: sbi: Maximize the use of HART index in sbi_domain")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
lib/sbi/sbi_domain.c

index fd4a2965c3aaa59b43f877f2f9e8350bd6c5588b..4d248d0b03b8be639cf9d920081f6b95528ad128 100644 (file)
@@ -256,8 +256,7 @@ static const struct sbi_domain_memregion *find_next_subset_region(
        return ret;
 }
 
-static int sanitize_domain(const struct sbi_platform *plat,
-                          struct sbi_domain *dom)
+static int sanitize_domain(struct sbi_domain *dom)
 {
        u32 i, j, count;
        struct sbi_domain_memregion treg, *reg, *reg1;
@@ -494,7 +493,6 @@ int sbi_domain_register(struct sbi_domain *dom,
        int rc;
        struct sbi_domain *tdom;
        u32 cold_hartid = current_hartid();
-       const struct sbi_platform *plat = sbi_platform_thishart_ptr();
 
        /* Sanity checks */
        if (!dom || !assign_mask || domain_finalized)
@@ -517,7 +515,7 @@ int sbi_domain_register(struct sbi_domain *dom,
        }
 
        /* Sanitize discovered domain */
-       rc = sanitize_domain(plat, dom);
+       rc = sanitize_domain(dom);
        if (rc) {
                sbi_printf("%s: sanity checks failed for"
                           " %s (error %d)\n", __func__,
@@ -564,7 +562,6 @@ int sbi_domain_root_add_memregion(const struct sbi_domain_memregion *reg)
        int rc;
        bool reg_merged;
        struct sbi_domain_memregion *nreg, *nreg1, *nreg2;
-       const struct sbi_platform *plat = sbi_platform_thishart_ptr();
 
        /* Sanity checks */
        if (!reg || domain_finalized || !root.regions ||
@@ -590,7 +587,7 @@ int sbi_domain_root_add_memregion(const struct sbi_domain_memregion *reg)
        /* Sort and optimize root regions */
        do {
                /* Sanitize the root domain so that memregions are sorted */
-               rc = sanitize_domain(plat, &root);
+               rc = sanitize_domain(&root);
                if (rc) {
                        sbi_printf("%s: sanity checks failed for"
                                   " %s (error %d)\n", __func__,