> unsigned int (everywhere)? > Yes, this is the result of a long-by-long division, but it should be > a small value anyway. OK. > > + /* Tests showed that we need to wait 3 clocks here */ > > + unsigned long cmcnt_delay = ch->cmt->reg_delay * 3 / 2; > > DIV_ROUND_UP() Really here? reg_delay is ensured to be a multiple of two... > > + /* We shall wait 2 input clks after register writes */ > > + if (cmt->info->model >= SH_CMT_48BIT) // FIXME: Really not needed for older ones? > > + cmt->reg_delay = 2000000UL / rate + 1; ... but here it would make a lot of sense! > > + cmt->rate = cmt->info->width == 16 ? rate / 512 : rate / 8; > > cmt->rate = rate / (cmt->info->width == 16 ? 512 : 8); OK. I had it without the parens and it looked ugly. With parens it looks good.
Attachment:
signature.asc
Description: PGP signature