2007-12-06 16:10:20

by cheng renquan

[permalink] [raw]
Subject: [PATCH 17/20] net/xfrm/xfrm_state.c: use LIST_HEAD instead of LIST_HEAD_INIT

single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng <[email protected]>
---
net/xfrm/xfrm_state.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index cf43c49..452d972 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -1657,7 +1657,7 @@ void xfrm_replay_advance(struct xfrm_state *x, __be32 net_seq)
}
EXPORT_SYMBOL(xfrm_replay_advance);

-static struct list_head xfrm_km_list = LIST_HEAD_INIT(xfrm_km_list);
+static LIST_HEAD(xfrm_km_list);
static DEFINE_RWLOCK(xfrm_km_lock);

void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c)
--
1.5.3.4


2007-12-07 08:51:39

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 17/20] net/xfrm/xfrm_state.c: use LIST_HEAD instead of LIST_HEAD_INIT

From: Denis Cheng <[email protected]>
Date: Fri, 7 Dec 2007 00:09:43 +0800

> single list_head variable initialized with LIST_HEAD_INIT could almost
> always can be replaced with LIST_HEAD declaration, this shrinks the code
> and looks better.
>
> Signed-off-by: Denis Cheng <[email protected]>

Applied.