From patchwork Thu Mar 21 17:24:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10864137 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 7E90D1823 for ; Thu, 21 Mar 2019 17:24:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 593DC2A252 for ; Thu, 21 Mar 2019 17:24:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D8022A256; Thu, 21 Mar 2019 17:24: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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 BD6082A247 for ; Thu, 21 Mar 2019 17:24:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728480AbfCURY1 (ORCPT ); Thu, 21 Mar 2019 13:24:27 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:38330 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725985AbfCURY1 (ORCPT ); Thu, 21 Mar 2019 13:24:27 -0400 Received: by mail-pf1-f195.google.com with SMTP id 10so4737780pfo.5 for ; Thu, 21 Mar 2019 10:24:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y78fKo222UcUuThLkloCtmOynPtshzSYt5UKAVfU9/E=; b=TYIL2YbfE8VWVPDYi6YStdnECITNVzc+4HkjhUnPAI1vojBjBSTj8IJl7m0iJk/JYB fb2q5HHG7++P8GBq10Ii3TbcNqD529f9On1cflMkgYi74SfC/9kfyrU9fZ3+aBj9NAt7 MKph5dNbGeFmDQmsX4cS7Src/+EfmunJt5Vp9tK4TVhLITTOZPInDFd/wk16ySek3JgA +lPUv6ePgkX8JUYm/Shb2sHj1DHehJirS8jlia4N3IPkGwpg92Sa4KchN6JBsFTJ//mo ruKZfV/L/Nr/Jv5nnsJBRkd6DkqRfV2/s2ENGtOATDzNgcfxoD4G6BGGtH/8t/qbA7L5 x6DA== X-Gm-Message-State: APjAAAUdt+szA8g+dJ2KBV7wa5yQ2RUsqqFPm6s6MZavwOKMlAM4ZBmD +vhe/jbFqvGyxbNcMi3O6cU= X-Google-Smtp-Source: APXvYqwjGqkINB18EDkNPlNHZvhr6lAx541ZCh1ZOgXRTiXZOwjqupgjyEQ/3s4ASIiXqHbcWOdeuQ== X-Received: by 2002:a17:902:8e8b:: with SMTP id bg11mr4520800plb.328.1553189065055; Thu, 21 Mar 2019 10:24:25 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id s184sm7528549pfb.1.2019.03.21.10.24.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 10:24:24 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche Subject: [PATCH 1/8] RDMA/uverbs: Add a __user annotation to a pointer Date: Thu, 21 Mar 2019 10:24:10 -0700 Message-Id: <20190321172417.77869-2-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190321172417.77869-1-bvanassche@acm.org> References: <20190321172417.77869-1-bvanassche@acm.org> MIME-Version: 1.0 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 This patch avoids that sparse and smatch report the following: warning: cast removes address space of expression Fixes: 3a6532c9af1a ("RDMA/uverbs: Use uverbs_attr_bundle to pass udata for write") # v5.0. Signed-off-by: Bart Van Assche Reviewed-by: Leon Romanovsky --- drivers/infiniband/core/uverbs_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index 70b7d80431a9..b8fc5a329e21 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c @@ -720,7 +720,7 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, * then the command request structure starts * with a '__aligned u64 response' member. */ - ret = get_user(response, (const u64 *)buf); + ret = get_user(response, (const u64 __user *)buf); if (ret) goto out_unlock; From patchwork Thu Mar 21 17:24:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10864139 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 BE17D139A for ; Thu, 21 Mar 2019 17:24:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9977E2A220 for ; Thu, 21 Mar 2019 17:24:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DEBC2A256; Thu, 21 Mar 2019 17:24: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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 34C2B2A220 for ; Thu, 21 Mar 2019 17:24:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725985AbfCURY1 (ORCPT ); Thu, 21 Mar 2019 13:24:27 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:38436 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728404AbfCURY1 (ORCPT ); Thu, 21 Mar 2019 13:24:27 -0400 Received: by mail-pg1-f194.google.com with SMTP id v1so4648736pgi.5 for ; Thu, 21 Mar 2019 10:24:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6PIuzpMC0k5MJqQvWJTPS/TSLTzNkB3QEWVjNlr4c0E=; b=MOWJpIQAal35kCgHHhJRwe2nW52YpHSiT3rkiTPF42nc7SaZNq6KyENkzpLsztlXJF N/QjLvKB3HT07F4BwiBjI1rhtOTNf2IwpxFgHuUc3UluP8qU1r6LYKIoBsPv3kxPiPjC a7OKpuE/cUo8eAaTMugqxTkYsxuZmuPKhznkXneYJRUuB3YwYtehFk6hVq1ei7qa4wYy 0+gJhmUznN/HlPyfrbtdXy6z+pMUGSrXjWOkOUe+ipDnLhDjL005Z3K89XM4fR2rgYSL Tn72azys+g11HJFDYb4ilmVGBzXlNL8lL/Muko4mWMeAQGFK3hie4FFxoep5J2n1Lb2/ 4E3w== X-Gm-Message-State: APjAAAVXlQvlPzY4tEMZKVdC8lDD0QnurXSg7xoK+4WlzHtx6X/kz7HQ t3LUp/6G/Cqed7aa/oEQY3E= X-Google-Smtp-Source: APXvYqwG3DaZEdDiJe8GiVMufvzN7CXtynhXP1JVM3HdEm0IJJ4K1vqT9ilTYSWYsY/lyGKV2LGTXw== X-Received: by 2002:a63:5318:: with SMTP id h24mr4412814pgb.76.1553189066122; Thu, 21 Mar 2019 10:24:26 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id s184sm7528549pfb.1.2019.03.21.10.24.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 10:24:25 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche Subject: [PATCH 2/8] RDMA/uverbs: Annotate uverbs_request_next_ptr() return value as a __user pointer Date: Thu, 21 Mar 2019 10:24:11 -0700 Message-Id: <20190321172417.77869-3-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190321172417.77869-1-bvanassche@acm.org> References: <20190321172417.77869-1-bvanassche@acm.org> MIME-Version: 1.0 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 This patch avoids that sparse complains about a mismatch between the returned value and the function return type. Cc: Leon Romanovsky Cc: Doug Ledford Fixes: c3bea3d2dc53 ("RDMA/uverbs: Use the iterator for ib_uverbs_unmarshall_recv()") # v5.0. Signed-off-by: Bart Van Assche Reviewed-by: Leon Romanovsky --- drivers/infiniband/core/uverbs_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 062a86c04123..c9acd94b049d 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -162,7 +162,7 @@ static const void __user *uverbs_request_next_ptr(struct uverbs_req_iter *iter, const void __user *res = iter->cur; if (iter->cur + len > iter->end) - return ERR_PTR(-ENOSPC); + return (void __force __user *)ERR_PTR(-ENOSPC); iter->cur += len; return res; } From patchwork Thu Mar 21 17:24:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10864141 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 D707314DE for ; Thu, 21 Mar 2019 17:24:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B52A92A1E3 for ; Thu, 21 Mar 2019 17:24:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A959D2A220; Thu, 21 Mar 2019 17:24:29 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 4EC2B2A247 for ; Thu, 21 Mar 2019 17:24:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728355AbfCURY2 (ORCPT ); Thu, 21 Mar 2019 13:24:28 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:44627 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728404AbfCURY2 (ORCPT ); Thu, 21 Mar 2019 13:24:28 -0400 Received: by mail-pg1-f193.google.com with SMTP id i2so4635540pgj.11 for ; Thu, 21 Mar 2019 10:24:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sKscjuXba306J0oFC2cgnW9i1xTE5P6Wn7Ji6L35KLw=; b=Fxc7uAMTw2PIwlTyov7vctbxS8ZVihYvGHwqE59ulo3c/Mu7Ukbfqnn5EGIP+9DPYU uOLW01OGAHPRRpJiYkCL6+5GOylgKL8dGsFb+FoWh6cBYP5hz7c5LV5O2iPDArPoa/AO tGSKFCeUg0wzY+UV5rcgI8RnrOdmlzY/CSUGxOnMmRmMi1mGzQHPVI+5NTkk7RQIxhxM H2PpTDM2DQtIze6DCIuYiIkWLcn4rQa/0qgHBY7GO/vnwy7OAM7dwOLmrMgTXe/tH5Sk SKWfNlBx+yxMIOMgUc86KuhXFh5Kq2KNrhzKN16mj+z/M6b9mn/bPR1mlWB/45+1EE8r Oh4Q== X-Gm-Message-State: APjAAAXeEZMIOKPk5U2LEJnK1I+bVEVgpaQEvLhMs1CVh1Uin3IWi9J7 XqraSiRkI8kYZoUxoVGrfWM= X-Google-Smtp-Source: APXvYqzBIu+nwIzU8PJ9ZrgjlxttOVUyHqAHb8CW6NEWIxjp4iWcHL1sw9VvH1NsLATphop/tbmYOQ== X-Received: by 2002:a17:902:8303:: with SMTP id bd3mr4778195plb.10.1553189067326; Thu, 21 Mar 2019 10:24:27 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id s184sm7528549pfb.1.2019.03.21.10.24.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 10:24:26 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche Subject: [PATCH 3/8] RDMA/uverbs: Allow the compiler to verify declaration and definition consistency Date: Thu, 21 Mar 2019 10:24:12 -0700 Message-Id: <20190321172417.77869-4-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190321172417.77869-1-bvanassche@acm.org> References: <20190321172417.77869-1-bvanassche@acm.org> MIME-Version: 1.0 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 This patch avoids that sparse reports the following warnings: drivers/infiniband/core/uverbs_std_types_flow_action.c:442:30: warning: symbol 'uverbs_def_obj_flow_action' was not declared. Should it be static? drivers/infiniband/core/uverbs_std_types_dm.c:112:30: warning: symbol 'uverbs_def_obj_dm' was not declared. Should it be static? drivers/infiniband/core/uverbs_std_types_counters.c:153:30: warning: symbol 'uverbs_def_obj_counters' was not declared. Should it be static? drivers/infiniband/core/uverbs_std_types_mr.c:213:30: warning: symbol 'uverbs_def_obj_mr' was not declared. Should it be static? Fixes: 0bd01f3d0907 ("RDMA/uverbs: Require all objects to have a driver destroy function") # v5.0. Signed-off-by: Bart Van Assche Reviewed-by: Leon Romanovsky --- drivers/infiniband/core/uverbs_std_types_counters.c | 1 + drivers/infiniband/core/uverbs_std_types_dm.c | 1 + drivers/infiniband/core/uverbs_std_types_flow_action.c | 1 + drivers/infiniband/core/uverbs_std_types_mr.c | 1 + 4 files changed, 4 insertions(+) diff --git a/drivers/infiniband/core/uverbs_std_types_counters.c b/drivers/infiniband/core/uverbs_std_types_counters.c index 309c5e80988d..7880d50165ed 100644 --- a/drivers/infiniband/core/uverbs_std_types_counters.c +++ b/drivers/infiniband/core/uverbs_std_types_counters.c @@ -31,6 +31,7 @@ * SOFTWARE. */ +#include "rdma_core.h" #include "uverbs.h" #include diff --git a/drivers/infiniband/core/uverbs_std_types_dm.c b/drivers/infiniband/core/uverbs_std_types_dm.c index 2ef70637bee1..de3f04a4398c 100644 --- a/drivers/infiniband/core/uverbs_std_types_dm.c +++ b/drivers/infiniband/core/uverbs_std_types_dm.c @@ -30,6 +30,7 @@ * SOFTWARE. */ +#include "rdma_core.h" #include "uverbs.h" #include diff --git a/drivers/infiniband/core/uverbs_std_types_flow_action.c b/drivers/infiniband/core/uverbs_std_types_flow_action.c index 4962b87fa600..3a87b16a93b3 100644 --- a/drivers/infiniband/core/uverbs_std_types_flow_action.c +++ b/drivers/infiniband/core/uverbs_std_types_flow_action.c @@ -30,6 +30,7 @@ * SOFTWARE. */ +#include "rdma_core.h" #include "uverbs.h" #include diff --git a/drivers/infiniband/core/uverbs_std_types_mr.c b/drivers/infiniband/core/uverbs_std_types_mr.c index 4d4be0c2b752..3b4bf6370333 100644 --- a/drivers/infiniband/core/uverbs_std_types_mr.c +++ b/drivers/infiniband/core/uverbs_std_types_mr.c @@ -30,6 +30,7 @@ * SOFTWARE. */ +#include "rdma_core.h" #include "uverbs.h" #include From patchwork Thu Mar 21 17:24:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10864143 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 9279514DE for ; Thu, 21 Mar 2019 17:24:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F3A12A206 for ; Thu, 21 Mar 2019 17:24:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 635252A22F; Thu, 21 Mar 2019 17:24:30 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 14EBB2A220 for ; Thu, 21 Mar 2019 17:24:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728567AbfCURY3 (ORCPT ); Thu, 21 Mar 2019 13:24:29 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:39114 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728404AbfCURY3 (ORCPT ); Thu, 21 Mar 2019 13:24:29 -0400 Received: by mail-pg1-f196.google.com with SMTP id h8so4649797pgp.6 for ; Thu, 21 Mar 2019 10:24:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rbBhvT1OaVzaU8rXl9+tiU1SRunX0MPKY8mqzwPbkxc=; b=ca8y92bs7hLChPDP5MQW2C8WWzUoa+rB7zlO4klwOV3ZtBji9IoQ4eb/l9CO8j4UvK +emKWRkCK8a86kKciiy5J8VCTZGdeDUvgimhGfkz9PsTi3AluG0/evzg24Fbm5JHVxe7 sp8LyTviKvBrYZMSXE2Dzf3CNO6HHLeBBAPCxq7w1kEsQh4b/nnePwNUBR6uGOfI7ia+ 8xQ3CbRCdVHdyoMSHRWDPh0pkEfdlIa6HIi+EHRSbCCph/i5WhGu0Geirh3RgpdBoHXX IeRqmeHDwp01txdtwinPGqspbHrfOnUsiD5xH8QOO7NTDsfubU4b13xgXGRBtNuvizp3 Mucw== X-Gm-Message-State: APjAAAWy1W71NAXR+1XIOVhaQaYzgH8qdX2MyICWuv6hs9VxhwKG79fX PL9cfZjlDdhAfys6bDw3J5g= X-Google-Smtp-Source: APXvYqy7iIwN6Ry1dDtEa04VOFsneN5hQqQLJiud0N5F+L8EbSbHWtrQAJB860iIM7LoGLOcw8Mcgg== X-Received: by 2002:a17:902:b201:: with SMTP id t1mr4743731plr.55.1553189068655; Thu, 21 Mar 2019 10:24:28 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id s184sm7528549pfb.1.2019.03.21.10.24.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 10:24:27 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , Bodong Wang , Mark Bloch , Saeed Mahameed Subject: [PATCH 4/8] IB/mlx5: Only define uplink_rep_profile if CONFIG_MLX5_ESWITCH is enabled Date: Thu, 21 Mar 2019 10:24:13 -0700 Message-Id: <20190321172417.77869-5-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190321172417.77869-1-bvanassche@acm.org> References: <20190321172417.77869-1-bvanassche@acm.org> MIME-Version: 1.0 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 This patch avoids that sparse complains about a missing declaration when building with CONFIG_MLX5_ESWITCH=n. Cc: Bodong Wang Cc: Mark Bloch Cc: Saeed Mahameed Fixes: f0666f1f22b5 ("IB/mlx5: Use unified register/load function for uplink and VF vports") # v5.1-rc1. Signed-off-by: Bart Van Assche --- drivers/infiniband/hw/mlx5/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 994c19d01211..bfecb75059ae 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -6476,6 +6476,7 @@ static const struct mlx5_ib_profile pf_profile = { mlx5_ib_stage_delay_drop_cleanup), }; +#ifdef CONFIG_MLX5_ESWITCH const struct mlx5_ib_profile uplink_rep_profile = { STAGE_CREATE(MLX5_IB_STAGE_INIT, mlx5_ib_stage_init_init, @@ -6520,6 +6521,7 @@ const struct mlx5_ib_profile uplink_rep_profile = { mlx5_ib_stage_post_ib_reg_umr_init, NULL), }; +#endif static void *mlx5_ib_add_slave_port(struct mlx5_core_dev *mdev) { From patchwork Thu Mar 21 17:24:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10864145 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 2DD98139A for ; Thu, 21 Mar 2019 17:24:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B43C2A247 for ; Thu, 21 Mar 2019 17:24:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 000522A250; Thu, 21 Mar 2019 17:24:31 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 8ECB02A252 for ; Thu, 21 Mar 2019 17:24:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728404AbfCURYb (ORCPT ); Thu, 21 Mar 2019 13:24:31 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:45217 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727921AbfCURYa (ORCPT ); Thu, 21 Mar 2019 13:24:30 -0400 Received: by mail-pg1-f196.google.com with SMTP id y3so4633659pgk.12 for ; Thu, 21 Mar 2019 10:24:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4nY4zfVIO3K+CBtBB7w8ykP6Q2znr7YAXHF6u34DmpU=; b=gIs5/ZAlmriUnvqVQh0RmJZ0tHxvEaFryfUuNvEoZ6vuvSpuvg/E55w0xI/BX9jPXB KLWfkgCciDfUYZZiZo9Bu+KfGvkUuK0eDbgYbA8olGn+Z0gU34wgpCKfnDbKhNcub9s4 ZpAshyIfqigJs0Noh1ghfSIsE/FVVaaZhHpjOXfa3wA12uDIWfrI3qKpzTQR8sI3d9VW xkbbq+Dg35J+D8UJYtFVckSVTSIuO9hu1EUoXXy387wvJb8Eg+HGvPHoeNEWiOAmIMhA W5xBDjFIOdlMcV6GTaa5xqT+bWvKccN8S7A7phcD6REh/YwdsRtloZGBQZvcKbreSsEO M1jA== X-Gm-Message-State: APjAAAX/MdaMKOiMXCfYsixhKo+jxUpTG7jNu8pcVxy1nEB9MIXnrvm2 XS9kyLRGZC8bVDbUnu6tWKU= X-Google-Smtp-Source: APXvYqwcqKjmKRX4Q/SykdzwGbLaM0hIKvK1ZiCsZrxADc3yv0sa3pagfARyslmq4pLD1IIjHta/Gg== X-Received: by 2002:a17:902:2a29:: with SMTP id i38mr4820216plb.22.1553189069737; Thu, 21 Mar 2019 10:24:29 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id s184sm7528549pfb.1.2019.03.21.10.24.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 10:24:28 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , Yishai Hadas Subject: [PATCH 5/8] IB/mlx5: Declare devx_async_cmd_event_fops static Date: Thu, 21 Mar 2019 10:24:14 -0700 Message-Id: <20190321172417.77869-6-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190321172417.77869-1-bvanassche@acm.org> References: <20190321172417.77869-1-bvanassche@acm.org> MIME-Version: 1.0 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 Avoid that sparse complains about a missing declaration. Cc: Yishai Hadas Fixes: 6bf8f22aea0d ("IB/mlx5: Introduce MLX5_IB_OBJECT_DEVX_ASYNC_CMD_FD") # v5.1-rc1. Signed-off-by: Bart Van Assche Reviewed-by: Leon Romanovsky --- drivers/infiniband/hw/mlx5/devx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx5/devx.c b/drivers/infiniband/hw/mlx5/devx.c index eaa055007f28..5cdf56838319 100644 --- a/drivers/infiniband/hw/mlx5/devx.c +++ b/drivers/infiniband/hw/mlx5/devx.c @@ -1686,7 +1686,7 @@ static __poll_t devx_async_cmd_event_poll(struct file *filp, return pollflags; } -const struct file_operations devx_async_cmd_event_fops = { +static const struct file_operations devx_async_cmd_event_fops = { .owner = THIS_MODULE, .read = devx_async_cmd_event_read, .poll = devx_async_cmd_event_poll, From patchwork Thu Mar 21 17:24:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10864147 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 18D27139A for ; Thu, 21 Mar 2019 17:24:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E71AA2A247 for ; Thu, 21 Mar 2019 17:24:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DBD782A22F; Thu, 21 Mar 2019 17:24:33 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 781E92A247 for ; Thu, 21 Mar 2019 17:24:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728602AbfCURYc (ORCPT ); Thu, 21 Mar 2019 13:24:32 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:42652 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727921AbfCURYc (ORCPT ); Thu, 21 Mar 2019 13:24:32 -0400 Received: by mail-pg1-f196.google.com with SMTP id p6so4642953pgh.9 for ; Thu, 21 Mar 2019 10:24:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JhLsf1qZnMcnMWuHw9A1+WGbNelzwQjfpik3tJwwQfI=; b=bkDEnS1x7paOmdeKVwJtRAvlc4jl+/YpP+z/KfRNKNfVfVMDTOgV/bLJ7/o31NO18L Kyuk0jVX7OI7m388Wlf/KVJix078hJ6VHdvfTwrIiXlO4nC9sCi2lFXidZI/8fo6plKZ uNXjv2uT8uz4HSJd3Wh36xJh3RbGpX0FPO76AFhuoZvcY1s0xhCBuXwGwuDBzefm5vL7 PzrrSDGbRkp+or6un+ZY8gjvIpVHhnf2s54bmDsGteIHWvcvvQUMKwUFsS6HSCRmZNrt 1p5dxB3z7qPR79AmAJH9ywj6C409KsNNGUtLkY+1AbB1NyvxEwWOLIt1pR2iKI8BknTz GjSA== X-Gm-Message-State: APjAAAWpFQFK1B8qCjAToCMfVEKpQbAGAPMFvUNyzHdbV9AnZYfm2daV +JL5N1Bv1NiWhdiBs6evbbg= X-Google-Smtp-Source: APXvYqzNI1Ovz6SCY0MHXTBIZ03eYoXE6eLdovLQ2uWcQkq/x0OIMPUPiCHG4h0xUXzgyHWxZrji1g== X-Received: by 2002:a17:902:9b98:: with SMTP id y24mr4685157plp.167.1553189071077; Thu, 21 Mar 2019 10:24:31 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id s184sm7528549pfb.1.2019.03.21.10.24.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 10:24:30 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , Mike Marciniszyn , Dennis Dalessandro Subject: [PATCH 6/8] IB/hfi1: Remove set-but-not-used variables Date: Thu, 21 Mar 2019 10:24:15 -0700 Message-Id: <20190321172417.77869-7-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190321172417.77869-1-bvanassche@acm.org> References: <20190321172417.77869-1-bvanassche@acm.org> MIME-Version: 1.0 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 This patch avoids that compiler warnings are reported when building with W=1. Cc: Mike Marciniszyn Cc: Dennis Dalessandro Signed-off-by: Bart Van Assche Reviewed-by: Leon Romanovsky --- drivers/infiniband/hw/hfi1/tid_rdma.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/tid_rdma.c b/drivers/infiniband/hw/hfi1/tid_rdma.c index fdda33aca77f..93f1762a20cd 100644 --- a/drivers/infiniband/hw/hfi1/tid_rdma.c +++ b/drivers/infiniband/hw/hfi1/tid_rdma.c @@ -2019,7 +2019,6 @@ static int tid_rdma_rcv_error(struct hfi1_packet *packet, trace_hfi1_tid_req_rcv_err(qp, 0, e->opcode, e->psn, e->lpsn, req); if (e->opcode == TID_OP(READ_REQ)) { struct ib_reth *reth; - u32 offset; u32 len; u32 rkey; u64 vaddr; @@ -2031,7 +2030,6 @@ static int tid_rdma_rcv_error(struct hfi1_packet *packet, * The requester always restarts from the start of the original * request. */ - offset = delta_psn(psn, e->psn) * qp->pmtu; len = be32_to_cpu(reth->length); if (psn != e->psn || len != req->total_len) goto unlock; @@ -2465,11 +2463,10 @@ void hfi1_rc_rcv_tid_rdma_read_resp(struct hfi1_packet *packet) u32 opcode, aeth; bool is_fecn; unsigned long flags; - u32 kpsn, ipsn; + u32 ipsn; trace_hfi1_sender_rcv_tid_read_resp(qp); is_fecn = process_ecn(qp, packet); - kpsn = mask_psn(be32_to_cpu(ohdr->bth[2])); aeth = be32_to_cpu(ohdr->u.tid_rdma.r_rsp.aeth); opcode = (be32_to_cpu(ohdr->bth[0]) >> 24) & 0xff; @@ -4486,13 +4483,12 @@ void hfi1_rc_rcv_tid_rdma_ack(struct hfi1_packet *packet) struct rvt_swqe *wqe; struct tid_rdma_request *req; struct tid_rdma_flow *flow; - u32 aeth, psn, req_psn, ack_psn, fspsn, resync_psn, ack_kpsn; - bool is_fecn; + u32 aeth, psn, req_psn, ack_psn, resync_psn, ack_kpsn; unsigned long flags; u16 fidx; trace_hfi1_tid_write_sender_rcv_tid_ack(qp, 0); - is_fecn = process_ecn(qp, packet); + process_ecn(qp, packet); psn = mask_psn(be32_to_cpu(ohdr->bth[2])); aeth = be32_to_cpu(ohdr->u.tid_rdma.ack.aeth); req_psn = mask_psn(be32_to_cpu(ohdr->u.tid_rdma.ack.verbs_psn)); @@ -4691,7 +4687,7 @@ void hfi1_rc_rcv_tid_rdma_ack(struct hfi1_packet *packet) IB_AETH_CREDIT_MASK) { case 0: /* PSN sequence error */ flow = &req->flows[req->acked_tail]; - fspsn = full_flow_psn(flow, flow->flow_state.spsn); + full_flow_psn(flow, flow->flow_state.spsn); trace_hfi1_tid_flow_rcv_tid_ack(qp, req->acked_tail, flow); req->r_ack_psn = mask_psn(be32_to_cpu(ohdr->bth[2])); @@ -4846,10 +4842,9 @@ void hfi1_rc_rcv_tid_rdma_resync(struct hfi1_packet *packet) struct tid_rdma_flow *flow; struct tid_flow_state *fs = &qpriv->flow_state; u32 psn, generation, idx, gen_next; - bool is_fecn; unsigned long flags; - is_fecn = process_ecn(qp, packet); + process_ecn(qp, packet); psn = mask_psn(be32_to_cpu(ohdr->bth[2])); generation = mask_psn(psn + 1) >> HFI1_KDETH_BTH_SEQ_SHIFT; From patchwork Thu Mar 21 17:24:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10864149 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 2F67C1823 for ; Thu, 21 Mar 2019 17:24:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C2E82A206 for ; Thu, 21 Mar 2019 17:24:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F41F72A22E; Thu, 21 Mar 2019 17:24:33 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 98AB82A253 for ; Thu, 21 Mar 2019 17:24:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727921AbfCURYd (ORCPT ); Thu, 21 Mar 2019 13:24:33 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:45222 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728445AbfCURYc (ORCPT ); Thu, 21 Mar 2019 13:24:32 -0400 Received: by mail-pg1-f193.google.com with SMTP id y3so4633752pgk.12 for ; Thu, 21 Mar 2019 10:24:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o+rE3CvE6WSbk1gIyjN1BHjU7/y+I6C0I7Q8u0MyAtg=; b=nqirm/txco4hT0C5xWfaqivvNbwMraOraK6dQmn63K0WV7FC1nctU2jlzYhkdvVMvQ uCQWZip2EMFYWlxkHSEri1X8AHOpjFq4IjeC7PhG7pc+dmqCYMKg+hxPpPVCv+drFmF8 KJ6U45wVNCgvO0v7R5Hf8shzYCTxPRpBDDNY4/Mv9prl3By/dImV0X3QkBPt728MCr0m ZwCkFUMTOtbHjQxaf+LAZzFp0LMR+ZeBIPmmyZAayKg71Img0TfmNl7CIqw8B3kAHNGE X7WPqBy33zl3Zqrwe4DfsQ3iIctLP6FTdXUWwRfg1V/0gYa9tTMEZdlUDGpYdx863fOi icdQ== X-Gm-Message-State: APjAAAWdmlX7VP1uZa2JEV8ljNS2tF6uWJQhZnkmUHzuYxi0Vq0MD+fH KSuaEBjxvJF8dVIG4AFi3zg= X-Google-Smtp-Source: APXvYqxAhPSb0pYzKaHRLiWV8NOliMJAX5t7VCJusNZftzh0RXCCTsLaImmwxnc774zkqObIFKFD/A== X-Received: by 2002:a63:4e57:: with SMTP id o23mr4139113pgl.368.1553189072218; Thu, 21 Mar 2019 10:24:32 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id s184sm7528549pfb.1.2019.03.21.10.24.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 10:24:31 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , Mike Marciniszyn , Dennis Dalessandro Subject: [PATCH 7/8] IB/hfi1: Fix two format strings Date: Thu, 21 Mar 2019 10:24:16 -0700 Message-Id: <20190321172417.77869-8-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190321172417.77869-1-bvanassche@acm.org> References: <20190321172417.77869-1-bvanassche@acm.org> MIME-Version: 1.0 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 Enable format string checking for hfi1_cdbg() and fix the resulting compiler warnings. Cc: Mike Marciniszyn Cc: Dennis Dalessandro Signed-off-by: Bart Van Assche --- drivers/infiniband/hw/hfi1/init.c | 4 ++-- drivers/infiniband/hw/hfi1/trace_dbg.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c index faaaac8fbc55..3c339617aa95 100644 --- a/drivers/infiniband/hw/hfi1/init.c +++ b/drivers/infiniband/hw/hfi1/init.c @@ -469,7 +469,7 @@ int hfi1_create_ctxtdata(struct hfi1_pportdata *ppd, int numa, if (rcd->egrbufs.size < hfi1_max_mtu) { rcd->egrbufs.size = __roundup_pow_of_two(hfi1_max_mtu); hfi1_cdbg(PROC, - "ctxt%u: eager bufs size too small. Adjusting to %zu\n", + "ctxt%u: eager bufs size too small. Adjusting to %u\n", rcd->ctxt, rcd->egrbufs.size); } rcd->egrbufs.rcvtid_size = HFI1_MAX_EAGER_BUFFER_SIZE; @@ -2071,7 +2071,7 @@ int hfi1_setup_eagerbufs(struct hfi1_ctxtdata *rcd) rcd->egrbufs.size = alloced_bytes; hfi1_cdbg(PROC, - "ctxt%u: Alloced %u rcv tid entries @ %uKB, total %zuKB\n", + "ctxt%u: Alloced %u rcv tid entries @ %uKB, total %uKB\n", rcd->ctxt, rcd->egrbufs.alloced, rcd->egrbufs.rcvtid_size / 1024, rcd->egrbufs.size / 1024); diff --git a/drivers/infiniband/hw/hfi1/trace_dbg.h b/drivers/infiniband/hw/hfi1/trace_dbg.h index e62171fb7379..de7a87392b8d 100644 --- a/drivers/infiniband/hw/hfi1/trace_dbg.h +++ b/drivers/infiniband/hw/hfi1/trace_dbg.h @@ -86,14 +86,14 @@ DECLARE_EVENT_CLASS(hfi1_trace_template, * actual function to work and can not be in a macro. */ #define __hfi1_trace_def(lvl) \ -void __hfi1_trace_##lvl(const char *funct, char *fmt, ...); \ +void __printf(2, 3) __hfi1_trace_##lvl(const char *funct, char *fmt, ...); \ \ DEFINE_EVENT(hfi1_trace_template, hfi1_ ##lvl, \ TP_PROTO(const char *function, struct va_format *vaf), \ TP_ARGS(function, vaf)) #define __hfi1_trace_fn(lvl) \ -void __hfi1_trace_##lvl(const char *func, char *fmt, ...) \ +void __printf(2, 3) __hfi1_trace_##lvl(const char *func, char *fmt, ...)\ { \ struct va_format vaf = { \ .fmt = fmt, \ From patchwork Thu Mar 21 17:24:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10864151 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 757D3139A for ; Thu, 21 Mar 2019 17:24:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51BEA2A220 for ; Thu, 21 Mar 2019 17:24:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 465AC2A29A; Thu, 21 Mar 2019 17:24:35 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 E882D2A250 for ; Thu, 21 Mar 2019 17:24:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728691AbfCURYe (ORCPT ); Thu, 21 Mar 2019 13:24:34 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:34093 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728445AbfCURYe (ORCPT ); Thu, 21 Mar 2019 13:24:34 -0400 Received: by mail-pf1-f195.google.com with SMTP id v64so4742465pfb.1 for ; Thu, 21 Mar 2019 10:24:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=raHiKfVaBqmQsY8LO+JDE8dcok0Dk3CbCTt91Qi/wdk=; b=RXHAxP1tXj23yjAnDWxkg24klHC7ewDwzkt3Nwz/jUq4W0Frl6Asv7vuDfJRiPnM0C 7BeKnSMApTxOLGS41tBVIoxAFR9PvOcOk3l3OLZzbOcYfWNepqCT62IUqhXUunUF2kxy WrfTr4F66AenuQNFLIb5MwiKWNyrFT1HCW7w+Id0Z1d64fvCbDKpKoV66CjtVsmRUOss TfnF6bV7Pyd5VG/28ys9vRqHI4ft9482amd2KsNN1TPQqiQ0d7UUiEBQ4qZf3lV/JXVw znZblsBXgJFfO0PyDZRybTFpibff/bc2LLimXtDk5QoB/mXuRYuwFJHKPYLbk08ceE3n HELQ== X-Gm-Message-State: APjAAAVC/hSLvl19WKtI+6boOw3Mmw1NEUbcrmr6sx4rOVE/wL74AKB6 ThSI/naJ2YSa4g3PFuPMGH0= X-Google-Smtp-Source: APXvYqxzLwHCLqFhE7p6bQuWpAO/peWca5xiR2g9dDZjMjyQo+JiQey6CHN0jRAKCSTDZisjrgQZHg== X-Received: by 2002:a65:4bce:: with SMTP id p14mr4468289pgr.68.1553189073359; Thu, 21 Mar 2019 10:24:33 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id s184sm7528549pfb.1.2019.03.21.10.24.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 10:24:32 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , CQ Tang , Mike Marciniszyn , Dean Luick , John A Gregor , Mitko Haralanov Subject: [PATCH 8/8] IB/qib: Remove a set-but-not-used variable Date: Thu, 21 Mar 2019 10:24:17 -0700 Message-Id: <20190321172417.77869-9-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190321172417.77869-1-bvanassche@acm.org> References: <20190321172417.77869-1-bvanassche@acm.org> MIME-Version: 1.0 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 This patch avoids that a compiler warning is reported when building with W=1. Cc: CQ Tang CC: Mike Marciniszyn Cc: Dean Luick Cc: John A Gregor Cc: Mitko Haralanov Fixes: 49c0e2414b20 ("IB/qib: Change SDMA progression mode depending on single- or multi-rail") # v3.15 Signed-off-by: Bart Van Assche Reviewed-by: Leon Romanovsky --- drivers/infiniband/hw/qib/qib_user_sdma.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/qib/qib_user_sdma.c b/drivers/infiniband/hw/qib/qib_user_sdma.c index 31c523b2a9f5..ef19d39a44b1 100644 --- a/drivers/infiniband/hw/qib/qib_user_sdma.c +++ b/drivers/infiniband/hw/qib/qib_user_sdma.c @@ -225,8 +225,6 @@ qib_user_sdma_queue_create(struct device *dev, int unit, int ctxt, int sctxt) if (sdma_rb_node) { sdma_rb_node->refcount++; } else { - int ret; - sdma_rb_node = kmalloc(sizeof( struct qib_user_sdma_rb_node), GFP_KERNEL); if (!sdma_rb_node) @@ -235,8 +233,7 @@ qib_user_sdma_queue_create(struct device *dev, int unit, int ctxt, int sctxt) sdma_rb_node->refcount = 1; sdma_rb_node->pid = current->pid; - ret = qib_user_sdma_rb_insert(&qib_user_sdma_rb_root, - sdma_rb_node); + qib_user_sdma_rb_insert(&qib_user_sdma_rb_root, sdma_rb_node); } pq->sdma_rb_node = sdma_rb_node;