提交 b5bc5981 编写于 作者: L Leon Romanovsky 提交者: Doug Ledford

RDMA/uverbs: Convert command mask validity check function to be bool

The function validate_command_mask() returns only two results: success
or failure, so convert it to return bool instead of 0 and -1.
Reported-by: NNoa Osherovich <noaos@mellanox.com>
Reviewed-by: NMatan Barak <matanb@mellanox.com>
Reviewed-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 4bb46608
......@@ -635,7 +635,7 @@ struct file *ib_uverbs_alloc_async_event_file(struct ib_uverbs_file *uverbs_file
return filp;
}
static int verify_command_mask(struct ib_device *ib_dev, __u32 command)
static bool verify_command_mask(struct ib_device *ib_dev, __u32 command)
{
u64 mask;
......@@ -645,9 +645,9 @@ static int verify_command_mask(struct ib_device *ib_dev, __u32 command)
mask = ib_dev->uverbs_ex_cmd_mask;
if (mask & ((u64)1 << command))
return 0;
return true;
return -1;
return false;
}
static bool verify_command_idx(u32 command, bool extended)
......@@ -706,7 +706,7 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf,
goto out;
}
if (verify_command_mask(ib_dev, command)) {
if (!verify_command_mask(ib_dev, command)) {
ret = -EOPNOTSUPP;
goto out;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册