ipvs: Use list_empty() instead of open-coding the same functionality
authorSven Wegener <sven.wegener@stealer.net>
Sun, 10 Aug 2008 09:18:02 +0000 (09:18 +0000)
committerSven Wegener <sven.wegener@stealer.net>
Mon, 11 Aug 2008 09:45:57 +0000 (11:45 +0200)
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Acked-by: Simon Horman <horms@verge.net.au>
net/ipv4/ipvs/ip_vs_sched.c

index b64767309855f2a2efe54859ceb30d978d34ff86..a46ad9e350162b6faa59dcf0856de2a6f1313b20 100644 (file)
@@ -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);