From patchwork Tue May 16 20:27:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 94934 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp684141vqo; Tue, 16 May 2023 13:31:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4f1XZNyqXzrcUKopBB23Fi4yDK9KBTPp5CEiXwGg+n4WEUlGdqrDGp9teJ53H9N20VBcnF X-Received: by 2002:a05:6a20:4429:b0:f2:ea8e:b130 with SMTP id ce41-20020a056a20442900b000f2ea8eb130mr46050190pzb.62.1684269074790; Tue, 16 May 2023 13:31:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684269074; cv=none; d=google.com; s=arc-20160816; b=bkvMaYLGkHqOJG//fZj3MVabVSlqmToWuuM4IP11rb806GgAmsQ/5tz7LBOO3uX3ve /JZT2Y35rR/vOB9CxPtoe/E6lVTEsMQ++SJVGCs4LvSGauoc84Ntok4FKeSvbX8lmIyH b2BH3tQOzHFOulAuYNIx2IAS87nrG00fpGo7H5kIPdJaHAw9fFKDSN9gvOmGnzgGXb+U IyTvTCgZkY2cHEr5/JMGDPsfpgpWOaXbOlnNKk1bjdM584eXjRhE/7i9AobUk3g/KDM8 afPL5MU/CSB5L8jtvX8KZOXrWNRCW9nHZYoraL1aigt7a/tkf7TzBmBEjZrTndsaXCKj EvIw== 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:dkim-signature; bh=mUKs/pV0hYjc0zaQQ7F15FB7pUWKanawAZQcgU9HlcI=; b=UkP6p4IHlE09W34065t1Sd5egFb7nGI8dsDBNhAexb/zsDHXHduXxLMWfBzRSmOQyE n97TOsBxKEm4dtmAmx5eF18yx1/VIFmxHz78mOxh0owveGuYmZ9Y9gwlsdI0HxQAC8uS HtQIxeVuUfrcFUR846Q+WjRwYztbbOisqT3m1P9ZRwHVBHuC0q1jN5mEdxcIbHrOOtBZ yvE3N1RLwfdecGHxGBeJzyKxdMHSzHSbRXcEXNujFkBcyfPRLCy1e4pFxv6FmvooBvAZ vV6MRtPvat9p43irFwbeXUoNjlqU7okFH/Ajr7kdp7BsTOU0R0OmieXF1sSXNXWJBEJY BuXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YB8SszKj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gv9-20020a17090b11c900b0024bfa14eaaasi11814pjb.51.2023.05.16.13.31.02; Tue, 16 May 2023 13:31:14 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YB8SszKj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230222AbjEPU2C (ORCPT + 99 others); Tue, 16 May 2023 16:28:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229829AbjEPU15 (ORCPT ); Tue, 16 May 2023 16:27:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41E6776BF for ; Tue, 16 May 2023 13:27:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B1A6363A0B for ; Tue, 16 May 2023 20:27:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38E8AC4339B; Tue, 16 May 2023 20:27:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684268871; bh=sfgV9HY8dwtJ3Sv8P/RJdi60yqFBSKBu5UEl+OFhL8A=; h=From:To:Cc:Subject:Date:From; b=YB8SszKjLhZQUYiC2kX8p3x/of9ENI3oPjkM3LoWjIXDffii0h0lM9Uy+70qcdcyZ J1j7VseFWwiciyYfi8fpzn6jM4bnAAX2FTSwAhnAt6bVWf4cbrkguINCEUU3SbxfHB 5V2Cp8YK5GpnMYVfRqjI7+RrJri/B/NzVuD5037v38GhZMll/22iNu3zlHMuYgnb2t sBO3o3NO9GvadoOp84HsnymoYgtULDRFtCPtjpG/vwLxGryFtaHq0FNq1AsnGft0tl ZiYtt2xvNz5AyBo/8VSQcnMPrz2w8XC1chqUK1HzLBHc4oJrh6OPcUp9SsghNorHmo I1XqzulsFuH5w== From: Arnd Bergmann To: Lee Jones Cc: Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH] mfd: intel-lpss: hide suspend/resume functions in #ifdef Date: Tue, 16 May 2023 22:27:42 +0200 Message-Id: <20230516202746.561111-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1766084129269083206?= X-GMAIL-MSGID: =?utf-8?q?1766084129269083206?= From: Arnd Bergmann When CONFIG_PM is disabled, the prototypes for these two functions are not visible: drivers/mfd/intel-lpss.c:482:5: error: no previous prototype for 'intel_lpss_suspend' [-Werror=missing-prototypes] 482 | int intel_lpss_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~ drivers/mfd/intel-lpss.c:503:5: error: no previous prototype for 'intel_lpss_resume' [-Werror=missing-prototypes] 503 | int intel_lpss_resume(struct device *dev) Add the same #ifdef around the definition of the unused functions, which avoids the warning and slightly reduces the code size. Signed-off-by: Arnd Bergmann --- drivers/mfd/intel-lpss.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c index cfbee2cfba6b..9591b354072a 100644 --- a/drivers/mfd/intel-lpss.c +++ b/drivers/mfd/intel-lpss.c @@ -460,6 +460,7 @@ void intel_lpss_remove(struct device *dev) } EXPORT_SYMBOL_GPL(intel_lpss_remove); +#ifdef CONFIG_PM static int resume_lpss_device(struct device *dev, void *data) { if (!dev_pm_test_driver_flags(dev, DPM_FLAG_SMART_SUSPEND)) @@ -514,6 +515,7 @@ int intel_lpss_resume(struct device *dev) return 0; } EXPORT_SYMBOL_GPL(intel_lpss_resume); +#endif static int __init intel_lpss_init(void) {