U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] boot/android_ab.c: Make use of LBAF for printing lbaint_t
@ 2025-07-02  1:06 Tom Rini
  2025-07-02  1:06 ` [PATCH 2/2] common/avb_verify.c: " Tom Rini
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Tom Rini @ 2025-07-02  1:06 UTC (permalink / raw)
  To: u-boot; +Cc: Mattijs Korpershoek, Igor Opaniuk, Sam Protsenko

When printing the contents of an lbaint_t variable we need to use LBAF
to print it in order to get the correct format type depending on 32 or
64bit-ness. Furthermore, printed message should not be split as that
makes finding them harder, so bring this back to a single line.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
Cc: Mattijs Korpershoek <mkorpershoek@kernel.org>
Cc: Igor Opaniuk <igor.opaniuk@gmail.com>
Cc: Sam Protsenko <semen.protsenko@linaro.org>
---
 boot/android_ab.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/boot/android_ab.c b/boot/android_ab.c
index a287eac04fe8..13e82dbcb7fe 100644
--- a/boot/android_ab.c
+++ b/boot/android_ab.c
@@ -101,8 +101,7 @@ static int ab_control_create_from_disk(struct blk_desc *dev_desc,
 	abc_blocks = DIV_ROUND_UP(sizeof(struct bootloader_control),
 				  part_info->blksz);
 	if (abc_offset + abc_blocks > part_info->size) {
-		log_err("ANDROID: boot control partition too small. Need at");
-		log_err(" least %lu blocks but have %lu blocks.\n",
+		log_err("ANDROID: boot control partition too small. Need at least %lu blocks but have " LBAF " blocks.\n",
 			abc_offset + abc_blocks, part_info->size);
 		return -EINVAL;
 	}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] common/avb_verify.c: Make use of LBAF for printing lbaint_t
  2025-07-02  1:06 [PATCH 1/2] boot/android_ab.c: Make use of LBAF for printing lbaint_t Tom Rini
@ 2025-07-02  1:06 ` Tom Rini
  2025-07-02 10:29   ` Mattijs Korpershoek
  2025-07-03 16:01   ` Sam Protsenko
  2025-07-02 10:27 ` [PATCH 1/2] boot/android_ab.c: " Mattijs Korpershoek
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 7+ messages in thread
From: Tom Rini @ 2025-07-02  1:06 UTC (permalink / raw)
  To: u-boot; +Cc: Mattijs Korpershoek, Igor Opaniuk, Sam Protsenko

When printing the contents of an lbaint_t variable we need to use LBAF
to print it in order to get the correct format type depending on 32 or
64bit-ness.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
Cc: Mattijs Korpershoek <mkorpershoek@kernel.org>
Cc: Igor Opaniuk <igor.opaniuk@gmail.com>
Cc: Sam Protsenko <semen.protsenko@linaro.org>
---
 common/avb_verify.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/avb_verify.c b/common/avb_verify.c
index cff9117d92f1..29a3272579cf 100644
--- a/common/avb_verify.c
+++ b/common/avb_verify.c
@@ -320,7 +320,7 @@ static unsigned long mmc_read_and_flush(struct mmc_part *part,
 	}
 	if ((start + sectors) > (part->info.start + part->info.size)) {
 		sectors = part->info.start + part->info.size - start;
-		printf("%s: read sector aligned to partition bounds (%ld)\n",
+		printf("%s: read sector aligned to partition bounds (" LBAF ")\n",
 		       __func__, sectors);
 	}
 
@@ -363,7 +363,7 @@ static unsigned long mmc_write(struct mmc_part *part, lbaint_t start,
 	}
 	if ((start + sectors) > (part->info.start + part->info.size)) {
 		sectors = part->info.start + part->info.size - start;
-		printf("%s: sector aligned to partition bounds (%ld)\n",
+		printf("%s: sector aligned to partition bounds (" LBAF ")\n",
 		       __func__, sectors);
 	}
 	if (unaligned) {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] boot/android_ab.c: Make use of LBAF for printing lbaint_t
  2025-07-02  1:06 [PATCH 1/2] boot/android_ab.c: Make use of LBAF for printing lbaint_t Tom Rini
  2025-07-02  1:06 ` [PATCH 2/2] common/avb_verify.c: " Tom Rini
