RDMA/hns: Add hr_reg_write_bool()
authorLang Cheng <chenglang@huawei.com>
Mon, 21 Jun 2021 08:00:37 +0000 (16:00 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 21 Jun 2021 18:03:41 +0000 (15:03 -0300)
commita762fe656b1d59a3d597c0556aa6c029c569364a
treed3407239b44dd9f85d31a78f6b6ad75fd8e8cf81
parentfe331da0f210c60342b042a03fe53f1b564b412b
RDMA/hns: Add hr_reg_write_bool()

In order to avoid to do bitwise operations on a boolean value, add a new
register interface to avoid sparse comlaint about "dubious: x & !y" when
calling hr_reg_write(ctx, field, !!val).

Fixes: dc504774408b ("RDMA/hns: Use new interface to set MPT related fields")
Fixes: 495c24808ce7 ("RDMA/hns: Add XRC subtype in QPC and XRC type in SRQC")
Link: https://lore.kernel.org/r/1624262443-24528-4-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/hns/hns_roce_common.h
drivers/infiniband/hw/hns/hns_roce_hw_v2.c