From patchwork Mon Feb 12 11:26:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 199672 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2375948dyd; Mon, 12 Feb 2024 03:52:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IG299vlXLUNqwlVBMLJowrFmnLY2IffRH2UutEj+ckArXWlQlxh6Wvn0faHxJ/IZNU4gqu6 X-Received: by 2002:a05:6a21:3996:b0:19e:c3a1:238d with SMTP id ad22-20020a056a21399600b0019ec3a1238dmr5201105pzc.52.1707738723966; Mon, 12 Feb 2024 03:52:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707738723; cv=pass; d=google.com; s=arc-20160816; b=ikzAZ3NkThlOy3JCGBhcnum7lg05X+zEn5+pgip9Y1MQ8PlCfu+0dNwiFXMLOvd9Wa VlR9s55A6eCZX8GGKn+KArfLAsSpNxOzoyCgQXIU3EXjnY/9PRDWC1KoBieQbdovs+C8 r2cGTNfmjqOaDg9BcRwygrUNKW1tgIuvA2CQG20SqkZL6Lx04oJM9e3O7OejjAyo/2XD xK80stByk4ocegjZfw7ujVbbAM/A1DwVl1voz9er87lOIj/0BWHkYVLxEkNOKUvC4obQ r+lftDmsDEuEOeortGzzCQuljl4k8YvNItcDDIpugJRFmK0UnJ0ISzPJ6jOKKcv4X38I bJpg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=pYv2ZqzhnGNqxHImmQ0qxj2JzMohrxWjOtMkoPV71Sw=; fh=DtVCTSzFYG0EZNUHlz6g/VDiF5xrZrr9dSG48WyXVPA=; b=S/U6T7w5JmE6qzGn7hyGQrntEe3qXwNvflYW+Pj7QCZzE9MEm5ZeI3XiiDNUTPKWPr 6H4dADJvjY0elmK1BwQkM5QMvc0V6Unw9As2DxO3Nk1xmWHNkiY4NlN88zeVX+mraHho 9cRhHTEPQ1axUqteSMPXcRv7GK77Qmx/sEtuPtjpfGPI9UjZ+g2U4rDaD/1v955/7oa+ iCYFZ4Tf9Pt+R1zPln3L6zFt+IKGZylWzdoqc81hOaPTlaepixfWXHOmziHltBnCGeSC 4U6ONENUMYBJNG0PbBj37cljzkaY8SRct2I+HGkfu7s7KIt3E/S46T2IiRxS434ZUty7 2pxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mUw6YATQ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-61425-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61425-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCU3sZopSVAX5aA+h72OpqXNY90+/AXOLsu+xpoXkXXg3ozdnm1FEJ3HbXJzTKvrmystJDo8VHvUFiNxK59ho8iu/p6+Sw== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e14-20020a65678e000000b005dc352a5637si126884pgr.323.2024.02.12.03.52.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 03:52:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61425-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mUw6YATQ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-61425-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61425-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 9F5B0B27207 for ; Mon, 12 Feb 2024 11:26:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0744039AC9; Mon, 12 Feb 2024 11:26:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mUw6YATQ" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60F5139843 for ; Mon, 12 Feb 2024 11:26:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707737186; cv=none; b=F9TMkPvJVqkfQIaToSnrNVMFNJnctojZyYjsEFV4LsUjjfxxcddOu5EGjxxoesO5SGOJD31Sik8NMx7NILxDZxjxBE4i+b8wwosNH0F3m3l4nrvh5KsavgEUD7dp5BCI8SOx3eBjfNBCHH7BgzRifKXxr21R4rLHncCp+2AYGqo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707737186; c=relaxed/simple; bh=kQ/S3yu+q6V9l0izkm6EyVa7NqjSw7TIbz/RHpeNZGQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=ZejiGBuxt8E5VlRRuemjFBSQ/aLOoiGhjFVbd99ipi4L1gH7qcRWDmBjAs/uKKsRbFfufPL75xND6t+1j+HPDLtMbhUt9WeKXVdHjK9i0z8peIZyyoCyi+QO5I+AEhaK8rdkEjVE6B5t2B3Hot0CYAYfSz3GzwbRTiMqix976Ak= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mUw6YATQ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DC46C433F1; Mon, 12 Feb 2024 11:26:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707737186; bh=kQ/S3yu+q6V9l0izkm6EyVa7NqjSw7TIbz/RHpeNZGQ=; h=From:To:Cc:Subject:Date:From; b=mUw6YATQ8JVpYKdj2Lw3pu47bZv2hsO0fbcavt4UmDk8fbiUf2lPstw2uC2/g377D fYIZ5fPNWQdmxs7ZMxqgjgGawEPUpRUQPDXKvGl1lbu6MRRiyQ8EXLUFjMG2GySi1v gYlSSofEBkzYsHhsF6xbL4DwplxkVTpEb/8NHMgLUb0az88Ok064+CTWW/EUDhwNmv zOKHhn04toeNuWxoQgMFe9or1xx2Q/Nfw7y7Y/jKD5bN2YmHuvt0VyN5BfbWnE4uUm UJNFR1alaa0FkMGseyCWIJUHx3xwB932WbEdDfjil5+9Pcd5ut063YZr+HhNEBhRdk ZwSCc9nLlKJIQ== From: Arnd Bergmann To: NeilBrown , Christian Brauner , Jeff Layton Cc: Arnd Bergmann , Luca Vizzarro , Tom Talpey , linux-kernel@vger.kernel.org Subject: [PATCH] filelock: ignore 'lock' argument to for_each_file_lock() Date: Mon, 12 Feb 2024 12:26:11 +0100 Message-Id: <20240212112620.1272058-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790693840591151635 X-GMAIL-MSGID: 1790693840591151635 From: Arnd Bergmann When CONFIG_FILE_LOCKING is disabled, ceph causes a warning about a variable that is only used insode of the for_each_file_lock() loop: fs/ceph/locks.c: In function 'ceph_count_locks': fs/ceph/locks.c:380:27: error: unused variable 'lock' [-Werror=unused-variable] 380 | struct file_lock *lock; Rather than working around this in ceph, change the macro definition to still contain a reference to the variable in order to shut up the warning. Fixes: 75cabec0111b ("filelock: add some new helper functions") Signed-off-by: Arnd Bergmann --- include/linux/filelock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/filelock.h b/include/linux/filelock.h index aabd4bdf7eba..69290173280a 100644 --- a/include/linux/filelock.h +++ b/include/linux/filelock.h @@ -283,7 +283,7 @@ static inline void locks_wake_up(struct file_lock *fl) { } -#define for_each_file_lock(_fl, _head) while(false) +#define for_each_file_lock(_fl, _head) while((void)_fl, false) static inline void locks_free_lock_context(struct inode *inode)