OSDN Git Service

RDMA/uverbs: Refactor flags checks and update return value
authorLeon Romanovsky <leonro@mellanox.com>
Wed, 21 Feb 2018 16:12:33 +0000 (18:12 +0200)
committerDoug Ledford <dledford@redhat.com>
Fri, 23 Feb 2018 03:29:11 +0000 (22:29 -0500)
commita6c4a66ae923eb780ef693a6841cbff7a025cbf9
tree0c7b772a111cb0a8aaecdbe40fa260a794bee170
parent08f0e161636d940ff6c8f78863ce62361291e74b
RDMA/uverbs: Refactor flags checks and update return value

Since commit f21519b23c1b ("IB/core: extended command: an
improved infrastructure for uverbs commands"), the uverbs
supports extra flags as an input to the command interface.

However actually, there is only one flag available and used,
so it is better to refactor the code, so the resolution and
report to the users is done as early as possible.

As part of this change, we changed the return value of failure case
from ENOSYS to be EINVAL to be consistent with the rest flags checks.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/uverbs_main.c