Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp29858pxb; Tue, 17 Aug 2021 18:16:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzu6zMG4IPSXfiF2LRsurMC/xt8OTXtJyIPnQJS79wLripND5K+zNSDJERfxZtZHR2xj06h X-Received: by 2002:a05:6402:1908:: with SMTP id e8mr7176304edz.283.1629249407595; Tue, 17 Aug 2021 18:16:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629249407; cv=none; d=google.com; s=arc-20160816; b=JrD2dKXN2a7S+rsi9IkzYnLoWPEtd7FAC/Qet2krlZXcDZQp9xTtAg3M2sscZ5BlmJ aotMnV6orTMdleefCfa/pi3Ccr77LPCd0ArMuEgalnQ5duah+5aR/ZQKnnN778GY7b51 T6guMlgLgFFphKIcJYyAsA+7NQss78yEbWyKrzXFMVSBRYvih0qqWxwxV+tXyrFl7MbY BlsNFXGY/y/BNhzB/L3nU2l/FAN15oXcdmvLUiQ7UFEAdzAcRyiiKob/Jr+yz6wGWU6j kdWPrTf7u0AWFAKQyumY4qcMcFEMw0XH/px1N7DHU51UZhUsO0UBJW2TIVvI7fZekuoX weZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=nxF4uWoqKlS3T+jVQqBlxu0+GEWpiT2RvHNSG5nn5+k=; b=b8myWpXVnsz7oXgs5lthDr1MQ/4aMAlPzJiC4Jg8Kx3fJcMm7fUJvfs7cpxhhrM0VQ dAiNdhWWB5BSbra2eipShinMgtajnAekJMEtb1Zzg9LpLjcG/cmEJkNYo9ZNFnHuJNx8 ECRibbIyq9eRH3AjTqG/+muNobwoCkWe2hA7+lhAX18/XKhNDKS+/m+SdSJv0d/QJy3J v2Aq1u1q3n/ToHdbqTT8XjPH3sy856PtllTkTSbjloWqqkEBpXXBI7/oA4JMt6H9Pfxl lQD/lhTpdrX9RKC7tyMnxIgz33ZEdvbP+HOZ6k26LCSFiuTXqCEqmvhOwyuGlAO6gX34 bHBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J91kq0ua; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nc13si3294642ejc.649.2021.08.17.18.16.23; Tue, 17 Aug 2021 18:16:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J91kq0ua; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236337AbhHRBN0 (ORCPT + 99 others); Tue, 17 Aug 2021 21:13:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:40572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232294AbhHRBNZ (ORCPT ); Tue, 17 Aug 2021 21:13:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0BFEA6101A; Wed, 18 Aug 2021 01:12:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629249171; bh=S8IVosKYq3uGM5PpqT7ajdvdqx5XHpErpy3tG/+l8vQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=J91kq0uaiNCX8Hx1ZJO1LFAEVV7KbzmTaEL+XrAGb3+CnD1BF4Hm2k6iPKCVfKtHH ri9GhE75cTx0d6r4BOB0EQM37kJc/z7nVmLCAz8OBZ2743716+IjJJN4OhiTUMRsF5 Z+rzQyaiQH2PBfC5R3AsLM5iVTBtszj1uHRJunpCp0hKFnggkBul7mOJKnk4A6YWZu 7IXhb0itDe17Lts8QUUu9TY8VA6e06ptyQXTiyiVrJgmTaWHqnJ47vsyYeIyScVCb8 qzjtxz3UOX/zvdNQ4y7CEZeZ6e4ZZP5yNBt8wIujxV8bBN2JN7qYnZ18IINSJvBSvR M0/wAsHWs54CQ== Subject: Re: [PATCH] scsi: st: Add missing break in switch statement in st_ioctl() To: Finn Thain Cc: =?UTF-8?Q?Kai_M=c3=a4kisara?= , "James E.J. Bottomley" , "Martin K. Petersen" , "Gustavo A. R. Silva" , Nick Desaulniers , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com References: <20210817235531.172995-1-nathan@kernel.org> <7843ce6b-92ae-7b6c-1fc-acb0ffe2bbc0@linux-m68k.org> From: Nathan Chancellor Message-ID: Date: Tue, 17 Aug 2021 18:12:49 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <7843ce6b-92ae-7b6c-1fc-acb0ffe2bbc0@linux-m68k.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/17/2021 5:54 PM, Finn Thain wrote: > On Tue, 17 Aug 2021, Nathan Chancellor wrote: > >> Clang + -Wimplicit-fallthrough warns: >> >> drivers/scsi/st.c:3831:2: warning: unannotated fall-through between >> switch labels [-Wimplicit-fallthrough] >> default: >> ^ >> drivers/scsi/st.c:3831:2: note: insert 'break;' to avoid fall-through >> default: >> ^ >> break; >> 1 warning generated. >> >> Clang's -Wimplicit-fallthrough is a little bit more pedantic than GCC's, >> requiring every case block to end in break, return, or fallthrough, >> rather than allowing implicit fallthroughs to cases that just contain >> break or return. Add a break so that there is no more warning, as has >> been done all over the tree already. >> >> Fixes: 2e27f576abc6 ("scsi: scsi_ioctl: Call scsi_cmd_ioctl() from scsi_ioctl()") >> Signed-off-by: Nathan Chancellor >> --- >> drivers/scsi/st.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c >> index 2d1b0594af69..0e36a36ed24d 100644 >> --- a/drivers/scsi/st.c >> +++ b/drivers/scsi/st.c >> @@ -3828,6 +3828,7 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg) >> case CDROM_SEND_PACKET: >> if (!capable(CAP_SYS_RAWIO)) >> return -EPERM; >> + break; >> default: >> break; >> } >> >> base-commit: 58dd8f6e1cf8c47e81fbec9f47099772ab75278b >> > > Well, that sure is ugly. > > Do you think the following change would cause any static checkers to spit > their dummys and throw their toys out of the pram? > > @@ -3828,6 +3828,7 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg) > case CDROM_SEND_PACKET: > if (!capable(CAP_SYS_RAWIO)) > return -EPERM; > + break; > - default: > - break; > } > I cannot speak for other static checkers but clang does not complain in this instance. cmd_in is the switch value, which is unsigned int; as far as I am aware, clang will only complain about a switch not handling all values when switching on an enumerated type. Gustavo, if you are already handling all of the other warnings in -next, do you want to take this one too? Cheers, Nathan