From patchwork Wed Oct 26 07:25:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yupeng Li X-Patchwork-Id: 11096 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp110297wru; Wed, 26 Oct 2022 00:37:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5mvx8qgUx/sYbcMPNhQWm4oAwwUOyLM+GWdBQiWNCUmyG7e3ePaAh29o+TUFW+pyX7NS4P X-Received: by 2002:aa7:cc8e:0:b0:457:23db:f0cc with SMTP id p14-20020aa7cc8e000000b0045723dbf0ccmr40041816edt.122.1666769824810; Wed, 26 Oct 2022 00:37:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666769824; cv=none; d=google.com; s=arc-20160816; b=HAkhWJt0DsZtp4U1eXrWPDTSlrQgiME2cGQloJGBfuO5MTFJ6GTX+tl9euV5MHxvnE 5eJDBTXVOvSYHJLGNQkkdwT82CUyt1KovrC1YNfeXbi8chPkfNQBiw4z08CxhgC0u5op rgPFTGRJqMq3tFuMpU7vAz9HT4H89IJ1J2LD3WcefkjL0Zf/JwadRZJRElrPLFsAzfuS 9PCtQByJT97r6OgMDztJPco2HeJiNDWdHcMBQlCE5Uqy04Ghix0o7QQ5g8/UljuOU9Je ZREI/bIpfMf7TWBKskoiUHVHD4qBhF3x2qGRFf8MhnlrQJycq9CH81wSqR5UMYbT/F7w B2wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=m8iNq5Y+2cO4PYyoyLlVn6vt5S2WLyL0VQzmjyAEUAo=; b=Wn5F+VgRW2Wh/ysg5sNojRv61pw8yXYOMjvD2E0HCJdMavrFNxlwvCHMeuz12NUwci klsS4yPC2IkpbAuK0tjg96/+BFq3Bn1+gmuoBvKPa0I3FVLl/q/N+v4ArkroTjFYfSfl PjpUQ5srJQbRltQ2UAYR9B0ZJVJJ2ogr0u8D15m6Eh00QgwKb2R4DuuO0AFLgK1M+7GS FgrXE7Vdq+CtJ865TVmcn+xbj0uTVjMTRmhVLXbmKd12mFStWG5QJFcac5RFb66QCjWR +SWVDTXx9FMFX7Qcsoxk8omXozbTQJuXRQIrjFUNsevYA8stLjgQpMkGgsmVtol+zC5E Wzvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zbhlos.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gx11-20020a1709068a4b00b007815ca78c38si4432583ejc.235.2022.10.26.00.36.39; Wed, 26 Oct 2022 00:37:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zbhlos.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233096AbiJZHcf (ORCPT + 99 others); Wed, 26 Oct 2022 03:32:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233139AbiJZHcc (ORCPT ); Wed, 26 Oct 2022 03:32:32 -0400 X-Greylist: delayed 376 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 26 Oct 2022 00:32:29 PDT Received: from mail-m11874.qiye.163.com (mail-m11874.qiye.163.com [115.236.118.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86197A50F5; Wed, 26 Oct 2022 00:32:29 -0700 (PDT) Received: from caicai-HWPC.. (unknown [IPV6:240e:36a:141c:3700:9049:ecf7:8648:6a1c]) by mail-m11874.qiye.163.com (Hmail) with ESMTPA id 94E973C052D; Wed, 26 Oct 2022 15:26:09 +0800 (CST) From: Yupeng Li To: Shyam-sundar.S-k@amd.com, hdegoede@redhat.com, markgross@kernel.org Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, caizp2008@163.com, Yupeng Li Subject: [PATCH 1/1] platform/x86/amd: Fix pmc compile dependency errors. Date: Wed, 26 Oct 2022 15:25:31 +0800 Message-Id: <20221026072531.346013-1-liyupeng@zbhlos.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVlDSR5JVhhNQ0NCTR1MS0gYHVUTARMWGhIXJBQOD1 lXWRgSC1lBWUlPSx5BSE0aQUpPShhBSExLS0FCS09CQR4YHUxBQ01PQ0FNGkoYWVdZFhoPEhUdFF lBWU9LSFVKSktISkxVSktLVUtZBg++ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6OTo6Cyo*KT0aLR0fS0w0LEw0 GixPFElVSlVKTU1NTE1CSkxLSk9KVTMWGhIXVRcSAg4LHhUcOwEZExcUCFUYFBZFWVdZEgtZQVlJ T0seQUhNGkFKT0oYQUhMS0tBQktPQkEeGB1MQUNNT0NBTRpKGFlXWQgBWUFISkhONwY+ X-HM-Tid: 0a84132f2d632eb0kusn94e973c052d X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747734836041746120?= X-GMAIL-MSGID: =?utf-8?q?1747734836041746120?= When disabled CONFIG_SUSPEND and CONFIG_DEBUG_FS, get_metrics_table and amd_pmc_idlemask_read is defined under two conditions of this, pmc build with implicit declaration of function error.Some build error messages are as follows: CC [M] drivers/platform/x86/amd/pmc.o drivers/platform/x86/amd/pmc.c: In function ‘smu_fw_info_show’: drivers/platform/x86/amd/pmc.c:436:6: error: implicit declaration of function ‘get_metrics_table’ [-Werror=implicit-function-declaration] 436 | if (get_metrics_table(dev, &table)) | ^~~~~~~~~~~~~~~~~ drivers/platform/x86/amd/pmc.c: In function ‘amd_pmc_idlemask_show’: drivers/platform/x86/amd/pmc.c:508:8: error: implicit declaration of function ‘amd_pmc_idlemask_read’; did you mean ‘amd_pmc_idlemask_show’? [-Werror=implicit-function-declaration] 508 | rc = amd_pmc_idlemask_read(dev, NULL, s); | ^~~~~~~~~~~~~~~~~~~~~ | amd_pmc_idlemask_show cc1: some warnings being treated as errors Signed-off-by: Yupeng Li Reviewed-by: Caicai --- drivers/platform/x86/amd/pmc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/amd/pmc.c b/drivers/platform/x86/amd/pmc.c index ce859b300712..2b08039921b8 100644 --- a/drivers/platform/x86/amd/pmc.c +++ b/drivers/platform/x86/amd/pmc.c @@ -433,8 +433,10 @@ static int smu_fw_info_show(struct seq_file *s, void *unused) struct smu_metrics table; int idx; +#if defined(CONFIG_SUSPEND) || defined(CONFIG_DEBUG_FS) if (get_metrics_table(dev, &table)) return -EINVAL; +#endif seq_puts(s, "\n=== SMU Statistics ===\n"); seq_printf(s, "Table Version: %d\n", table.table_version); @@ -503,11 +505,12 @@ static int amd_pmc_idlemask_show(struct seq_file *s, void *unused) if (rc) return rc; } - if (dev->major > 56 || (dev->major >= 55 && dev->minor >= 37)) { +#if defined(CONFIG_SUSPEND) || defined(CONFIG_DEBUG_FS) rc = amd_pmc_idlemask_read(dev, NULL, s); if (rc) return rc; +#endif } else { seq_puts(s, "Unsupported SMU version for Idlemask\n"); }