Commit 66a0be47 authored by Sven Wegener's avatar Sven Wegener

ipvs: Use list_empty() instead of open-coding the same functionality

Signed-off-by: default avatarSven Wegener <sven.wegener@stealer.net>
Acked-by: default avatarSimon Horman <horms@verge.net.au>
parent afdd6140
...@@ -184,7 +184,7 @@ int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler) ...@@ -184,7 +184,7 @@ int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler)
write_lock_bh(&__ip_vs_sched_lock); 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); write_unlock_bh(&__ip_vs_sched_lock);
ip_vs_use_count_dec(); ip_vs_use_count_dec();
IP_VS_ERR("register_ip_vs_scheduler(): [%s] scheduler " IP_VS_ERR("register_ip_vs_scheduler(): [%s] scheduler "
...@@ -229,7 +229,7 @@ int unregister_ip_vs_scheduler(struct ip_vs_scheduler *scheduler) ...@@ -229,7 +229,7 @@ int unregister_ip_vs_scheduler(struct ip_vs_scheduler *scheduler)
} }
write_lock_bh(&__ip_vs_sched_lock); 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); write_unlock_bh(&__ip_vs_sched_lock);
IP_VS_ERR("unregister_ip_vs_scheduler(): [%s] scheduler " IP_VS_ERR("unregister_ip_vs_scheduler(): [%s] scheduler "
"is not in the list. failed\n", scheduler->name); "is not in the list. failed\n", scheduler->name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment