• Leon Romanovsky's avatar
    RDMa/hns: Don't stuck in endless timeout loop · da392921
    Leon Romanovsky authored
    The "end" variable is declared as unsigned and can't be negative, it
    leads to the situation where timeout limit is not honored, so let's
    convert logic to ensure that loop is bounded.
    
    drivers/infiniband/hw/hns/hns_roce_hw_v1.c: In function _hns_roce_v1_clear_hem_:
    drivers/infiniband/hw/hns/hns_roce_hw_v1.c:2471:12: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
     2471 |    if (end < 0) {
          |            ^
    
    Fixes: 669cefb6 ("RDMA/hns: Remove jiffies operation in disable interrupt context")
    Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
    Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
    da392921
hns_roce_hem.h 5.94 KB