diff options
author | Junxian Huang <huangjunxian6@hisilicon.com> | 2024-09-09 14:53:31 +0800 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2024-09-10 16:42:53 +0300 |
commit | f4ccc0a2a0c5977540f519588636b5bc81aae2db (patch) | |
tree | 9b32fac59fed45dfb9097146a9daf206ca6f58d0 /drivers/infiniband | |
parent | 9cd30319bbd497b9fac13e822f184b84fd50ef88 (diff) | |
download | linux-stable-f4ccc0a2a0c5977540f519588636b5bc81aae2db.tar.gz linux-stable-f4ccc0a2a0c5977540f519588636b5bc81aae2db.tar.bz2 linux-stable-f4ccc0a2a0c5977540f519588636b5bc81aae2db.zip |
RDMA/hns: Fix restricted __le16 degrades to integer issue
Fix sparse warnings: restricted __le16 degrades to integer.
Fixes: 5a87279591a1 ("RDMA/hns: Support hns HW stats")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202409080508.g4mNSLwy-lkp@intel.com/
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://patch.msgid.link/20240909065331.3950268-1-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 349b68d7e7db..24e906b9d3ae 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -1681,8 +1681,8 @@ static int hns_roce_hw_v2_query_counter(struct hns_roce_dev *hr_dev, for (i = 0; i < HNS_ROCE_HW_CNT_TOTAL && i < *num_counters; i++) { bd_idx = i / CNT_PER_DESC; - if (!(desc[bd_idx].flag & HNS_ROCE_CMD_FLAG_NEXT) && - bd_idx != HNS_ROCE_HW_CNT_TOTAL / CNT_PER_DESC) + if (bd_idx != HNS_ROCE_HW_CNT_TOTAL / CNT_PER_DESC && + !(desc[bd_idx].flag & cpu_to_le16(HNS_ROCE_CMD_FLAG_NEXT))) break; cnt_data = (__le64 *)&desc[bd_idx].data[0]; |