diff mbox series

[1/6] lmb: Fix flags data type in lmb_add_region_flags()

Message ID 20241208002121.31887-2-semen.protsenko@linaro.org
State Superseded
Headers show
Series lmb: Fix reserving the same region multiple times | expand

Commit Message

Sam Protsenko Dec. 8, 2024, 12:21 a.m. UTC
rgnflags variable in lmb_add_region_flags() has incorrect type: it's
declared as phys_size_t when it should be enum lmb_flags. That
copy-paste mistake was firstly introduced in commit 59c0ea5df33f ("lmb:
Add support of flags for no-map properties"), and then copied further
into commit ed17a33fed29 ("lmb: make LMB memory map persistent and
global"). Fix it by using the correct type to match struct lmb_region
field.

No functional change.

Fixes: ed17a33fed29 ("lmb: make LMB memory map persistent and global")
Fixes: 59c0ea5df33f ("lmb: Add support of flags for no-map properties")
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
 lib/lmb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ilias Apalodimas Dec. 8, 2024, 6:50 a.m. UTC | #1
On Sun, 8 Dec 2024 at 02:21, Sam Protsenko <semen.protsenko@linaro.org> wrote:
>
> rgnflags variable in lmb_add_region_flags() has incorrect type: it's
> declared as phys_size_t when it should be enum lmb_flags. That
> copy-paste mistake was firstly introduced in commit 59c0ea5df33f ("lmb:
> Add support of flags for no-map properties"), and then copied further
> into commit ed17a33fed29 ("lmb: make LMB memory map persistent and
> global"). Fix it by using the correct type to match struct lmb_region
> field.
>
> No functional change.
>
> Fixes: ed17a33fed29 ("lmb: make LMB memory map persistent and global")
> Fixes: 59c0ea5df33f ("lmb: Add support of flags for no-map properties")
> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> ---
>  lib/lmb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/lmb.c b/lib/lmb.c
> index b03237bc06cb..713f072f75ee 100644
> --- a/lib/lmb.c
> +++ b/lib/lmb.c
> @@ -200,7 +200,7 @@ static long lmb_add_region_flags(struct alist *lmb_rgn_lst, phys_addr_t base,
>         for (i = 0; i < lmb_rgn_lst->count; i++) {
>                 phys_addr_t rgnbase = rgn[i].base;
>                 phys_size_t rgnsize = rgn[i].size;
> -               phys_size_t rgnflags = rgn[i].flags;
> +               enum lmb_flags rgnflags = rgn[i].flags;
>
>                 ret = lmb_addrs_adjacent(base, size, rgnbase, rgnsize);
>                 if (ret > 0) {
> --
> 2.39.5
>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Sughosh Ganu Dec. 9, 2024, 6:58 a.m. UTC | #2
On Sun, 8 Dec 2024 at 05:51, Sam Protsenko <semen.protsenko@linaro.org> wrote:
>
> rgnflags variable in lmb_add_region_flags() has incorrect type: it's
> declared as phys_size_t when it should be enum lmb_flags. That
> copy-paste mistake was firstly introduced in commit 59c0ea5df33f ("lmb:
> Add support of flags for no-map properties"), and then copied further
> into commit ed17a33fed29 ("lmb: make LMB memory map persistent and
> global"). Fix it by using the correct type to match struct lmb_region
> field.
>
> No functional change.
>
> Fixes: ed17a33fed29 ("lmb: make LMB memory map persistent and global")
> Fixes: 59c0ea5df33f ("lmb: Add support of flags for no-map properties")
> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> ---

So this is the right code for sure. But is this fixing any issue? I
suspect not. If so, the Fixes tag should be removed when applying.

Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org>

-sughosh

>  lib/lmb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/lmb.c b/lib/lmb.c
> index b03237bc06cb..713f072f75ee 100644
> --- a/lib/lmb.c
> +++ b/lib/lmb.c
> @@ -200,7 +200,7 @@ static long lmb_add_region_flags(struct alist *lmb_rgn_lst, phys_addr_t base,
>         for (i = 0; i < lmb_rgn_lst->count; i++) {
>                 phys_addr_t rgnbase = rgn[i].base;
>                 phys_size_t rgnsize = rgn[i].size;
> -               phys_size_t rgnflags = rgn[i].flags;
> +               enum lmb_flags rgnflags = rgn[i].flags;
>
>                 ret = lmb_addrs_adjacent(base, size, rgnbase, rgnsize);
>                 if (ret > 0) {
> --
> 2.39.5
>
diff mbox series

Patch

diff --git a/lib/lmb.c b/lib/lmb.c
index b03237bc06cb..713f072f75ee 100644
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -200,7 +200,7 @@  static long lmb_add_region_flags(struct alist *lmb_rgn_lst, phys_addr_t base,
 	for (i = 0; i < lmb_rgn_lst->count; i++) {
 		phys_addr_t rgnbase = rgn[i].base;
 		phys_size_t rgnsize = rgn[i].size;
-		phys_size_t rgnflags = rgn[i].flags;
+		enum lmb_flags rgnflags = rgn[i].flags;
 
 		ret = lmb_addrs_adjacent(base, size, rgnbase, rgnsize);
 		if (ret > 0) {