Skip to content

Commit 919242d

Browse files
pkarashchenkoxiaoxiang781216
authored andcommitted
arch/arm/samv7: fix warnings in rswdt
Signed-off-by: Petro Karashchenko <[email protected]>
1 parent beda2ab commit 919242d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

arch/arm/src/samv7/sam_rswdt.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <nuttx/config.h>
2626
#include <nuttx/arch.h>
2727

28+
#include <inttypes.h>
2829
#include <stdint.h>
2930
#include <assert.h>
3031
#include <errno.h>
@@ -411,9 +412,9 @@ static int sam_getstatus(struct watchdog_lowerhalf_s *lower,
411412
status->timeleft = 0;
412413

413414
wdinfo("Status :\n");
414-
wdinfo(" flags : %08x\n", status->flags);
415-
wdinfo(" timeout : %d\n", status->timeout);
416-
wdinfo(" timeleft : %d\n", status->timeleft);
415+
wdinfo(" flags : %08" PRIx32 "\n", status->flags);
416+
wdinfo(" timeout : %" PRIu32 "\n", status->timeout);
417+
wdinfo(" timeleft : %" PRIu32 "\n", status->timeleft);
417418
return OK;
418419
}
419420

@@ -441,13 +442,13 @@ static int sam_settimeout(struct watchdog_lowerhalf_s *lower,
441442
uint32_t regval;
442443

443444
DEBUGASSERT(priv);
444-
wdinfo("Entry: timeout=%d\n", timeout);
445+
wdinfo("Entry: timeout=%" PRIu32 "\n", timeout);
445446

446447
/* Can this timeout be represented? */
447448

448449
if (timeout < RSWDT_MINTIMEOUT || timeout >= RSWDT_MAXTIMEOUT)
449450
{
450-
wderr("ERROR: Cannot represent timeout: %d < %d > %d\n",
451+
wderr("ERROR: Cannot represent timeout: %d < %" PRIu32 " > %d\n",
451452
RSWDT_MINTIMEOUT, timeout, RSWDT_MAXTIMEOUT);
452453
return -ERANGE;
453454
}
@@ -480,7 +481,7 @@ static int sam_settimeout(struct watchdog_lowerhalf_s *lower,
480481

481482
priv->reload = reload;
482483

483-
wdinfo("reload=%d timeout: %d->%d\n",
484+
wdinfo("reload=%" PRIu32 " timeout: %" PRIu32 "->%" PRIu32 "\n",
484485
reload, timeout, priv->timeout);
485486

486487
/* Set the RSWDT_MR according to calculated value
@@ -525,7 +526,7 @@ static int sam_settimeout(struct watchdog_lowerhalf_s *lower,
525526

526527
priv->started = true;
527528

528-
wdinfo("Setup: CR: %08x MR: %08x SR: %08x\n",
529+
wdinfo("Setup: CR: %08" PRIx32 " MR: %08" PRIx32 " SR: %08" PRIx32 "\n",
529530
sam_getreg(SAM_RSWDT_CR), sam_getreg(SAM_RSWDT_MR),
530531
sam_getreg(SAM_RSWDT_SR));
531532

@@ -651,7 +652,7 @@ int sam_rswdt_initialize(void)
651652
{
652653
struct sam_lowerhalf_s *priv = &g_wdtdev;
653654

654-
wdinfo("Entry: CR: %08x MR: %08x SR: %08x\n",
655+
wdinfo("Entry: CR: %08" PRIx32 " MR: %08" PRIx32 " SR: %08" PRIx32 "\n",
655656
sam_getreg(SAM_RSWDT_CR), sam_getreg(SAM_RSWDT_MR),
656657
sam_getreg(SAM_RSWDT_SR));
657658

0 commit comments

Comments
 (0)