From: Sven Wegener Date: Sun, 10 Aug 2008 09:18:02 +0000 (+0000) Subject: ipvs: Use list_empty() instead of open-coding the same functionality X-Git-Tag: v2.6.27-rc4~103^2~43^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=66a0be47200fff30f8c482ea584052c6affb08cb;p=profile%2Fivi%2Fkernel-x86-ivi.git ipvs: Use list_empty() instead of open-coding the same functionality Signed-off-by: Sven Wegener Acked-by: Simon Horman --- diff --git a/net/ipv4/ipvs/ip_vs_sched.c b/net/ipv4/ipvs/ip_vs_sched.c index b647673..a46ad9e 100644 --- a/net/ipv4/ipvs/ip_vs_sched.c +++ b/net/ipv4/ipvs/ip_vs_sched.c @@ -184,7 +184,7 @@ int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler) write_lock_bh(&__ip_vs_sched_lock); - if (scheduler->n_list.next != &scheduler->n_list) { + if (!list_empty(&scheduler->n_list)) { write_unlock_bh(&__ip_vs_sched_lock); ip_vs_use_count_dec(); IP_VS_ERR("register_ip_vs_scheduler(): [%s] scheduler " @@ -229,7 +229,7 @@ int unregister_ip_vs_scheduler(struct ip_vs_scheduler *scheduler) } write_lock_bh(&__ip_vs_sched_lock); - if (scheduler->n_list.next == &scheduler->n_list) { + if (list_empty(&scheduler->n_list)) { write_unlock_bh(&__ip_vs_sched_lock); IP_VS_ERR("unregister_ip_vs_scheduler(): [%s] scheduler " "is not in the list. failed\n", scheduler->name);