aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-02-22 09:29:02 +0300
committerJason Gunthorpe <jgg@mellanox.com>2019-02-22 11:53:37 -0700
commitafc1990e089f501d686bb95b98146fc7ba23347f (patch)
treef2512bbefcd5012fd0ccc7063bdfd3a8ab150195
parentbnxt_re: fix the regression due to changes in alloc_pbl (diff)
downloadlinux-dev-afc1990e089f501d686bb95b98146fc7ba23347f.tar.xz
linux-dev-afc1990e089f501d686bb95b98146fc7ba23347f.zip
RDMA/core: Fix a WARN() message
The first parameter of WARN_ONCE() is a condition, then following parameters are the message. In this case, we left out the condition so it will just print the ops->type string. Fixes: 3856ec4b93c9 ("RDMA/core: Add RDMA_NLDEV_CMD_NEWLINK/DELLINK support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Majd Dibbiny <majd@mellanox.com> Reviewed-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r--drivers/infiniband/core/nldev.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
index 5e94dc87f04f..11ed58d3fce5 100644
--- a/drivers/infiniband/core/nldev.c
+++ b/drivers/infiniband/core/nldev.c
@@ -1222,10 +1222,8 @@ out:
void rdma_link_register(struct rdma_link_ops *ops)
{
down_write(&link_ops_rwsem);
- if (link_ops_get(ops->type)) {
- WARN_ONCE("Duplicate rdma_link_ops! %s\n", ops->type);
+ if (WARN_ON_ONCE(link_ops_get(ops->type)))
goto out;
- }
list_add(&ops->list, &link_ops);
out:
up_write(&link_ops_rwsem);