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<[EMAIL PROTECTED]>



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;

Reply via email to