Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp118912imu; Wed, 19 Dec 2018 14:51:25 -0800 (PST) X-Google-Smtp-Source: AFSGD/UqzQUDA+1Bkz020BHcVvtLqOtgzZMBxEtFqI4+3kTtvqujD5ufbSdQhh94o5mwvZqVSxxL X-Received: by 2002:a17:902:e290:: with SMTP id cf16mr22560820plb.81.1545259885899; Wed, 19 Dec 2018 14:51:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545259885; cv=none; d=google.com; s=arc-20160816; b=icmxGQ8e9XoL7p4UKtj+D1Gy0bOzhd+lYabHB3Q8BSo0hlvXwVchEEWbY1k1/VhKxp 4FS+WjtKWbHq3UD1pFCS+d+qRucO3N1Cm8ORJAfFY2UX3PzoK4FwEwBosQQnwUi4DcKX uEsjX8rVnyhNUSCBynamB3BsPB1whI346Uf+WbsIR0J/dU2yw/7yZ1lfYwvkIt1q0CDK 228rA10TDdINCSqIpJsfkF4UEllWFhVTFOHW+5KeMxebXAEY18PVheFCOWqkknQZFCBo VELIPfXl4RCwCDzluXWwdzKpBHz8azhbHeuyjIrQSyGWJOz3/ORHeS0Jzyl6emWibywF SfQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=oWFsfrDB2mDDNmF6wIsoHPkxuXpVITvRc8OLUSlxClY=; b=UGGReJGNv533SJ0O2q3JAereRTeSL/OkRWz0jyxaxp/jviaHridRFMNx/I/z24TWVm dO39C5DZWcDPrQeBRItdTi0oqc7+fpH05jLVIMF/AwuJtch8gXrD+jOL0qGKQH6tXA1d ghsc+dDM2GHbQxQIQMo+S546VHilz8YmL+kCysn9M5vqHnnX0Klm2klOo3kSNM2KzxYh ndLPNeVkUYRK2KzK+KuctWyuAGm42RTiBhOXFmU9jUHxVBWHY0QXPzo29ddqcRVhcUFp ZlLXcwg7GBLaxdNSwT4EH7Z85oBFcIPk2URJ3daqBe2SSizh69kdE+B9GuB92ldDJF8p JiFw== 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 o11si17097630pgd.234.2018.12.19.14.51.10; Wed, 19 Dec 2018 14:51:25 -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 S1729258AbeLSWuN (ORCPT + 99 others); Wed, 19 Dec 2018 17:50:13 -0500 Received: from gateway20.websitewelcome.com ([192.185.48.38]:21530 "EHLO gateway20.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728425AbeLSWuK (ORCPT ); Wed, 19 Dec 2018 17:50:10 -0500 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 8E456400C4A50 for ; Wed, 19 Dec 2018 16:26:15 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id ZkIBgcUUaYTGMZkIBgRmQF; Wed, 19 Dec 2018 16:26:15 -0600 X-Authority-Reason: nr=8 Received: from [189.250.106.44] (port=47190 helo=[192.168.1.76]) by gator4166.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1gZkIA-000Cv0-O5; Wed, 19 Dec 2018 16:26:14 -0600 Subject: Re: [PATCH 16/41] scsi: imm: mark expected switch fall-throughs To: linux-kernel@vger.kernel.org Cc: "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org References: <42e3f9f751b662b7f0e4e763aa880bd752511c60.1543374820.git.gustavo@embeddedor.com> From: "Gustavo A. R. Silva" Message-ID: <9f283763-f5e5-3da2-84e4-7e2a3543cb23@embeddedor.com> Date: Wed, 19 Dec 2018 16:26:09 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <42e3f9f751b662b7f0e4e763aa880bd752511c60.1543374820.git.gustavo@embeddedor.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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.106.44 X-Source-L: No X-Exim-ID: 1gZkIA-000Cv0-O5 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.1.76]) [189.250.106.44]:47190 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 1 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 Hi, Friendly ping: Who can ack or review this patch, please? Thanks -- Gustavo On 11/27/18 10:29 PM, Gustavo A. R. Silva wrote: > 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); >