diff options
author | pfg <pfg@FreeBSD.org> | 2016-04-26 15:38:17 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-04-26 15:38:17 +0000 |
commit | fc01419148d065603607b1008d536431465f3bc3 (patch) | |
tree | 1bff72784c0591a61e4e16e97fae48d0614891dc /sys/netgraph | |
parent | 3a3f015eb3ae533a46cf30b5262d15cb4b5db097 (diff) | |
download | FreeBSD-src-fc01419148d065603607b1008d536431465f3bc3.zip FreeBSD-src-fc01419148d065603607b1008d536431465f3bc3.tar.gz |
sys: extend 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/netgraph')
-rw-r--r-- | sys/netgraph/ng_pptpgre.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netgraph/ng_pptpgre.c b/sys/netgraph/ng_pptpgre.c index 83d3e0a..6dc5b2d 100644 --- a/sys/netgraph/ng_pptpgre.c +++ b/sys/netgraph/ng_pptpgre.c @@ -846,7 +846,7 @@ ng_pptpgre_start_recv_ack_timer(hpriv_p hpriv) remain = 0; /* Be conservative: timeout can happen up to 1 tick early */ - ticks = (((remain * hz) + PPTP_TIME_SCALE - 1) / PPTP_TIME_SCALE) + 1; + ticks = howmany(remain * hz, PPTP_TIME_SCALE) + 1; ng_callout(&hpriv->rackTimer, hpriv->node, hpriv->hook, ticks, ng_pptpgre_recv_ack_timeout, hpriv, 0); } @@ -894,7 +894,7 @@ ng_pptpgre_start_send_ack_timer(hpriv_p hpriv) ackTimeout = PPTP_MAX_ACK_DELAY; /* Be conservative: timeout can happen up to 1 tick early */ - ticks = (((ackTimeout * hz) + PPTP_TIME_SCALE - 1) / PPTP_TIME_SCALE); + ticks = howmany(ackTimeout * hz, PPTP_TIME_SCALE); ng_callout(&hpriv->sackTimer, hpriv->node, hpriv->hook, ticks, ng_pptpgre_send_ack_timeout, hpriv, 0); } |