nuttx/arch/arm/src
Xiang Xiao 9ff99c6d0f !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats
Now that time_t is unconditionally 64-bit (signed int64_t) and the
struct timespec fields tv_sec / tv_nsec are wide enough on their own,
the explicit (uint64_t)/(int64_t)/(int) casts that used to guard the
multiplications and subtractions in *_us / *_ms / *_ns helpers are no
longer needed.  Drop them to keep the timekeeping math readable and
consistent with the previous sclock_t/time_t cleanup.

In the same spirit, this commit also:

* Normalises the printf-style format specifiers and casts used to
  print tv_sec / tv_nsec / tv_usec values across arch/, drivers/,
  fs/, sched/ and libs/.  The prior code was a mix of
  "%d"/"%u"/"%ld"/"%lu"/"%lld"/PRIu32/PRIu64 with matching
  (int)/(unsigned long)/(long long)/PRIu* casts; some formats
  truncated time_t on 32-bit hosts, others mismatched signedness or
  width.  Replace all such cases with the portable POSIX-recommended
  forms:

    - tv_sec  (time_t,       signed, impl-defined width) -> %jd  + (intmax_t)
    - tv_nsec (long,         signed)                     -> %ld  (no cast)
    - tv_usec (suseconds_t / long)                       -> %ld  (no cast)

  Add #include <stdint.h> where required.

* Drops a few stale `(FAR const time_t *)&ts.tv_sec` casts and
  related `(FAR struct tm *)` / `(const time_t *)` casts in
  gmtime_r() / localtime_r() / gmtime() callers; ts.tv_sec is plain
  time_t now and the casts only obscured the type.

* Fixes one overflow in fs/procfs/fs_procfscritmon.c where
  all_time.tv_sec * 1000000 could overflow on 32-bit time_t before
  being multiplied again; cast to uint64_t at the start.

No behavioural change.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-19 16:21:28 +08:00
..
a1x include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
am335x style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
arm include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
armv6-m arch/arm/arm_dispatch_syscall: fix callee-saved reg corruption in protected 2026-04-07 14:51:10 +02:00
armv7-a !sched/clock: remove CONFIG_SYSTEM_TIME64 and always use 64-bit time 2026-05-19 16:21:28 +08:00
armv7-m !sched/clock: remove CONFIG_SYSTEM_TIME64 and always use 64-bit time 2026-05-19 16:21:28 +08:00
armv7-r !sched/clock: remove CONFIG_SYSTEM_TIME64 and always use 64-bit time 2026-05-19 16:21:28 +08:00
armv8-m !sched/clock: remove CONFIG_SYSTEM_TIME64 and always use 64-bit time 2026-05-19 16:21:28 +08:00
armv8-r !sched/clock: remove CONFIG_SYSTEM_TIME64 and always use 64-bit time 2026-05-19 16:21:28 +08:00
at32 !drivers/pwm: remove PWM_MULTICHAN option 2026-05-18 11:35:25 -04:00
c5471 style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
cmake build/cmake/stdlib: guard include/cxx by LIBMINIABI, fix div_t conflict 2026-03-29 16:45:29 -03:00
common include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
csk6 include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
cxd32xx include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
cxd56xx !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
dm320 style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
efm32 !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
eoss3 include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
fvp-v8r-aarch32 include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
gd32f4 style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
goldfish include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
ht32f491x3 !drivers/pwm: remove PWM_MULTICHAN option 2026-05-18 11:35:25 -04:00
imx1 include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
imx6 include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
imx9 arch/arm/imx9: Add FlexIO support 2026-04-29 21:39:30 +08:00
imxrt !sys/types.h: change time_t and clock_t to int64_t to align with other OSes 2026-05-19 16:21:28 +08:00
kinetis !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
kl !drivers/pwm: remove PWM_MULTICHAN option 2026-05-18 11:35:25 -04:00
lc823450 !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
lpc17xx_40xx !drivers/pwm: remove PWM_MULTICHAN option 2026-05-18 11:35:25 -04:00
lpc31xx !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
lpc43xx !sched/clock: remove CONFIG_SYSTEM_TIME64 and always use 64-bit time 2026-05-19 16:21:28 +08:00
lpc54xx !sched/clock: remove CONFIG_SYSTEM_TIME64 and always use 64-bit time 2026-05-19 16:21:28 +08:00
lpc214x style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
lpc2378 style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
max326xx !sys/types.h: change time_t and clock_t to int64_t to align with other OSes 2026-05-19 16:21:28 +08:00
mcx-nxxx include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
moxart ghs: fix the UsageFault:INVSTATE error triggered by exception_common 2026-01-16 09:41:13 +08:00
mps include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
mx8mp include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
nrf52 !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
nrf53 !drivers/pwm: remove PWM_MULTICHAN option 2026-05-18 11:35:25 -04:00
nrf91 include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
nuc1xx style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
phy62xx style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
qemu include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
ra4 !drivers/pwm: remove PWM_MULTICHAN option 2026-05-18 11:35:25 -04:00
rp23xx !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
rp2040 !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
rtl8720c !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
s32k1xx !drivers/pwm: remove PWM_MULTICHAN option 2026-05-18 11:35:25 -04:00
s32k3xx !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
sam34 !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
sama5 !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
samd2l2 style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
samd5e5 !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
samv7 !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
stm32 !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
stm32f0l0g0 !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
stm32f7 !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
stm32h5 !drivers/pwm: remove PWM_MULTICHAN option 2026-05-18 11:35:25 -04:00
stm32h7 !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
stm32l4 !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
stm32l5 !drivers/pwm: remove PWM_MULTICHAN option 2026-05-18 11:35:25 -04:00
stm32n6 arch/arm/stm32n6: Add STM32N6 chip support. 2026-05-18 14:50:29 -03:00
stm32u5 !drivers/pwm: remove PWM_MULTICHAN option 2026-05-18 11:35:25 -04:00
stm32wb !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
stm32wl5 style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
str71x style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
tiva !drivers/pwm: remove PWM_MULTICHAN option 2026-05-18 11:35:25 -04:00
tlsr82 !drivers/pwm: remove PWM_MULTICHAN option 2026-05-18 11:35:25 -04:00
tms570 include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
xmc4 !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
.gitignore
CMakeLists.txt arch/qemu-armv7a: kernel mode cmake support 2025-01-02 23:13:07 +08:00
Makefile arch/*/src/Makefile: Avoid uncessary relinking of the nuttx binary. 2026-05-18 09:33:58 +02:00