Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1123330lqp; Fri, 22 Mar 2024 06:24:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWoNFlsStOQWLCMRxUXNERO3RBiAbyExZfC4x3N/hRymWqX8dDemgMoFoD0auH6A3jeqwP5y2fFFk3Q0CK7LXx02dHlTe44IZ6i3kPo0w== X-Google-Smtp-Source: AGHT+IGkWOtjJrj6OdyeToi63xU98dNdyTJg2Ri6TJvzpJR7BJeUr5MeLhT0M2wmWsgDZO9N7TPU X-Received: by 2002:a05:6a00:1805:b0:6e6:1f10:9ead with SMTP id y5-20020a056a00180500b006e61f109eadmr2944499pfa.27.1711113840966; Fri, 22 Mar 2024 06:24:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711113840; cv=pass; d=google.com; s=arc-20160816; b=VIX7Ymz3jG5rWz1cN9UNzZ5TX6JNH51sWsUnPpPi1cHqAfG0rJaSY6i28XD2t3H1Ou bHn0oMekRGG2BSq+8Ji1c2GQOfhseiDzhOkq7HgQoN7XnDLgFi2sF2YB1wef0UbaL4CX Cdb5YvyItRwiQC+cDllOLz/JfomejVEHdM24PVjWc72mBrKbHbzoTMFpC5iVvyUqQ+NX GoC8yTQiRTAcMtVjZ2bezVNQEAyGs5dA6dCOhpl5r4M8TjqzdXSKIYJS7pHjZjCoEEeE QB3CwVS7SXg8LdG8VH3p5KMQOONNyNcAb4jehoINdVa58slp4VGsetVR0bHV7pr/K1yj 4p4w== 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=arTLWdim9iF6Fdyh6UyJCLqVNX9bw8uSRi0mgkDEdpk=; fh=SAywopiqSen6ngbwxVDMcTzyTKJYdLnS0cHSw7td8gQ=; b=pRZ7n6qGF7ZCHd2POGXER3xa2wtxM3SooPg/z8c+Per+UJVW5Z/zD4HVVCB1MSJPtV EMpdy48naq5KLFCaYK236Of8pAlmBpOKXQnfYEZa2NTcklpznXQ8d7cVnDP9msTrqUe+ gW6481N4eb/J0J8BohvxgrbMlNtBIM4GG7Df8TYO0DVROyMJV9SVmupl1W2r8yXV4C21 iGfSfxBJgsojT5p9mEsD2TwgR8tdeh4C3rEWxmp39gRU/bFKVOzr9JLMEEtjtsIeW/AQ 5VqS4KXhfwXJS6SQliqcPInuAN9RllbO95CX1vZln2wNnMYkP3QeUc3ZW/Du2vfiNLvL JikA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="c6njRtQ/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111474-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111474-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id t2-20020a056a0021c200b006e67509f179si2063833pfj.68.2024.03.22.06.24.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 06:24:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111474-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="c6njRtQ/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111474-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111474-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1384B282959 for ; Fri, 22 Mar 2024 13:23:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B0BE34776A; Fri, 22 Mar 2024 13:23:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c6njRtQ/" 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 D4F9147772 for ; Fri, 22 Mar 2024 13:23:11 +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=1711113791; cv=none; b=RhDSgznyJmYToLHzGPD2MdC1z6IVJi8kUsGcdlwm/MmsSFgvej3kaLcBNa5o8oCXSLvM3Z7tdPWGOwZx2enf+qoRz7GqQiCF6ZwR9GFgQ/uBxk6kscJsuP69MBYzpONtsOpz5jNVxLyh/5mIM9pJoNEjjb0WptDWkuKLrL+Tetg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711113791; c=relaxed/simple; bh=AiSrh+YA/lxHjLdvMVR5E4drVrl44FmWI2qerSd1BDg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=EUt22j75UdFVQi53+wHQbZzhAIHLHe72qW4UYQ31h3KO1lVFQMyriOyLbqj/IEg6dxJtqz4K6nrZb8EgG7I6GBezGI1w2wnvGVY76IQ9KIBClws6cgu9UPQMBChHPAGuiL2gSHspGlzF+J4f41iJ/95ju+dTWMPQ3vP1dJ1yjc4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c6njRtQ/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42BAFC433F1; Fri, 22 Mar 2024 13:23:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711113791; bh=AiSrh+YA/lxHjLdvMVR5E4drVrl44FmWI2qerSd1BDg=; h=From:To:Cc:Subject:Date:From; b=c6njRtQ/X9HmhIIsxJBIGPKC6YiCRTEMieus4KuwrAbK5j2tKqXXFUARAiaH1vgDN JWXzTICc+ugEMJVg2/q+Y+H0XLZ3ozT6EeyWc0ZMzvPoms43ed8Y4HH9eX41Nb/GXL GIZ+gyoPIMABMzGRTMfTI+TqwRNTKZpRGNlP/B9iWBeaqYv3IfyUhFR5OTzh+fe/4B pDQgRz9kI++sp5b2iKGf1vXMM1IcwaWNEGVmyzNeyrqfIrAH4GAYB0tHeb4InQRCc2 oiYsUlAKaXZQK4hgHyPYdLW4q0owTmToo98tpXUR2x+BpVh9r7hrV0vW1WxNhGNMvB ffLkP0iqD4c+Q== From: Arnd Bergmann To: Jarkko Sakkinen , Matthew Garrett , Bartosz Szczepanek , Ard Biesheuvel Cc: Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH] tpm: aovid -Wunused-but-set-variable Date: Fri, 22 Mar 2024 14:22:48 +0100 Message-Id: <20240322132307.907203-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 Content-Transfer-Encoding: 8bit From: Arnd Bergmann Outside of the EFI tpm code, the TPM_MEMREMAP()/TPM_MEMUNMAP functions are defined as trivial macros, leading to the mapping_size variable ending up unused: In file included from drivers/char/tpm/tpm-sysfs.c:16: In file included from drivers/char/tpm/tpm.h:28: include/linux/tpm_eventlog.h:167:6: error: variable 'mapping_size' set but not used [-Werror,-Wunused-but-set-variable] 167 | int mapping_size; Turn the stubs into inline functions to avoid this warning. Fixes: c46f3405692d ("tpm: Reserve the TPM final events table") Signed-off-by: Arnd Bergmann --- include/linux/tpm_eventlog.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/linux/tpm_eventlog.h b/include/linux/tpm_eventlog.h index 7d68a5cc5881..6e5be15029fb 100644 --- a/include/linux/tpm_eventlog.h +++ b/include/linux/tpm_eventlog.h @@ -131,11 +131,16 @@ struct tcg_algorithm_info { }; #ifndef TPM_MEMREMAP -#define TPM_MEMREMAP(start, size) NULL +static inline void *TPM_MEMREMAP(unsigned long start, size_t size) +{ + return NULL; +} #endif #ifndef TPM_MEMUNMAP -#define TPM_MEMUNMAP(start, size) do{} while(0) +static inline void TPM_MEMUNMAP(void *mapping, size_t size) +{ +} #endif /** -- 2.39.2