]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
IB/mlx4: Change flush logic so it adheres to the variable name
authorHåkon Bugge <haakon.bugge@oracle.com>
Fri, 28 Apr 2017 11:06:53 +0000 (13:06 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 10 Jun 2017 00:11:57 +0000 (17:11 -0700)
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 <haakon.bugge@oracle.com>
Suggested-by: Wengang Wang <wen.gang.wang@oracle.com>
Reviewed-by: Wengang Wang <wen.gang.wang@oracle.com>
Reviewed-by: Knut Omang <knut.omang@oracle.com>
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
(cherry picked from commit 898782883501798284a10d1467b11dd2a48270cf)

Orabug: 26187991

Reviewed-by: Wei Lin Guay <wei.lin.guay@oracle.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
drivers/infiniband/hw/mlx4/cm.c

index 305b0c643231ace5022a031a5d96943f7cdb507b..a21b5ddcbaf6eb8d46d7159d66eee02c89cac47d 100644 (file)
@@ -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*/