From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDBCDC433E0 for ; Mon, 22 Mar 2021 13:18:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B5A8661920 for ; Mon, 22 Mar 2021 13:18:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231528AbhCVNSa (ORCPT ); Mon, 22 Mar 2021 09:18:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:35870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232661AbhCVNOI (ORCPT ); Mon, 22 Mar 2021 09:14:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 62A0B6191F; Mon, 22 Mar 2021 13:14:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616418846; bh=tpP9vsOaJw+QQHNQx5DUZ9aUL871dDJBEd8x4XcJrTI=; h=From:To:Cc:Subject:Date:From; b=HowRztNRgSQuCrPUg99BUpd4uX4eagbj9tuR3xBXvYkyv8S0ZTgKGWtVH7VXr92Gu ozv+lelLSxKiCkPBKcvqNVAIGSi/qeAeeE7xInCJYFZftXI8YM5bL6TO/jkjGcyjvq U40F0grOq+Xe1Fc1xUW97oLBZdkYq1wixSTxpubRzmmCZxStdU1DViQYfQQYoEpw22 qa1ctvEMiqwyzPnQEpicbvzsiKCbvTdIdcGPmTthVFdp64EEAnCauKfpAbpM6gyCun uLBj8zxQMzfxOj0Majg0yf/J/RJyqNrqktOP1a5ZnNzrTPh+8ZyvoBrmRSeztGmwzl Q/fqZF4reNUeg== From: Arnd Bergmann To: Alexander Viro Cc: Arnd Bergmann , Christian Brauner , James Morris , Serge Hallyn , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [v2] posix-acl: avoid -Wempty-body warning Date: Mon, 22 Mar 2021 14:13:59 +0100 Message-Id: <20210322131402.3117465-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann The fallthrough comment for an ignored cmpxchg() return value produces a harmless warning with 'make W=1': fs/posix_acl.c: In function 'get_acl': fs/posix_acl.c:127:36: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 127 | /* fall through */ ; | ^ Simplify it as a step towards a clean W=1 build. As all architectures define cmpxchg() as a statement expression these days, it is no longer necessary to evaluate its return code, and the if() can just be droped. Signed-off-by: Arnd Bergmann --- fs/posix_acl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/posix_acl.c b/fs/posix_acl.c index f3309a7edb49..7f939f6add7d 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c @@ -123,8 +123,7 @@ struct posix_acl *get_acl(struct inode *inode, int type) * to just call ->get_acl to fetch the ACL ourself. (This is going to * be an unlikely race.) */ - if (cmpxchg(p, ACL_NOT_CACHED, sentinel) != ACL_NOT_CACHED) - /* fall through */ ; + cmpxchg(p, ACL_NOT_CACHED, sentinel); /* * Normally, the ACL returned by ->get_acl will be cached. -- 2.29.2