aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>2007-08-28 18:50:33 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:48:37 -0400
commit172589ccdde41b59861c92c4a971b95514ef24e3 (patch)
treeae775e6db4cb85aad1c74b6d93ba359f9dfe88ea /net/ipv4
parentc45248c70125cc374fdf264659643276c72801bf (diff)
[NET]: DIV_ROUND_UP cleanup (part two)
Hopefully captured all single statement cases under net/. I'm not too sure if there is some policy about #includes that are "guaranteed" (ie., in the current tree) to be available through some other #included header, so I just added linux/kernel.h to each changed file that didn't #include it previously. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/inet_diag.c5
-rw-r--r--net/ipv4/inet_timewait_sock.c4
-rw-r--r--net/ipv4/tcp.c3
3 files changed, 7 insertions, 5 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index def007ec1d6f..686ddd62f71a 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -11,6 +11,7 @@
11 * 2 of the License, or (at your option) any later version. 11 * 2 of the License, or (at your option) any later version.
12 */ 12 */
13 13
14#include <linux/kernel.h>
14#include <linux/module.h> 15#include <linux/module.h>
15#include <linux/types.h> 16#include <linux/types.h>
16#include <linux/fcntl.h> 17#include <linux/fcntl.h>
@@ -112,7 +113,7 @@ static int inet_csk_diag_fill(struct sock *sk,
112 } 113 }
113#endif 114#endif
114 115
115#define EXPIRES_IN_MS(tmo) ((tmo - jiffies) * 1000 + HZ - 1) / HZ 116#define EXPIRES_IN_MS(tmo) DIV_ROUND_UP((tmo - jiffies) * 1000, HZ)
116 117
117 if (icsk->icsk_pending == ICSK_TIME_RETRANS) { 118 if (icsk->icsk_pending == ICSK_TIME_RETRANS) {
118 r->idiag_timer = 1; 119 r->idiag_timer = 1;
@@ -190,7 +191,7 @@ static int inet_twsk_diag_fill(struct inet_timewait_sock *tw,
190 r->id.idiag_dst[0] = tw->tw_daddr; 191 r->id.idiag_dst[0] = tw->tw_daddr;
191 r->idiag_state = tw->tw_substate; 192 r->idiag_state = tw->tw_substate;
192 r->idiag_timer = 3; 193 r->idiag_timer = 3;
193 r->idiag_expires = (tmo * 1000 + HZ - 1) / HZ; 194 r->idiag_expires = DIV_ROUND_UP(tmo * 1000, HZ);
194 r->idiag_rqueue = 0; 195 r->idiag_rqueue = 0;
195 r->idiag_wqueue = 0; 196 r->idiag_wqueue = 0;
196 r->idiag_uid = 0; 197 r->idiag_uid = 0;
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c
index 2586df09b9b6..4e189e28f306 100644
--- a/net/ipv4/inet_timewait_sock.c
+++ b/net/ipv4/inet_timewait_sock.c
@@ -8,7 +8,7 @@
8 * From code orinally in TCP 8 * From code orinally in TCP
9 */ 9 */
10 10
11 11#include <linux/kernel.h>
12#include <net/inet_hashtables.h> 12#include <net/inet_hashtables.h>
13#include <net/inet_timewait_sock.h> 13#include <net/inet_timewait_sock.h>
14#include <net/ip.h> 14#include <net/ip.h>
@@ -292,7 +292,7 @@ void inet_twsk_schedule(struct inet_timewait_sock *tw,
292 if (timeo >= timewait_len) { 292 if (timeo >= timewait_len) {
293 slot = INET_TWDR_TWKILL_SLOTS - 1; 293 slot = INET_TWDR_TWKILL_SLOTS - 1;
294 } else { 294 } else {
295 slot = (timeo + twdr->period - 1) / twdr->period; 295 slot = DIV_ROUND_UP(timeo, twdr->period);
296 if (slot >= INET_TWDR_TWKILL_SLOTS) 296 if (slot >= INET_TWDR_TWKILL_SLOTS)
297 slot = INET_TWDR_TWKILL_SLOTS - 1; 297 slot = INET_TWDR_TWKILL_SLOTS - 1;
298 } 298 }
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index aff31427f525..18c64c74f6d5 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -247,6 +247,7 @@
247 * TCP_CLOSE socket is finished 247 * TCP_CLOSE socket is finished
248 */ 248 */
249 249
250#include <linux/kernel.h>
250#include <linux/module.h> 251#include <linux/module.h>
251#include <linux/types.h> 252#include <linux/types.h>
252#include <linux/fcntl.h> 253#include <linux/fcntl.h>
@@ -2210,7 +2211,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
2210 goto out; 2211 goto out;
2211 2212
2212 mss = skb_shinfo(skb)->gso_size; 2213 mss = skb_shinfo(skb)->gso_size;
2213 skb_shinfo(skb)->gso_segs = (skb->len + mss - 1) / mss; 2214 skb_shinfo(skb)->gso_segs = DIV_ROUND_UP(skb->len, mss);
2214 2215
2215 segs = NULL; 2216 segs = NULL;
2216 goto out; 2217 goto out;