diff options
author | pfg <pfg@FreeBSD.org> | 2016-04-26 14:47:52 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-04-26 14:47:52 +0000 |
commit | d47c7f961b75cdf6a5e85882878f6a2fd3a114be (patch) | |
tree | 453119197aa134a96f5ccc1ef27fd22434fa92ef /sys/arm/at91 | |
parent | 2a473e5a33c7e9694074a8c154bb60515fb9de81 (diff) | |
download | FreeBSD-src-d47c7f961b75cdf6a5e85882878f6a2fd3a114be.zip FreeBSD-src-d47c7f961b75cdf6a5e85882878f6a2fd3a114be.tar.gz |
sys/arm: make use of the howmany() macro when available.
We have a howmany() macro in the <sys/param.h> header that is
convenient to re-use as it makes things easier to read.
Diffstat (limited to 'sys/arm/at91')
-rw-r--r-- | sys/arm/at91/at91_pit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/arm/at91/at91_pit.c b/sys/arm/at91/at91_pit.c index a4b58eb..d58129f 100644 --- a/sys/arm/at91/at91_pit.c +++ b/sys/arm/at91/at91_pit.c @@ -98,7 +98,7 @@ at91_pit_delay(int us) /* Max delay ~= 260s. @ 133Mhz */ pit_freq = at91_master_clock / PIT_PRESCALE; - cnt = ((pit_freq * us) + (mhz -1)) / mhz; + cnt = howmany(pit_freq * us, mhz); cnt = (cnt <= 0) ? 1 : cnt; while (cnt > 0) { |