diff mbox series

[1/4] tools: zynqmpimage: show info on partition 0

Message ID 20240104185258.39465-1-brandon.maier@collins.com
State Accepted
Commit 85acf83a09583e472538c23c6a2d23176135485f
Delegated to: Michal Simek
Headers show
Series [1/4] tools: zynqmpimage: show info on partition 0 | expand

Commit Message

Brandon Maier Jan. 4, 2024, 6:50 p.m. UTC
The zynqmpimage_print_header() skips printing the first partition. This
is because the image header can contain duplicate fields as the first
partition. However some fields, like the partition attributes, are only
present in the partition table. It is also possible for the first
partition to not be declared in the image header, if the image is not a
bootloader image.

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
---

 tools/zynqmpimage.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Michal Simek Jan. 10, 2024, 9:06 a.m. UTC | #1
On 1/4/24 19:50, Brandon Maier wrote:
> The zynqmpimage_print_header() skips printing the first partition. This
> is because the image header can contain duplicate fields as the first
> partition. However some fields, like the partition attributes, are only
> present in the partition table. It is also possible for the first
> partition to not be declared in the image header, if the image is not a
> bootloader image.
> 
> Signed-off-by: Brandon Maier <brandon.maier@collins.com>
> ---
> 
>   tools/zynqmpimage.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/tools/zynqmpimage.c b/tools/zynqmpimage.c
> index bb54f41a153..05af1e81a24 100644
> --- a/tools/zynqmpimage.c
> +++ b/tools/zynqmpimage.c
> @@ -262,9 +262,7 @@ void zynqmpimage_print_header(const void *ptr, struct image_tool_params *params)
>   		for (i = 0; i < le32_to_cpu(iht->nr_parts); i++) {
>   			next = le32_to_cpu(ph->next_partition_offset) * 4;
>   
> -			/* Partition 0 is the base image itself */
> -			if (i)
> -				print_partition(ptr, ph);
> +			print_partition(ptr, ph);
>   
>   			ph = (void *)ptr + next;
>   		}


Applied all. With also removing "This contributor prefers not to receive mails 
<noreply@example.com>" from my reply.

M
diff mbox series

Patch

diff --git a/tools/zynqmpimage.c b/tools/zynqmpimage.c
index bb54f41a153..05af1e81a24 100644
--- a/tools/zynqmpimage.c
+++ b/tools/zynqmpimage.c
@@ -262,9 +262,7 @@  void zynqmpimage_print_header(const void *ptr, struct image_tool_params *params)
 		for (i = 0; i < le32_to_cpu(iht->nr_parts); i++) {
 			next = le32_to_cpu(ph->next_partition_offset) * 4;
 
-			/* Partition 0 is the base image itself */
-			if (i)
-				print_partition(ptr, ph);
+			print_partition(ptr, ph);
 
 			ph = (void *)ptr + next;
 		}