diff mbox series

[1/1] stm32mp: fix board_get_alt_info_mmc()

Message ID 20220111145808.487868-1-heinrich.schuchardt@canonical.com
State Accepted
Commit 6ddc71c13e1b78560d3869bc394144e91972e44f
Delegated to: Patrice Chotard
Headers show
Series [1/1] stm32mp: fix board_get_alt_info_mmc() | expand

Commit Message

Heinrich Schuchardt Jan. 11, 2022, 2:58 p.m. UTC
MAX_SEARCH_PARTITIONS is the highest possible partition number.
Do not skip the last partition in board_get_alt_info_mmc().

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 board/st/common/stm32mp_dfu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Patrice CHOTARD Jan. 14, 2022, 2:26 p.m. UTC | #1
Hi Heinrich

On 1/11/22 3:58 PM, Heinrich Schuchardt wrote:
> MAX_SEARCH_PARTITIONS is the highest possible partition number.
> Do not skip the last partition in board_get_alt_info_mmc().
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  board/st/common/stm32mp_dfu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c
> index a3f0da5b5b..fa48b2a35e 100644
> --- a/board/st/common/stm32mp_dfu.c
> +++ b/board/st/common/stm32mp_dfu.c
> @@ -57,7 +57,7 @@ static void board_get_alt_info_mmc(struct udevice *dev, char *buf)
>  		first = false;
>  	}
>  
> -	for (p = 1; p < MAX_SEARCH_PARTITIONS; p++) {
> +	for (p = 1; p <= MAX_SEARCH_PARTITIONS; p++) {
>  		if (part_get_info(desc, p, &info))
>  			continue;
>  		if (!first)
> 

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Thanks
Patrice
Patrick Delaunay Jan. 21, 2022, 8:43 a.m. UTC | #2
Hi,

On 1/11/22 3:58 PM, Heinrich Schuchardt wrote:
> MAX_SEARCH_PARTITIONS is the highest possible partition number.
> Do not skip the last partition in board_get_alt_info_mmc().
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>   board/st/common/stm32mp_dfu.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c
> index a3f0da5b5b..fa48b2a35e 100644
> --- a/board/st/common/stm32mp_dfu.c
> +++ b/board/st/common/stm32mp_dfu.c
> @@ -57,7 +57,7 @@ static void board_get_alt_info_mmc(struct udevice *dev, char *buf)
>   		first = false;
>   	}
>   
> -	for (p = 1; p < MAX_SEARCH_PARTITIONS; p++) {
> +	for (p = 1; p <= MAX_SEARCH_PARTITIONS; p++) {
>   		if (part_get_info(desc, p, &info))
>   			continue;
>   		if (!first)




Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>

Thanks
Patrick
Patrice CHOTARD Jan. 24, 2022, 12:14 p.m. UTC | #3
Hi Heinrich

On 1/11/22 15:58, Heinrich Schuchardt wrote:
> MAX_SEARCH_PARTITIONS is the highest possible partition number.
> Do not skip the last partition in board_get_alt_info_mmc().
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  board/st/common/stm32mp_dfu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c
> index a3f0da5b5b..fa48b2a35e 100644
> --- a/board/st/common/stm32mp_dfu.c
> +++ b/board/st/common/stm32mp_dfu.c
> @@ -57,7 +57,7 @@ static void board_get_alt_info_mmc(struct udevice *dev, char *buf)
>  		first = false;
>  	}
>  
> -	for (p = 1; p < MAX_SEARCH_PARTITIONS; p++) {
> +	for (p = 1; p <= MAX_SEARCH_PARTITIONS; p++) {
>  		if (part_get_info(desc, p, &info))
>  			continue;
>  		if (!first)
Applied to u-boot-stm/master

Thanks
Patrice
diff mbox series

Patch

diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c
index a3f0da5b5b..fa48b2a35e 100644
--- a/board/st/common/stm32mp_dfu.c
+++ b/board/st/common/stm32mp_dfu.c
@@ -57,7 +57,7 @@  static void board_get_alt_info_mmc(struct udevice *dev, char *buf)
 		first = false;
 	}
 
-	for (p = 1; p < MAX_SEARCH_PARTITIONS; p++) {
+	for (p = 1; p <= MAX_SEARCH_PARTITIONS; p++) {
 		if (part_get_info(desc, p, &info))
 			continue;
 		if (!first)