[PATCH v1 1/6] fastboot: Fix warning when CONFIG_SYS_64BIT_LBA is enable

Mattijs Korpershoek mkorpershoek at baylibre.com
Tue Dec 3 10:46:29 CET 2024


Hi Patrice,

Thank you for the patch.

On ven., nov. 29, 2024 at 13:27, Patrice Chotard <patrice.chotard at foss.st.com> wrote:

> If CONFIG_SYS_64BIT_LBA is enable, following compilation warning is
> triggered:
>
>  CC      drivers/fastboot/fb_mmc.o
> ../drivers/fastboot/fb_mmc.c: In function 'fb_mmc_erase_mmc_hwpart':
> ../drivers/fastboot/fb_mmc.c:215:35: warning: format '%lu' expects
> argument of type 'long unsigned int', but argument 2 has type
> 'long long unsigned int' [-Wformat=]
>   215 |         printf("........ erased %lu bytes from mmc hwpart[%u]\n",
>       |                                 ~~^
>       |                                   |
>       |                                   long unsigned int
>       |                                 %llu
>   216 |                dev_desc->lba * dev_desc->blksz, dev_desc->hwpart);
>       |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       |                              |
>       |                              long long unsigned int
> ../drivers/fastboot/fb_mmc.c: In function 'fb_mmc_boot_ops':
> ../drivers/fastboot/fb_mmc.c:261:42: warning: format '%lu' expects
> argument of type 'long unsigned int', but argument 2 has type
> 'long long unsigned int' [-Wformat=]
>   261 |                 printf("........ wrote %lu bytes to EMMC_BOOT%d\n",
>       |                                        ~~^
>       |                                          |
>       |                                          long unsigned int
>       |                                        %llu
>   262 |                        blkcnt * blksz, hwpart);
>       |                        ~~~~~~~~~~~~~~
>       |                               |
>       |                               long long unsigned int
>
> Signed-off-by: Patrice Chotard <patrice.chotard at foss.st.com>

Reviewed-by: Mattijs Korpershoek <mkorpershoek at baylibre.com>

Please feel free to take this through your tree.

Acked-by: Mattijs Korpershoek <mkorpershoek at baylibre.com>

> ---
>
>  drivers/fastboot/fb_mmc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c
> index f11eb66761b..dca7c222f35 100644
> --- a/drivers/fastboot/fb_mmc.c
> +++ b/drivers/fastboot/fb_mmc.c
> @@ -211,8 +211,8 @@ static int fb_mmc_erase_mmc_hwpart(struct blk_desc *dev_desc)
>  		return 1;
>  	}
>  
> -	printf("........ erased %lu bytes from mmc hwpart[%u]\n",
> -	       dev_desc->lba * dev_desc->blksz, dev_desc->hwpart);
> +	printf("........ erased %llu bytes from mmc hwpart[%u]\n",
> +	       (u64)(dev_desc->lba * dev_desc->blksz), dev_desc->hwpart);
>  
>  	return 0;
>  }
> @@ -257,8 +257,8 @@ static void fb_mmc_boot_ops(struct blk_desc *dev_desc, void *buffer,
>  			return;
>  		}
>  
> -		printf("........ wrote %lu bytes to EMMC_BOOT%d\n",
> -		       blkcnt * blksz, hwpart);
> +		printf("........ wrote %llu bytes to EMMC_BOOT%d\n",
> +		       (u64)(blkcnt * blksz), hwpart);
>  	} else { /* erase */
>  		if (fb_mmc_erase_mmc_hwpart(dev_desc)) {
>  			pr_err("Failed to erase EMMC_BOOT%d\n", hwpart);
> -- 
> 2.25.1


More information about the U-Boot mailing list