Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10709570ybi; Thu, 11 Jul 2019 09:42:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFrUMrvzjrTtTf7bthUb2ipzJfvhNzcc4WvRbTrLGypzCwKwMmLFe0CfcFzMP0JJ8fAy8+ X-Received: by 2002:a17:902:4201:: with SMTP id g1mr5706409pld.300.1562863329398; Thu, 11 Jul 2019 09:42:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562863329; cv=none; d=google.com; s=arc-20160816; b=YbuE1ovpOlMfLCzRskNYWVMQFniaMalf5vjFScBwlfay2ApA2ReceAy93NePqTEXN6 OjGYaTt+m94GZ5HqUfh99CIA0zUAz0biXqCqGZN8n8sKXvrw327wfXmWYQY5hUSaWcyf GVSsC4EIhYP+LEtY4bIqNHdolC/8Mgjp+hqxP0kPEwLwT287WWgl4RMvX2nZ2GRjIWRj N6oAE3QqBj1/68V8MWzdFQuSn2/+dN00QSZmuBnuHnD1H9IM2kKUfORaY2UihyBcAtLq Rl+m6jfTZfzJT2jnv17mFIOv6qVE1S4KLQCYTjE7fuv01vikiHInywh4ix4sFOadJc8x K0mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date; bh=EHRXotn+ullBohZfFMiM8r6SOFeCxntUKF4maq3esRY=; b=aQIzgvfso6CU0MtlgxWE5JLj6YdRL8+hI6kOUxaORcKUc3RqVRSzAtk+kNhIw8rsM4 CKBXmIR0lP3BJ4wLeC98zyI4jl1K7z2ytiu+V3avjOLRvPJ5ryVGkeNRia6ZwBV6MCfN xxDTe4WpixlJOJPdHtyk6+S2n1E33eWCrWa5L8gJejfFx4OkHrMYmvtieSCjQbJesB7C VYQivouBbtoppTdQMjPwsWHbVZg7QG/l4guHX2GURp7N7Pslp9rSQO/su/1PRnIKj29g t85ljuWutGlGHIkBBnyA2ovi0Wyh1uONw8YIsNA0B8omcuOepUQamRud2hn/fqYgxZI0 2s3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h25si5771645pfn.56.2019.07.11.09.41.52; Thu, 11 Jul 2019 09:42:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728767AbfGKQcZ (ORCPT + 99 others); Thu, 11 Jul 2019 12:32:25 -0400 Received: from gateway30.websitewelcome.com ([192.185.147.85]:11584 "EHLO gateway30.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726213AbfGKQcZ (ORCPT ); Thu, 11 Jul 2019 12:32:25 -0400 X-Greylist: delayed 1203 seconds by postgrey-1.27 at vger.kernel.org; Thu, 11 Jul 2019 12:32:24 EDT Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 432E73CD3 for ; Thu, 11 Jul 2019 11:12:20 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id lbgChSOxd4FKplbgChfbxu; Thu, 11 Jul 2019 11:12:20 -0500 X-Authority-Reason: nr=8 Received: from cablelink-187-160-61-213.pcs.intercable.net ([187.160.61.213]:11787 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.92) (envelope-from ) id 1hlbgB-002TCu-9Q; Thu, 11 Jul 2019 11:12:19 -0500 Date: Thu, 11 Jul 2019 11:12:18 -0500 From: "Gustavo A. R. Silva" To: Bernard Metzler , Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] RDMA/siw: Mark expected switch fall-throughs Message-ID: <20190711161218.GA4989@embeddedor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.9.4 (2018-02-28) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 187.160.61.213 X-Source-L: No X-Exim-ID: 1hlbgB-002TCu-9Q X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cablelink-187-160-61-213.pcs.intercable.net (embeddedor) [187.160.61.213]:11787 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 5 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warnings: drivers/infiniband/sw/siw/siw_qp_rx.c: In function ‘siw_rdmap_complete’: drivers/infiniband/sw/siw/siw_qp_rx.c:1214:18: warning: this statement may fall through [-Wimplicit-fallthrough=] wqe->rqe.flags |= SIW_WQE_SOLICITED; ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ drivers/infiniband/sw/siw/siw_qp_rx.c:1215:2: note: here case RDMAP_SEND: ^~~~ drivers/infiniband/sw/siw/siw_qp_tx.c: In function ‘siw_qp_sq_process’: drivers/infiniband/sw/siw/siw_qp_tx.c:1044:4: warning: this statement may fall through [-Wimplicit-fallthrough=] siw_wqe_put_mem(wqe, tx_type); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/sw/siw/siw_qp_tx.c:1045:3: note: here case SIW_OP_INVAL_STAG: ^~~~ drivers/infiniband/sw/siw/siw_qp_tx.c:1128:4: warning: this statement may fall through [-Wimplicit-fallthrough=] siw_wqe_put_mem(wqe, tx_type); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/sw/siw/siw_qp_tx.c:1129:3: note: here case SIW_OP_INVAL_STAG: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva --- NOTE: -Wimplicit-fallthrough will be enabled globally in v5.3. So, I suggest you to take this patch for 5.3-rc1. drivers/infiniband/sw/siw/siw_qp_rx.c | 2 ++ drivers/infiniband/sw/siw/siw_qp_tx.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/drivers/infiniband/sw/siw/siw_qp_rx.c b/drivers/infiniband/sw/siw/siw_qp_rx.c index 682a290bc11e..f87657a11657 100644 --- a/drivers/infiniband/sw/siw/siw_qp_rx.c +++ b/drivers/infiniband/sw/siw/siw_qp_rx.c @@ -1212,6 +1212,8 @@ static int siw_rdmap_complete(struct siw_qp *qp, int error) case RDMAP_SEND_SE: case RDMAP_SEND_SE_INVAL: wqe->rqe.flags |= SIW_WQE_SOLICITED; + /* Fall through */ + case RDMAP_SEND: case RDMAP_SEND_INVAL: if (wqe->wr_status == SIW_WR_IDLE) diff --git a/drivers/infiniband/sw/siw/siw_qp_tx.c b/drivers/infiniband/sw/siw/siw_qp_tx.c index f0d949e2e318..43020d2040fc 100644 --- a/drivers/infiniband/sw/siw/siw_qp_tx.c +++ b/drivers/infiniband/sw/siw/siw_qp_tx.c @@ -1042,6 +1042,8 @@ int siw_qp_sq_process(struct siw_qp *qp) case SIW_OP_SEND_REMOTE_INV: case SIW_OP_WRITE: siw_wqe_put_mem(wqe, tx_type); + /* Fall through */ + case SIW_OP_INVAL_STAG: case SIW_OP_REG_MR: if (tx_flags(wqe) & SIW_WQE_SIGNALLED) @@ -1126,6 +1128,8 @@ int siw_qp_sq_process(struct siw_qp *qp) case SIW_OP_READ: case SIW_OP_READ_LOCAL_INV: siw_wqe_put_mem(wqe, tx_type); + /* Fall through */ + case SIW_OP_INVAL_STAG: case SIW_OP_REG_MR: siw_sqe_complete(qp, &wqe->sqe, wqe->bytes, -- 2.21.0