Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp700399imu; Tue, 27 Nov 2018 20:31:51 -0800 (PST) X-Google-Smtp-Source: AFSGD/WlxR2MGZui910U4l3ATn7BrO2Yv2R6ov2JmCXW9QWWlU2TyZaITyjEYMj40EOTWSHHBAFV X-Received: by 2002:a17:902:9a9:: with SMTP id 38mr34840356pln.204.1543379511732; Tue, 27 Nov 2018 20:31:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543379511; cv=none; d=google.com; s=arc-20160816; b=pQpqjsQvAVOm/5Jnt2zQDEHedMNbjNPfxZbx4TMfc2p3D9hZbbWLdft1MfSC1Ak7ew RVgl/y5iMETPlrNXKTi2b6/SkABteCAa0Qh+bser0t8JhqjYocHwrvbXgepqkY6Y3TH2 jL8X4vNULI+L779bHBXqH1G1dMsebuYFqXPdeO4Niy5e8zZAZBpSOKQM1jq0HKuQ8GNE YzZDSoCANnYESJ/gnfUa4zikRQfzUlbL+v25cKItgGywyl8160spmh6fWCoJqe77IyJt L8PGRJv/+6Y2swfrndbzRoFjoJejx/6lv15voai5wXZZDaO7C0H7z/FCuiIAmcKtrZkM C25w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=8PHI1sKo8cy/XgGubl6TR6hTEOPsVUiuxnpqLyXX4XY=; b=fcEeqeQMLhX1hPgZcwbG4HXj9dWMxjvDK7RgRsB0USk1IkMRbVoMMVgIvktZMgOGa/ G2R4ft4fNeiJ3bKLZWMLCqJZRsk/VKep5OVC38GFpzu5cbUPMuHhkW/KYpzTMJxMe2YT MI8C9TgHxB7IgDEDefGL5aloRN/vOYebg/jWZ7Most9GKrVibeU6FdApoeHvUFpFTD/e YWUTPrP3Vuf9wOfUqfHEZ/CgbU1nfWn0LDXfUiU06BEm21mEY/Zu8Yqc+my1FHV5C15Y DAn26cJuPZ0kekhEnUsEXNccjBSbUe6YszDunWbDej05T4ZMgDW0inrgfOg2uTxzQaR9 A0aQ== 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 d128-v6si6015151pfc.256.2018.11.27.20.31.36; Tue, 27 Nov 2018 20:31:51 -0800 (PST) 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 S1727108AbeK1PaF (ORCPT + 99 others); Wed, 28 Nov 2018 10:30:05 -0500 Received: from gateway23.websitewelcome.com ([192.185.50.141]:13132 "EHLO gateway23.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727008AbeK1PaF (ORCPT ); Wed, 28 Nov 2018 10:30:05 -0500 X-Greylist: delayed 505 seconds by postgrey-1.27 at vger.kernel.org; Wed, 28 Nov 2018 10:30:04 EST Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 5B2836448 for ; Tue, 27 Nov 2018 22:29:51 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id RrTzgJJfA957pRrTzg2dee; Tue, 27 Nov 2018 22:29:51 -0600 X-Authority-Reason: nr=8 Received: from [189.250.78.127] (port=58300 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.91) (envelope-from ) id 1gRrTy-001mKT-MS; Tue, 27 Nov 2018 22:29:50 -0600 Date: Tue, 27 Nov 2018 22:29:48 -0600 From: "Gustavo A. R. Silva" To: linux-kernel@vger.kernel.org Cc: "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH 16/41] scsi: imm: mark expected switch fall-throughs Message-ID: <42e3f9f751b662b7f0e4e763aa880bd752511c60.1543374820.git.gustavo@embeddedor.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 189.250.78.127 X-Source-L: No X-Exim-ID: 1gRrTy-001mKT-MS X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.250.78.127]:58300 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 127 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. Notice that, in this particular case, I placed all the "Phase N - ..." comments on the same line as its corresponding switch case. The same way in which similar comments appear in drivers/scsi/ppa.c. This makes it possible to place the "fall through" annotations at the bottom of each switch case, which is what GCC is expecting to find. Signed-off-by: Gustavo A. R. Silva --- drivers/scsi/imm.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c index 8c6627bc8a39..629e0bc70d3e 100644 --- a/drivers/scsi/imm.c +++ b/drivers/scsi/imm.c @@ -796,21 +796,21 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd) return 0; } return 1; /* wait until imm_wakeup claims parport */ - /* Phase 1 - Connected */ - case 1: + + case 1: /* Phase 1 - Connected */ imm_connect(dev, CONNECT_EPP_MAYBE); cmd->SCp.phase++; + /* fall through */ - /* Phase 2 - We are now talking to the scsi bus */ - case 2: + case 2: /* Phase 2 - We are now talking to the scsi bus */ if (!imm_select(dev, scmd_id(cmd))) { imm_fail(dev, DID_NO_CONNECT); return 0; } cmd->SCp.phase++; + /* fall through */ - /* Phase 3 - Ready to accept a command */ - case 3: + case 3: /* Phase 3 - Ready to accept a command */ w_ctr(ppb, 0x0c); if (!(r_str(ppb) & 0x80)) return 1; @@ -818,9 +818,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd) if (!imm_send_command(cmd)) return 0; cmd->SCp.phase++; + /* fall through */ - /* Phase 4 - Setup scatter/gather buffers */ - case 4: + case 4: /* Phase 4 - Setup scatter/gather buffers */ if (scsi_bufflen(cmd)) { cmd->SCp.buffer = scsi_sglist(cmd); cmd->SCp.this_residual = cmd->SCp.buffer->length; @@ -834,8 +834,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd) cmd->SCp.phase++; if (cmd->SCp.this_residual & 0x01) cmd->SCp.this_residual++; - /* Phase 5 - Pre-Data transfer stage */ - case 5: + /* fall through */ + + case 5: /* Phase 5 - Pre-Data transfer stage */ /* Spin lock for BUSY */ w_ctr(ppb, 0x0c); if (!(r_str(ppb) & 0x80)) @@ -850,9 +851,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd) if (imm_negotiate(dev)) return 0; cmd->SCp.phase++; + /* fall through */ - /* Phase 6 - Data transfer stage */ - case 6: + case 6: /* Phase 6 - Data transfer stage */ /* Spin lock for BUSY */ w_ctr(ppb, 0x0c); if (!(r_str(ppb) & 0x80)) @@ -866,9 +867,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd) return 1; } cmd->SCp.phase++; + /* fall through */ - /* Phase 7 - Post data transfer stage */ - case 7: + case 7: /* Phase 7 - Post data transfer stage */ if ((dev->dp) && (dev->rd)) { if ((dev->mode == IMM_NIBBLE) || (dev->mode == IMM_PS2)) { w_ctr(ppb, 0x4); @@ -878,9 +879,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd) } } cmd->SCp.phase++; + /* fall through */ - /* Phase 8 - Read status/message */ - case 8: + case 8: /* Phase 8 - Read status/message */ /* Check for data overrun */ if (imm_wait(dev) != (unsigned char) 0xb8) { imm_fail(dev, DID_ERROR); -- 2.17.1