Commit f905f893e3ccdb30224583f3b9d9b6ac38b8a652

Authored by Breno Lima
Committed by Ye Li
1 parent dd058bca4a

MLK-21251-1 imx: hab: Fix build warnings in 32-bit targets

When building 32-bit targets with CONFIG_SECURE_BOOT and DEBUG enabled
the following warnings are displayed:

arch/arm/mach-imx/hab.c:840:41: warning: format '%lx' expects argument \
of type 'long unsigned int', but argument 3 has type 'uint32_t \
{aka unsigned int}' [-Wformat=]
   printf("HAB check target 0x%08x-0x%08lx fail\n",
                                     ~~~~^
                                     %08x
          ddr_start, ddr_start + bytes);

arch/arm/mach-imx/hab.c:845:45: warning: format '%x' expects argument \
of type 'unsigned int', but argument 3 has type 'ulong \
{aka long unsigned int}' [-Wformat=]
  printf("\nivt_offset = 0x%x, ivt addr = 0x%x\n", ivt_offset, ivt_addr);
                                            ~^
                                            %lx

Fix warnings by providing the correct data type.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
(cherry picked from commit 050beb8ee3fc4c690c9ce7c4f47adfc6f48dccdf)

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

arch/arm/mach-imx/hab.c
... ... @@ -836,11 +836,11 @@
836 836 status = hab_rvt_check_target(HAB_TGT_MEMORY, (void *)(ulong)ddr_start, bytes);
837 837 if (status != HAB_SUCCESS) {
838 838 printf("HAB check target 0x%08x-0x%08lx fail\n",
839   - ddr_start, ddr_start + bytes);
  839 + ddr_start, ddr_start + (ulong)bytes);
840 840 goto hab_exit_failure_print_status;
841 841 }
842 842 #ifdef DEBUG
843   - printf("\nivt_offset = 0x%x, ivt addr = 0x%x\n", ivt_offset, ivt_addr);
  843 + printf("\nivt_offset = 0x%x, ivt addr = 0x%lx\n", ivt_offset, ivt_addr);
844 844 printf("ivt entry = 0x%08x, dcd = 0x%08x, csf = 0x%08x\n", ivt->entry,
845 845 ivt->dcd, ivt->csf);
846 846 puts("Dumping IVT\n");