diff options
author | Leon Romanovsky <leonro@mellanox.com> | 2018-01-01 13:07:12 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-01-02 13:36:57 -0700 |
commit | b823369b6faa33cc71b65eef9bebcefe622913dc (patch) | |
tree | a19953c74e8ebeedd60d00cd07f15747628f5b8d /drivers/infiniband/core/netlink.c | |
parent | 9ef77bd76075408be3a0bb769d37f4b67953a098 (diff) | |
download | linux-stable-b823369b6faa33cc71b65eef9bebcefe622913dc.tar.gz linux-stable-b823369b6faa33cc71b65eef9bebcefe622913dc.tar.bz2 linux-stable-b823369b6faa33cc71b65eef9bebcefe622913dc.zip |
RDMA/netlink: Simplify code of autoload modules
The request_module() call is internally wrapped by CONFIG_MODULE,
so there is no need to check it in our RDMA code too.
Refactor to simplify the code.
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/netlink.c')
-rw-r--r-- | drivers/infiniband/core/netlink.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/infiniband/core/netlink.c b/drivers/infiniband/core/netlink.c index 0c7db94cd9b9..3ccaae18ad75 100644 --- a/drivers/infiniband/core/netlink.c +++ b/drivers/infiniband/core/netlink.c @@ -81,15 +81,13 @@ static bool is_nl_valid(unsigned int type, unsigned int op) if (!is_nl_msg_valid(type, op)) return false; - cb_table = rdma_nl_types[type].cb_table; -#ifdef CONFIG_MODULES - if (!cb_table) { + if (!rdma_nl_types[type].cb_table) { mutex_unlock(&rdma_nl_mutex); request_module("rdma-netlink-subsys-%d", type); mutex_lock(&rdma_nl_mutex); - cb_table = rdma_nl_types[type].cb_table; } -#endif + + cb_table = rdma_nl_types[type].cb_table; if (!cb_table || (!cb_table[op].dump && !cb_table[op].doit)) return false; |