diff options
author | Yixian Liu <liuyixian@huawei.com> | 2019-11-05 19:08:01 +0800 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-11-08 16:37:54 -0400 |
commit | 1ceb0b11a8a2363db3bf44f3e0ae4615134733e9 (patch) | |
tree | e3bf9aac15c8681300dc67b318f2035706b55d6d /drivers/infiniband/hw/hns/hns_roce_alloc.c | |
parent | 301cc7eb2cd9b0292658b9bfd45e5226cd1fef27 (diff) | |
download | linux-1ceb0b11a8a2363db3bf44f3e0ae4615134733e9.tar.gz |
RDMA/hns: Fix non-standard error codes
It is better to return a linux error code than define a private constant.
Link: https://lore.kernel.org/r/1572952082-6681-9-git-send-email-liweihang@hisilicon.com
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Weihang Li <liweihang@hisilicon.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/hns/hns_roce_alloc.c')
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_alloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_alloc.c b/drivers/infiniband/hw/hns/hns_roce_alloc.c index 8c063c598d2a..da574c26e063 100644 --- a/drivers/infiniband/hw/hns/hns_roce_alloc.c +++ b/drivers/infiniband/hw/hns/hns_roce_alloc.c @@ -55,7 +55,7 @@ int hns_roce_bitmap_alloc(struct hns_roce_bitmap *bitmap, unsigned long *obj) bitmap->last = 0; *obj |= bitmap->top; } else { - ret = -1; + ret = -EINVAL; } spin_unlock(&bitmap->lock); @@ -100,7 +100,7 @@ int hns_roce_bitmap_alloc_range(struct hns_roce_bitmap *bitmap, int cnt, } *obj |= bitmap->top; } else { - ret = -1; + ret = -EINVAL; } spin_unlock(&bitmap->lock); |