Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2482679imu; Thu, 10 Jan 2019 15:07:50 -0800 (PST) X-Google-Smtp-Source: ALg8bN7HGNLE1NAObQ5nDgZngaLraTkUCUGhWRjMMb6lzkp4gdaP1Vcy6wgo4kPhYg67JUMRfoTd X-Received: by 2002:a65:49cd:: with SMTP id t13mr11305124pgs.376.1547161669970; Thu, 10 Jan 2019 15:07:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547161669; cv=none; d=google.com; s=arc-20160816; b=Y2VyMoTlfOlgCJh31uOqeVvIEpKKT4tbsPV5+0hxkJJUkUA98+vEjJVJ3RHtvaQrVb bqF2z9eNsUq92yEa6HDrj4KeuTOrZUePOwT3mtvs1n7LeYBi95N1lyJ1EXXtrsI/bV5e I4UnTie4nE/tc++0eQpyyEOXBfKFGZ1A/fay3QGYiohBKybE+UK2ES2QERPtWWsWSI69 q2Vl+8c1XI+mar9CNu/2ZqNco8CHW5HDtYddgi6YomhxTGTZ0qw08ESNgXuZ18TiV14k potc5g/YLeaMrPLY7hKDlc6VsbTC4ahAbbAP9qVp8+arSDY9/eiFH3rvAUUcgum1ezmq 4QQg== 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=3/ZYWHhsEvGKrCYg9Ah3fJBOB48D/PDG6yx4ws8g3Oo=; b=KfJp8B9SARvn7YZmkIwAY/cFPQsHlmr3jOtwzepNnrQUs+sYu/a+q8AmhmM47k6bOW qkkAbgmw6TW/th+5N9qiVpS4dkD5ajmvy3CB6O8bH2s6oBMxH8pNzS3V9axhwjZahfVd jHCJDkslYObIURSoeYnBMmu58P+eOv/jCSc5lFAnTa+Opk1QTemIyzqj/Ii6Ri+KbNFm xDZocuJPSbeneKAr7Q6emers87stA3ZLWEliXn835f9v4upspA+a2HFMvnX512BIBbru Drchyv4exNdqnIpSrGlj9H1uR6q7aBfkpiNbEk7PQe3yGq1XdVzkjqVzFy3Cz32xIhzA f19Q== 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 z61si35123318plb.49.2019.01.10.15.07.34; Thu, 10 Jan 2019 15:07:49 -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 S1729620AbfAJUIg (ORCPT + 99 others); Thu, 10 Jan 2019 15:08:36 -0500 Received: from gateway33.websitewelcome.com ([192.185.146.80]:24093 "EHLO gateway33.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728145AbfAJUIg (ORCPT ); Thu, 10 Jan 2019 15:08:36 -0500 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 6AFFC15ECB5 for ; Thu, 10 Jan 2019 14:07:16 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id hgbkg74AsYTGMhgbkgs6Nu; Thu, 10 Jan 2019 14:07:16 -0600 X-Authority-Reason: nr=8 Received: from [189.250.130.205] (port=41220 helo=[192.168.43.131]) by gator4166.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1ghgbj-002aQ1-QG; Thu, 10 Jan 2019 14:07:16 -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: Date: Thu, 10 Jan 2019 14:07:13 -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.130.205 X-Source-L: No X-Exim-ID: 1ghgbj-002aQ1-QG X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.43.131]) [189.250.130.205]:41220 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 31 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 (second one): Who can ack/review/take this patch, please? Martin: apparently, the only maintainers for this driver are you and James. 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); >