Skip to content

Commit

Permalink
IB/core: Introduce DECLARE_UVERBS_GLOBAL_METHODS
Browse files Browse the repository at this point in the history
Introduce a new macro to be used for global methods on a singleton
object.

This macros sets internally the type_attrs to be NULL as such an object
can't be created.

Downstream patches from this series will use this macro.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Yishai Hadas authored and Jason Gunthorpe committed Jun 19, 2018
1 parent 19b9def commit e502a86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions include/rdma/uverbs_named_ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#define _UVERBS_NAME(x, y) _UVERBS_PASTE(x, y)
#define UVERBS_METHOD(id) _UVERBS_NAME(UVERBS_MODULE_NAME, _method_##id)
#define UVERBS_HANDLER(id) _UVERBS_NAME(UVERBS_MODULE_NAME, _handler_##id)
#define UVERBS_OBJECT(id) _UVERBS_NAME(UVERBS_MOUDLE_NAME, _object_##id)

#define DECLARE_UVERBS_NAMED_METHOD(id, ...) \
DECLARE_UVERBS_METHOD(UVERBS_METHOD(id), id, UVERBS_HANDLER(id), ##__VA_ARGS__)
Expand All @@ -56,6 +57,9 @@
#define DECLARE_UVERBS_NAMED_OBJECT(id, ...) \
DECLARE_UVERBS_OBJECT(UVERBS_OBJECT(id), id, ##__VA_ARGS__)

#define DECLARE_UVERBS_GLOBAL_METHODS(_name, ...) \
DECLARE_UVERBS_NAMED_OBJECT(_name, NULL, ##__VA_ARGS__)

#define _UVERBS_COMP_NAME(x, y, z) _UVERBS_NAME(_UVERBS_NAME(x, y), z)

#define UVERBS_NO_OVERRIDE NULL
Expand Down
2 changes: 0 additions & 2 deletions include/rdma/uverbs_std_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
#include <rdma/uverbs_ioctl.h>
#include <rdma/ib_user_ioctl_verbs.h>

#define UVERBS_OBJECT(id) uverbs_object_##id

#if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)
const struct uverbs_object_tree_def *uverbs_default_get_objects(void);
#else
Expand Down

0 comments on commit e502a86

Please sign in to comment.