From patchwork Fri Feb 22 06:29:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10825275 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 46F35922 for ; Fri, 22 Feb 2019 06:29:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B76F31283 for ; Fri, 22 Feb 2019 06:29:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C63631286; Fri, 22 Feb 2019 06:29:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 094C131283 for ; Fri, 22 Feb 2019 06:29:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725882AbfBVG30 (ORCPT ); Fri, 22 Feb 2019 01:29:26 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:49336 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbfBVG30 (ORCPT ); Fri, 22 Feb 2019 01:29:26 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x1M6O8qL158976; Fri, 22 Feb 2019 06:29:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=Bw+DmGfv3Im5Fk+cZOAVovaCXMFd8bhyjSMchcwRYhM=; b=K63tUPd7mEKxMZtp88j4arS42G5CQOblBCDQhhGYKMQnwuRah5DBQGZJ+h8gKq64yLNj cHYHzv8XPJk+8NW/Ti/dZEZ+ies1s1ALQVpxuwUkEB/DyP3AsgxmDmzDKLsrvtJKc0Ym AgfT5LfM8Svo+A4SKxn3Ts9iPcNkqimJSuIgM7kn0onXLr9IBnvX/i9K+qxXvxdy7Ijp nLBegCkAGbPNozasxRUkprSKlNLsoK/Pw/NYZppWxNrPqczVerUfSr+LG8IQbOdE/mgx 6s946n10PKktlp5s8bccOWxyYscUJ5RFd3O0/GhSCNE5tLjqBss6I60U87XKwkg/2v5p 7w== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2qpb5rvchd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Feb 2019 06:29:17 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x1M6TBJ4029757 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Feb 2019 06:29:12 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x1M6TBQS005420; Fri, 22 Feb 2019 06:29:11 GMT Received: from kadam (/197.157.0.19) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 21 Feb 2019 22:29:10 -0800 Date: Fri, 22 Feb 2019 09:29:02 +0300 From: Dan Carpenter To: Doug Ledford , Steve Wise Cc: Jason Gunthorpe , Leon Romanovsky , Parav Pandit , linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] RDMA/core: Fix a WARN() message Message-ID: <20190222062902.GB30993@kadam> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9174 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902220043 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Majd Dibbiny Reviewed-by: Steve Wise --- drivers/infiniband/core/nldev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c index 5e94dc87f04f..660a192a44a3 100644 --- a/drivers/infiniband/core/nldev.c +++ b/drivers/infiniband/core/nldev.c @@ -1223,7 +1223,7 @@ 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); + WARN_ONCE(1, "Duplicate rdma_link_ops! %s\n", ops->type); goto out; } list_add(&ops->list, &link_ops);