> > - total_ticks = DIV_ROUND_UP(rate, t->bus_freq_hz); > > + total_ticks = DIV_ROUND_UP(rate, t->bus_freq_hz ?: 1); > > Not sure clamping function min_t/min(t->bus_freq_hz, 1) > Or ternary condition is good in this case for avoiding potential division by 0? Both work. I chose the ternary because I believe it involves less computation and a tad tighter syntax.
Attachment:
signature.asc
Description: PGP signature