Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp7766pxj; Wed, 16 Jun 2021 18:39:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6/QJSScBkOvp+h/5J5plfD+/7wamL2weRZ3AfDiAq7aj79p7ZhsYt2MgfNRmyOg+dHjo0 X-Received: by 2002:a17:906:4c8c:: with SMTP id q12mr2462711eju.254.1623893956316; Wed, 16 Jun 2021 18:39:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623893956; cv=none; d=google.com; s=arc-20160816; b=eup8BrlKg1o5stZ6i0FGGiZviUkoaq+UdS9N5pXZM6f3IlZS38YUMHKjcf/5kYYoEL +vUZOxYXvpajQEFOKo/S1544+LithGSHK62d3sImtkdoRj0MMuIyQyzPH0ApgD6hpnI2 h5nhScqZC1As81VFRgvs6E/1BY20LQ8R76fEMZvlInuxyIizSN6x0PRqdpKLDQshnd9F IoAoDNiteQ2tku4TMEiSrwgHOHp3QgKOIJEBBGRoHiIbLZBeGVFLKz8JWbo+agGuSTmD wDq/TG9ZcZbJ+vQ1q09bu2cej3UkiT4pR/rtkp4LWM+wJF0qjH93nHVmZ/wm+aEPK+2W aqLQ== 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:to:from:date:dkim-signature; bh=adbTynt9stZ12dcn4dVzBn47j0A6FXbeH7XTsmGZvNk=; b=zfxPDMvEZoYDBNZHs95koTC9AHqpPnDF4UwU7zPV+Jgk3tvuodBA/zWSzIsmD3+n8V iaPsGz5br3EJeLWfC/avRLSKtgygXF0kF557/kslM+t6AOU8k6ZfM/pq1x/v4YFo1+C4 9TaydSEi1nZZU4jcCWsJ/2giYgWY3FgrUY5OgeBoxNLpyzWY4f+1uTuQYCZmtbhtWoVX eQo3TFpueJAMYZ03bQICK/MJu/Fg5rv2gsooQWAO9gh+yHUcGyC6BJsj685wP146cSlS L0U0g4cCtV5EJUnHWZFdPkVtZWuYjlw2j5lOr2SymzyKqU+flyJwbbVOx8qN1MWxcvvr 48fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=APAWLFxe; 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 p12si3847935eds.509.2021.06.16.18.38.49; Wed, 16 Jun 2021 18:39:16 -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=APAWLFxe; 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 S232540AbhFPTRw (ORCPT + 99 others); Wed, 16 Jun 2021 15:17:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:49582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232377AbhFPTRw (ORCPT ); Wed, 16 Jun 2021 15:17:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7037761246; Wed, 16 Jun 2021 19:15:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623870945; bh=IvOX7e7xwWw8kATTBWzntUT0pPIkKcE0mRSQyPOrEgY=; h=Date:From:To:Subject:From; b=APAWLFxeH3GdnbqxmxxCxYeTgLmgvr2wh7LkOBMHwGf+RmGW6iQuqgc38qCIgAf+l IjRZxnIXdC5itonxfBhxByV28eur8qASKt9ViSaK2nbjCx2uMlVd/t18JoQEXNhfMn 0oFKlbOr1ad8I/PNKYLN47+tgV9izXlWQmxKrDKv82MDvnO2rJcFhseSRbVl6xh+lp OeKdNeacJZnp1WecXaO5P+I6TtdCMopVK6GqtPfHmkqunImwu1aRjRBxO9V1JtjzGy 4aJ2qkDHkQwRCfYQWMLgtWP8LP9qQ4YEQYS5L8ClYkt1FkTUoTxy/qiNQx290RXBoY +hyJB2nTi8CcQ== Date: Wed, 16 Jun 2021 14:17:14 -0500 From: "Gustavo A. R. Silva" To: linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org Subject: [PATCH][next] xfs: Fix multiple fall-through warnings for Clang Message-ID: <20210616191714.GA104231@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 the following warnings by replacing /* fallthrough */ comments, and its variants, with the new pseudo-keyword macro fallthrough: fs/xfs/libxfs/xfs_attr.c:487:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] fs/xfs/libxfs/xfs_attr.c:500:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] fs/xfs/libxfs/xfs_attr.c:532:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] fs/xfs/libxfs/xfs_attr.c:594:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] fs/xfs/libxfs/xfs_attr.c:607:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] fs/xfs/libxfs/xfs_attr.c:1410:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] fs/xfs/libxfs/xfs_attr.c:1445:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] fs/xfs/libxfs/xfs_attr.c:1473:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] Notice that Clang doesn't recognize /* fallthrough */ comments as implicit fall-through markings, so in order to globally enable -Wimplicit-fallthrough for Clang, these comments need to be replaced with fallthrough; in the whole codebase. Link: https://github.com/KSPP/linux/issues/115 Signed-off-by: Gustavo A. R. Silva --- I'm taking this in my -next[1] branch for v5.14. [1] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=for-next/kspp fs/xfs/libxfs/xfs_attr.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c index 611dc67234a6..7994e80358f7 100644 --- a/fs/xfs/libxfs/xfs_attr.c +++ b/fs/xfs/libxfs/xfs_attr.c @@ -483,7 +483,7 @@ xfs_attr_set_iter( if (error) return error; - /* fallthrough */ + fallthrough; case XFS_DAS_RM_LBLK: /* Set state in case xfs_attr_rmtval_remove returns -EAGAIN */ dac->dela_state = XFS_DAS_RM_LBLK; @@ -496,7 +496,7 @@ xfs_attr_set_iter( return -EAGAIN; } - /* fallthrough */ + fallthrough; case XFS_DAS_RD_LEAF: /* * This is the last step for leaf format. Read the block with @@ -528,7 +528,7 @@ xfs_attr_set_iter( return error; } - /* fallthrough */ + fallthrough; case XFS_DAS_ALLOC_NODE: /* * If there was an out-of-line value, allocate the blocks we @@ -590,7 +590,7 @@ xfs_attr_set_iter( if (error) return error; - /* fallthrough */ + fallthrough; case XFS_DAS_RM_NBLK: /* Set state in case xfs_attr_rmtval_remove returns -EAGAIN */ dac->dela_state = XFS_DAS_RM_NBLK; @@ -603,7 +603,7 @@ xfs_attr_set_iter( return -EAGAIN; } - /* fallthrough */ + fallthrough; case XFS_DAS_CLR_FLAG: /* * The last state for node format. Look up the old attr and @@ -1406,7 +1406,7 @@ xfs_attr_remove_iter( state = dac->da_state; } - /* fallthrough */ + fallthrough; case XFS_DAS_RMTBLK: dac->dela_state = XFS_DAS_RMTBLK; @@ -1441,7 +1441,7 @@ xfs_attr_remove_iter( return -EAGAIN; } - /* fallthrough */ + fallthrough; case XFS_DAS_RM_NAME: /* * If we came here fresh from a transaction roll, reattach all @@ -1469,7 +1469,7 @@ xfs_attr_remove_iter( return -EAGAIN; } - /* fallthrough */ + fallthrough; case XFS_DAS_RM_SHRINK: /* * If the result is small enough, push it all into the inode. -- 2.27.0