From: Håkon Bugge Date: Fri, 28 Apr 2017 11:06:53 +0000 (+0200) Subject: IB/mlx4: Change flush logic so it adheres to the variable name X-Git-Tag: v4.1.12-104.0.20170618_1145~231 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=aa1e245b91643fac742536c3d49df30273473a4f;p=users%2Fjedix%2Flinux-maple.git 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: Håkon Bugge Suggested-by: Wengang Wang Reviewed-by: Wengang Wang Reviewed-by: Knut Omang Acked-by: Leon Romanovsky Signed-off-by: Doug Ledford (cherry picked from commit 898782883501798284a10d1467b11dd2a48270cf) Orabug: 26187991 Reviewed-by: Wei Lin Guay Reviewed-by: Yuval Shaia --- diff --git a/drivers/infiniband/hw/mlx4/cm.c b/drivers/infiniband/hw/mlx4/cm.c index 305b0c643231a..a21b5ddcbaf6e 100644 --- a/drivers/infiniband/hw/mlx4/cm.c +++ b/drivers/infiniband/hw/mlx4/cm.c @@ -416,7 +416,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 list_head lh; struct rb_node *nd; - int need_flush = 1; + int need_flush = 0; struct id_map_entry *map, *tmp_map; /* cancel all delayed work queue entries */ INIT_LIST_HEAD(&lh); @@ -424,13 +424,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) { if (slave < 0 || slave == map->slave_id) { if (map->scheduled_delete) - need_flush &= !!cancel_delayed_work(&map->timeout); + need_flush |= !cancel_delayed_work(&map->timeout); } } spin_unlock(&sriov->id_map_lock); - if (!need_flush) + if (need_flush) flush_scheduled_work(); /* make sure all timers were flushed */ /* now, remove all leftover entries from databases*/