Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp176689pxv; Wed, 30 Jun 2021 18:03:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyj/+eHhpYoDUYb43o4OG8VO+ppPN0HAtvzPqUTMXs4DAnBtOOAY/S/my7PV3OClA3+k7g2 X-Received: by 2002:a92:6902:: with SMTP id e2mr20067611ilc.275.1625101410084; Wed, 30 Jun 2021 18:03:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625101410; cv=none; d=google.com; s=arc-20160816; b=HGby8tah+uRp4nXy0gyihTJ4qJl5sXnJ9lE4sG9wc2xsycpVIu2bo5mxvuD8DPypXp bB+Ec8M5lj8Yn7on5GMABjLNIqd9tq/ccl9WaNI4VofKLGIszuvy945K4kwaMdZ5VNFg uNAhuItymW8ReTCMMoWzYflqfHsqcI0L0miL7Tl+prHA7g8fY0SfD5iTwZeGf/Dk2iaS uf6WQfJRo/fHe3nawnmYv63Eq4SV4eGrWAwmgn5GYM89XpmxZC2ZynqirG3FMq/QwSUd T9MNDuuufeVXTFY7bEx/aiTnqKWEhpH0bS0E1BWOTXSKlkA3/ylKKuNxJQ7O5m1Uebg9 +3TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=iRkMybP+fPidUCLJxuaZJzZKWxxEsRDmdNyd6WDjTCQ=; b=j0vZfKXJQG1+ETMEqvyU9q/am86x4qsoTajzpoQh9ROyanCRtY6JFlqVe3UYbfiYt4 VjGwCi14ti6CWch64DAsn3nrubFMp/UKIIfjzTHmKqZ34UITeqtNuKjY2WqiPaLsiZp/ yw5ZWYhel+QE0h6MWdPjTf8au6fpJh/D/8yFoFVktv62NfbjLB2duJzrkJ4HPULy4DJf xxZ4CHxj4OLtSt+tjLNxNej68kn9VIRWD2ATL/q12aQ4F//q8Bf7rve0O9hEovVobxjG UTdr+a1yCUmOoq3aar4FSRt6jvhnghxeEcC/ZIazcLR5zqapj5hAy+GPaDXsS96pHXUo jB1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="AweWU/a2"; 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 c4si24855557ilm.10.2021.06.30.18.03.14; Wed, 30 Jun 2021 18:03:30 -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="AweWU/a2"; 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 S238342AbhGABFM (ORCPT + 99 others); Wed, 30 Jun 2021 21:05:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:59456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238280AbhGABFL (ORCPT ); Wed, 30 Jun 2021 21:05:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 345BF61424; Thu, 1 Jul 2021 01:02:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625101361; bh=Yp8BSeFifNak/V4yD3XLj7SBJV07Sgz+CTLQxoTGev0=; h=Date:From:To:Cc:Subject:From; b=AweWU/a2cdDgsBiGICVvIkPnOXeE/C51P5/trS+ts4+zE5bOXZvBjBIY4NtnmMbwv fk/gmyCP2gHTVrpTlwZW9Jcg3JE8aIgJQCVpn0WVfvSU9MVwc487hDGSw3jwSqhbE1 k5N/VNAo5CLJbI7LOUI8Gcp6xG1RCSXzAEYBFeMoww3l072Oc3aerjwl6quWSLmSgY wvPy+ZOfgsctGBPPVCoYEyifTaU94jqyRq5OsMK/tFdfnjuJ+YRpulxH+Jma7HPdx9 uSkuwLtRSha6Ls5LE+EvHxeJCb1obAqTtqIqTezIJGxPA5Eor0DWS6gB93IwBiZWA9 jkW6ZD6ghQs1w== Date: Wed, 30 Jun 2021 20:04:33 -0500 From: "Gustavo A. R. Silva" To: "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org, Kees Cook Subject: [PATCH] scsi: aic94xx: Fix fall-through warning for Clang Message-ID: <20210701010433.GA57746@embeddedor> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a fallthrough; statement. Notice that this seems to be a Duff device for performance[1]. So, although the code looks a bit _funny_, I didn't want to refactor or modify it beyond merely adding a fallthrough marking, which might be the least disruptive way to fix this issue. [1] https://www.drdobbs.com/a-reusable-duff-device/184406208 Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- JFYI: We had thousands of these sorts of warnings and now we are down to just 7 in linux-next(20210630). This is one of those last remaining warnings. :) drivers/scsi/aic94xx/aic94xx_sds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/aic94xx/aic94xx_sds.c b/drivers/scsi/aic94xx/aic94xx_sds.c index 297a66770260..46815e65f7a4 100644 --- a/drivers/scsi/aic94xx/aic94xx_sds.c +++ b/drivers/scsi/aic94xx/aic94xx_sds.c @@ -718,10 +718,12 @@ static void *asd_find_ll_by_id(void * const start, const u8 id0, const u8 id1) do { switch (id1) { default: - if (el->id1 == id1) + if (el->id1 == id1) { + fallthrough; case 0xFF: if (el->id0 == id0) return el; + } } el = start + le16_to_cpu(el->next); } while (el != start); -- 2.27.0