summaryrefslogtreecommitdiff
path: root/libhw_cr/rp2040_hwtimer.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-22 18:51:59 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-05-06 11:53:17 -0600
commit24e5d0ec1219e2dbb4b9510ef20833092a2b3871 (patch)
tree01bbcc34c6190fa1c35b2625e9ba1744b1447606 /libhw_cr/rp2040_hwtimer.c
parentf09b7435b3a5222597d27238226d23ec0cbd5bd2 (diff)
wip: Build with -Wconversionlukeshu/safe-conversion
I think this found a real bug in the dhcp packet parser. I don't think anything called lib9p_str{,n}() values that could be big enough, but their bounds-checking was broken.
Diffstat (limited to 'libhw_cr/rp2040_hwtimer.c')
-rw-r--r--libhw_cr/rp2040_hwtimer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libhw_cr/rp2040_hwtimer.c b/libhw_cr/rp2040_hwtimer.c
index 8227abb..7813dfa 100644
--- a/libhw_cr/rp2040_hwtimer.c
+++ b/libhw_cr/rp2040_hwtimer.c
@@ -109,9 +109,9 @@ static bool rp2040_hwtimer_add_trigger(struct rp2040_hwtimer *alarmclock,
*dst = trigger;
if (!alarmclock->initialized) {
hw_set_bits(&timer_hw->inte, 1 << alarmclock->alarm_num);
- irq_set_exclusive_handler(TIMER_ALARM_IRQ_NUM(timer_hw, alarmclock->alarm_num),
- rp2040_hwtimer_intrhandler);
- irq_set_enabled(TIMER_ALARM_IRQ_NUM(timer_hw, alarmclock->alarm_num), true);
+ uint irq_num = (uint)TIMER_ALARM_IRQ_NUM(timer_hw, alarmclock->alarm_num);
+ irq_set_exclusive_handler(irq_num, rp2040_hwtimer_intrhandler);
+ irq_set_enabled(irq_num, true);
alarmclock->initialized = true;
}
if (alarmclock->queue == trigger) {