Skip to content

Commit

Permalink
sama5/at25_main: fix direct use of nput, convert to int
Browse files Browse the repository at this point in the history
Signed-off-by: buxiasen <[email protected]>
  • Loading branch information
jasonbu authored and xiaoxiang781216 committed Nov 14, 2024
1 parent a5459cd commit f53f0ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions boards/arm/sama5/sama5d4-ek/src/at25_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ int at25_main(int argc, char *argv[])
/* The HEX file load was successful, write the data to FLASH */

printf("Successfully loaded the Intel HEX file into memory...\n");
printf(" Writing %d bytes to the AT25 Serial FLASH\n",
printf(" Writing %" PRIdOFF " bytes to the AT25 Serial FLASH\n",
memoutstream.common.nput);

remaining = memoutstream.common.nput;
Expand Down Expand Up @@ -215,7 +215,7 @@ int at25_main(int argc, char *argv[])
* the same.
*/

printf(" Verifying %d bytes in the AT25 Serial FLASH\n",
printf(" Verifying %" PRIdOFF " bytes in the AT25 Serial FLASH\n",
memoutstream.common.nput);

/* Open the AT25 device for writing */
Expand Down Expand Up @@ -254,7 +254,7 @@ int at25_main(int argc, char *argv[])
{
if (memcmp(g_iobuffer, src, nread) != 0)
{
fprintf(stderr, "ERROR: Verify failed at offset %d\n",
fprintf(stderr, "ERROR: Verify failed at offset %"PRIdOFF"\n",
memoutstream.common.nput - remaining);
close(fd);
return EXIT_FAILURE;
Expand All @@ -266,7 +266,7 @@ int at25_main(int argc, char *argv[])
}
while (remaining > 0);

printf(" Successfully verified %d bytes in the AT25 Serial FLASH\n",
printf("Successfully verified %"PRIdOFF" bytes in the AT25 Serial FLASH\n",
memoutstream.common.nput);

close(fd);
Expand Down

0 comments on commit f53f0ec

Please sign in to comment.