提交 89878288 编写于 作者: H Håkon Bugge 提交者: Doug Ledford

IB/mlx4: Change flush logic so it adheres to the variable name

Change and simplify the code to match the variable name. This commit
improves readability but makes no functional change to the code.
Signed-off-by: NHåkon Bugge <haakon.bugge@oracle.com>
Suggested-by: NWengang Wang <wen.gang.wang@oracle.com>
Reviewed-by: NWengang Wang <wen.gang.wang@oracle.com>
Reviewed-by: NKnut Omang <knut.omang@oracle.com>
Acked-by: NLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 0a49f2c3
...@@ -414,7 +414,7 @@ void mlx4_ib_cm_paravirt_clean(struct mlx4_ib_dev *dev, int slave) ...@@ -414,7 +414,7 @@ void mlx4_ib_cm_paravirt_clean(struct mlx4_ib_dev *dev, int slave)
struct rb_root *sl_id_map = &sriov->sl_id_map; struct rb_root *sl_id_map = &sriov->sl_id_map;
struct list_head lh; struct list_head lh;
struct rb_node *nd; struct rb_node *nd;
int need_flush = 1; int need_flush = 0;
struct id_map_entry *map, *tmp_map; struct id_map_entry *map, *tmp_map;
/* cancel all delayed work queue entries */ /* cancel all delayed work queue entries */
INIT_LIST_HEAD(&lh); INIT_LIST_HEAD(&lh);
...@@ -422,13 +422,13 @@ void mlx4_ib_cm_paravirt_clean(struct mlx4_ib_dev *dev, int slave) ...@@ -422,13 +422,13 @@ void mlx4_ib_cm_paravirt_clean(struct mlx4_ib_dev *dev, int slave)
list_for_each_entry_safe(map, tmp_map, &dev->sriov.cm_list, list) { list_for_each_entry_safe(map, tmp_map, &dev->sriov.cm_list, list) {
if (slave < 0 || slave == map->slave_id) { if (slave < 0 || slave == map->slave_id) {
if (map->scheduled_delete) if (map->scheduled_delete)
need_flush &= !!cancel_delayed_work(&map->timeout); need_flush |= !cancel_delayed_work(&map->timeout);
} }
} }
spin_unlock(&sriov->id_map_lock); spin_unlock(&sriov->id_map_lock);
if (!need_flush) if (need_flush)
flush_scheduled_work(); /* make sure all timers were flushed */ flush_scheduled_work(); /* make sure all timers were flushed */
/* now, remove all leftover entries from databases*/ /* now, remove all leftover entries from databases*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册