@ 2025-07-02 10:27 ` Mattijs Korpershoek
  2025-07-03 16:00 ` Sam Protsenko
  2025-07-09  8:03 ` Mattijs Korpershoek
  3 siblings, 0 replies; 7+ messages in thread
From: Mattijs Korpershoek @ 2025-07-02 10:27 UTC (permalink / raw)
  To: Tom Rini, u-boot; +Cc: Mattijs Korpershoek, Igor Opaniuk, Sam Protsenko

Hi Tom,

Thank you for the patch.

On Tue, Jul 01, 2025 at 19:06, Tom Rini <trini@konsulko.com> wrote:

> When printing the contents of an lbaint_t variable we need to use LBAF
> to print it in order to get the correct format type depending on 32 or
> 64bit-ness. Furthermore, printed message should not be split as that
> makes finding them harder, so bring this back to a single line.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>

> ---
> Cc: Mattijs Korpershoek <mkorpershoek@kernel.org>
> Cc: Igor Opaniuk <igor.opaniuk@gmail.com>
> Cc: Sam Protsenko <semen.protsenko@linaro.org>
> ---
>  boot/android_ab.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/boot/android_ab.c b/boot/android_ab.c
> index a287eac04fe8..13e82dbcb7fe 100644
> --- a/boot/android_ab.c
> +++ b/boot/android_ab.c
> @@ -101,8 +101,7 @@ static int ab_control_create_from_disk(struct blk_desc *dev_desc,
>  	abc_blocks = DIV_ROUND_UP(sizeof(struct bootloader_control),
>  				  part_info->blksz);
>  	if (abc_offset + abc_blocks > part_info->size) {
> -		log_err("ANDROID: boot control partition too small. Need at");
> -		log_err(" least %lu blocks but have %lu blocks.\n",
> +		log_err("ANDROID: boot control partition too small. Need at least %lu blocks but have " LBAF " blocks.\n",
>  			abc_offset + abc_blocks, part_info->size);
>  		return -EINVAL;
>  	}
> -- 
> 2.43.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] common/avb_verify.c: Make use of LBAF for printing lbaint_t
  2025-07-02  1:06 ` [PATCH 2/2] common/avb_verify.c: " Tom Rini
@ 2025-07-02 10:29   ` Mattijs Korpershoek
  2025-07-03 16:01   ` Sam Protsenko
  1 sibling, 0 replies; 7+ messages in thread
From: Mattijs Korpershoek @ 2025-07-02 10:29 UTC (permalink / raw)
  To: Tom Rini, u-boot; +Cc: Mattijs Korpershoek, Igor Opaniuk, Sam Protsenko

Hi Tom,

Thank you for the patch.

On Tue, Jul 01, 2025 at 19:06, Tom Rini <trini@konsulko.com> wrote:

> When printing the contents of an lbaint_t variable we need to use LBAF
> to print it in order to get the correct format type depending on 32 or
> 64bit-ness.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>

> ---
> Cc: Mattijs Korpershoek <mkorpershoek@kernel.org>
> Cc: Igor Opaniuk <igor.opaniuk@gmail.com>
> Cc: Sam Protsenko <semen.protsenko@linaro.org>
> ---
>  common/avb_verify.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/common/avb_verify.c b/common/avb_verify.c
> index cff9117d92f1..29a3272579cf 100644
> --- a/common/avb_verify.c
> +++ b/common/avb_verify.c
> @@ -320,7 +320,7 @@ static unsigned long mmc_read_and_flush(struct mmc_part *part,
>  	}
>  	if ((start + sectors) > (part->info.start + part->info.size)) {
>  		sectors = part->info.start + part->info.size - start;
> -		printf("%s: read sector aligned to partition bounds (%ld)\n",
> +		printf("%s: read sector aligned to partition bounds (" LBAF ")\n",
>  		       __func__, sectors);
>  	}
>  
> @@ -363,7 +363,7 @@ static unsigned long mmc_write(struct mmc_part *part, lbaint_t start,
>  	}
>  	if ((start + sectors) > (part->info.start + part->info.size)) {
>  		sectors = part->info.start + part->info.size - start;
> -		printf("%s: sector aligned to partition bounds (%ld)\n",
> +		printf("%s: sector aligned to partition bounds (" LBAF ")\n",
>  		       __func__, sectors);
>  	}
>  	if (unaligned) {
> -- 
> 2.43.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] boot/android_ab.c: Make use of LBAF for printing lbaint_t
  2025-07-02  1:06 [PATCH 1/2] boot/android_ab.c: Make use of LBAF for printing lbaint_t Tom Rini
  2025-07-02  1:06 ` [PATCH 2/2] common/avb_verify.c: " Tom Rini
  2025-07-02 10:27 ` [PATCH 1/2] boot/android_ab.c: " Mattijs Korpershoek
@ 2025-07-03 16:00 ` Sam Protsenko
  2025-07-09  8:03 ` Mattijs Korpershoek
  3 siblings, 0 replies; 7+ messages in thread
From: Sam Protsenko @ 2025-07-03 16:00 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot, Mattijs Korpershoek, Igor Opaniuk

On Tue, Jul 1, 2025 at 8:06 PM Tom Rini <trini@konsulko.com> wrote:
>
> When printing the contents of an lbaint_t variable we need to use LBAF
> to print it in order to get the correct format type depending on 32 or
> 64bit-ness. Furthermore, printed message should not be split as that
> makes finding them harder, so bring this back to a single line.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Cc: Mattijs Korpershoek <mkorpershoek@kernel.org>
> Cc: Igor Opaniuk <igor.opaniuk@gmail.com>
> Cc: Sam Protsenko <semen.protsenko@linaro.org>
> ---

Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>

>  boot/android_ab.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/boot/android_ab.c b/boot/android_ab.c
> index a287eac04fe8..13e82dbcb7fe 100644
> --- a/boot/android_ab.c
> +++ b/boot/android_ab.c
> @@ -101,8 +101,7 @@ static int ab_control_create_from_disk(struct blk_desc *dev_desc,
>         abc_blocks = DIV_ROUND_UP(sizeof(struct bootloader_control),
>                                   part_info->blksz);
>         if (abc_offset + abc_blocks > part_info->size) {
> -               log_err("ANDROID: boot control partition too small. Need at");
> -               log_err(" least %lu blocks but have %lu blocks.\n",
> +               log_err("ANDROID: boot control partition too small. Need at least %lu blocks but have " LBAF " blocks.\n",
>                         abc_offset + abc_blocks, part_info->size);
>                 return -EINVAL;
>         }
> --
> 2.43.0
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] common/avb_verify.c: Make use of LBAF for printing lbaint_t
  2025-07-02  1:06 ` [PATCH 2/2] common/avb_verify.c: " Tom Rini
  2025-07-02 10:29   ` Mattijs Korpershoek
@ 2025-07-03 16:01   ` Sam Protsenko
  1 sibling, 0 replies; 7+ messages in thread
From: Sam Protsenko @ 2025-07-03 16:01 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot, Mattijs Korpershoek, Igor Opaniuk

On Tue, Jul 1, 2025 at 8:06 PM Tom Rini <trini@konsulko.com> wrote:
>
> When printing the contents of an lbaint_t variable we need to use LBAF
> to print it in order to get the correct format type depending on 32 or
> 64bit-ness.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Cc: Mattijs Korpershoek <mkorpershoek@kernel.org>
> Cc: Igor Opaniuk <igor.opaniuk@gmail.com>
> Cc: Sam Protsenko <semen.protsenko@linaro.org>
> ---

Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>

>  common/avb_verify.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/common/avb_verify.c b/common/avb_verify.c
> index cff9117d92f1..29a3272579cf 100644
> --- a/common/avb_verify.c
> +++ b/common/avb_verify.c
> @@ -320,7 +320,7 @@ static unsigned long mmc_read_and_flush(struct mmc_part *part,
>         }
>         if ((start + sectors) > (part->info.start + part->info.size)) {
>                 sectors = part->info.start + part->info.size - start;
> -               printf("%s: read sector aligned to partition bounds (%ld)\n",
> +               printf("%s: read sector aligned to partition bounds (" LBAF ")\n",
>                        __func__, sectors);
>         }
>
> @@ -363,7 +363,7 @@ static unsigned long mmc_write(struct mmc_part *part, lbaint_t start,
>         }
>         if ((start + sectors) > (part->info.start + part->info.size)) {
>                 sectors = part->info.start + part->info.size - start;
> -               printf("%s: sector aligned to partition bounds (%ld)\n",
> +               printf("%s: sector aligned to partition bounds (" LBAF ")\n",
>                        __func__, sectors);
>         }
>         if (unaligned) {
> --
> 2.43.0
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] boot/android_ab.c: Make use of LBAF for printing lbaint_t
  2025-07-02  1:06 [PATCH 1/2] boot/android_ab.c: Make use of LBAF for printing lbaint_t Tom Rini
                   ` (2 preceding siblings ...)
  2025-07-03 16:00 ` Sam Protsenko
@ 2025-07-09  8:03 ` Mattijs Korpershoek
  3 siblings, 0 replies; 7+ messages in thread
From: Mattijs Korpershoek @ 2025-07-09  8:03 UTC (permalink / raw)
  To: u-boot, Tom Rini; +Cc: Igor Opaniuk, Sam Protsenko

Hi,

On Tue, 01 Jul 2025 19:06:02 -0600, Tom Rini wrote:
> When printing the contents of an lbaint_t variable we need to use LBAF
> to print it in order to get the correct format type depending on 32 or
> 64bit-ness. Furthermore, printed message should not be split as that
> makes finding them harder, so bring this back to a single line.
> 
> 

Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-dfu (u-boot-dfu)

[1/2] boot/android_ab.c: Make use of LBAF for printing lbaint_t
      https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/ab0d5fe4cba420467689be9cbf4ddccabc54cfa8
[2/2] common/avb_verify.c: Make use of LBAF for printing lbaint_t
      https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/34272133d9e5a46fde6c7f87e452e4b5e51c2999

--
Mattijs

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-07-09  8:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02  1:06 [PATCH 1/2] boot/android_ab.c: Make use of LBAF for printing lbaint_t Tom Rini
2025-07-02  1:06 ` [PATCH 2/2] common/avb_verify.c: " Tom Rini
2025-07-02 10:29   ` Mattijs Korpershoek
2025-07-03 16:01   ` Sam Protsenko
2025-07-02 10:27 ` [PATCH 1/2] boot/android_ab.c: " Mattijs Korpershoek
2025-07-03 16:00 ` Sam Protsenko
2025-07-09  8:03 ` Mattijs Korpershoek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox