Netdev List
 help / color / mirror / Atom feed
* [PATCH][IPSEC]: Aggregate make_jiffies
@ 2006-08-16  1:58 jamal
  2006-08-16  2:33 ` Herbert Xu
  0 siblings, 1 reply; 5+ messages in thread
From: jamal @ 2006-08-16  1:58 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller; +Cc: netdev

[-- Attachment #1: Type: text/plain, Size: 196 bytes --]


make_jiffies definition is repeated in xfrm_state and xfrm_policy.
Aggregate in header instead. Against Dave's last perf improvement
patches.

signed-off-by: Jamal Hadi Salim<hadi@cyberus.ca>




[-- Attachment #2: ipsec-p111 --]
[-- Type: text/x-patch, Size: 1533 bytes --]

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 8123d49..05444dd 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -619,6 +619,14 @@ xfrm_state_addr_cmp(struct xfrm_tmpl *tm
 	return !0;
 }
 
+static inline unsigned long make_jiffies(long secs)
+{
+	if (secs >= (MAX_SCHEDULE_TIMEOUT-1)/HZ)
+		return MAX_SCHEDULE_TIMEOUT-1;
+	else
+		return secs*HZ;
+}
+
 #ifdef CONFIG_XFRM
 
 extern int __xfrm_policy_check(struct sock *, int dir, struct sk_buff *skb, unsigned short family);
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index a378812..cd785be 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -220,14 +220,6 @@ void xfrm_put_mode(struct xfrm_mode *mod
 	module_put(mode->owner);
 }
 
-static inline unsigned long make_jiffies(long secs)
-{
-	if (secs >= (MAX_SCHEDULE_TIMEOUT-1)/HZ)
-		return MAX_SCHEDULE_TIMEOUT-1;
-	else
-	        return secs*HZ;
-}
-
 static void xfrm_policy_timer(unsigned long data)
 {
 	struct xfrm_policy *xp = (struct xfrm_policy*)data;
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index b1c0ae7..00ae0f8 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -264,14 +264,6 @@ static void xfrm_state_gc_task(void *dat
 	wake_up(&km_waitq);
 }
 
-static inline unsigned long make_jiffies(long secs)
-{
-	if (secs >= (MAX_SCHEDULE_TIMEOUT-1)/HZ)
-		return MAX_SCHEDULE_TIMEOUT-1;
-	else
-	        return secs*HZ;
-}
-
 static void xfrm_timer_handler(unsigned long data)
 {
 	struct xfrm_state *x = (struct xfrm_state*)data;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-08-16 13:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-16  1:58 [PATCH][IPSEC]: Aggregate make_jiffies jamal
2006-08-16  2:33 ` Herbert Xu
2006-08-16  2:59   ` jamal
2006-08-16 13:13     ` jamal
2006-08-16 13:24       ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox