Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1971415pxp; Mon, 21 Mar 2022 08:41:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAb9LXkQXdwn5+dNEXm4vIsNNwLr4JY7xg4Z8MInMHZD3mGQYhPboMT47d0gP/TvL0RSCd X-Received: by 2002:a05:6402:254e:b0:418:e716:f987 with SMTP id l14-20020a056402254e00b00418e716f987mr23613559edb.74.1647877269973; Mon, 21 Mar 2022 08:41:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647877269; cv=none; d=google.com; s=arc-20160816; b=deEYMPkTAAAinXyU7wg8/9PFHl1swIbpURTbGSduSYaRAN4DS5r7egbWOOlTtdyp5e 5q7RQK63meuDx11YfWvjVHVIEZC4JCdHIk+I6/yBz9t2Z4J8xuAg327668D0WmlseLNL lKJPVeOBfcPI/Ac5DQ7Iu9bk5ycQD3uyOiAdGQRCm40JdW82GfNm/6h8bKDUIQ1zBprC LXnn61z1oP79vdBDIX71qJ5fMemirEeelK1YNwqsydXs1s7kCreA551y11yxWGk3FSQs lTEo7Y9xN8lnECo5LSQakkADXv4iPxKwLdOiDxvI6Ws1Z3M7RDyiFc+uSZy1hwOaaSO+ +vCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:subject:from:message-id:cc:to :dkim-signature; bh=xqO+J3qYKvWooJVksUuAiiLBEJdNT3Gcv0iTkRapBjk=; b=mEgu3LpE8wgTzPuOxghnPCJB8dp0BewD9hijGE4b/FJJvBEKOUQW8g83P4+sEsDPpZ LyK+v0w9hJL2GeS3miBtE5fmIutKBjZHbhcqsCXOXyydx8l/09+MB9ydFrBrCbwja0O5 KatKqedmgR0frmS1260zYfGjz3JH/L+pXEeCuydvqic65u0xfXH2aVXwD1DmaHnVSW4B hFzdsbDLU+M9Wo1S/xAkZt2Il+XSYtRZf9VRy+W2kIM9dujXJ35q8lFAJEc0fYXe+5o8 vlnZThVJoTYsh3+9LEH+wJ2ZvJR5utcorxxsPg7JNTpgT4RU8J5r23/F74U8X0J3v1g1 m37Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=lYjtzbmN; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m4-20020a17090672c400b006df76385cbcsi7770447ejl.348.2022.03.21.08.40.44; Mon, 21 Mar 2022 08:41:09 -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=@messagingengine.com header.s=fm3 header.b=lYjtzbmN; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346022AbiCUJwC (ORCPT + 99 others); Mon, 21 Mar 2022 05:52:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343803AbiCUJv7 (ORCPT ); Mon, 21 Mar 2022 05:51:59 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF8A09BAD8 for ; Mon, 21 Mar 2022 02:50:34 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 509585C015A; Mon, 21 Mar 2022 05:50:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 21 Mar 2022 05:50:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:date:date:from:from:in-reply-to :message-id:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=xqO+J3 qYKvWooJVksUuAiiLBEJdNT3Gcv0iTkRapBjk=; b=lYjtzbmNgu9kHcHHiK3Z4S Dsr8cAsC3eoZ21FA9GYNMArW6agjvK34YkZm2IEL1eCgxxG+GAUOvyrTMRBe0XS7 tTvfqzH3OPwq9SA4GblDIrIvWMiuK1oPZMglsLgZuJ1stUj9bHz632S3MKnF2Pag G9K0mdfMJmPCfXnvRU17VNSMEGwiRtYVyFomfAbL5Mq0RFmYYwExJ1LtOlR6sw1Z HtfNDswkO+q5oj2vGe2IulefbYLhZFdoTmNPJjYvwoX6BX0Tctmjl+QFcLhB6Bfg WTwyOwjDAU+uU2+uoC9CIF1YKHWVMczeVwW0J17OgewZWMHTrHMNFDheA7O2Jm6w == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudegfedgtdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepvffkhffuffestddtredttddttdenucfhrhhomhephfhinhhnucfvhhgrihhn uceofhhthhgrihhnsehlihhnuhigqdhmieekkhdrohhrgheqnecuggftrfgrthhtvghrnh eptdelteekleekkedvueejheekgfdvtdehhefhteeitefhteefgefhudehveevleelnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepfhhthhgrih hnsehlihhnuhigqdhmieekkhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 21 Mar 2022 05:50:32 -0400 (EDT) To: Benjamin Herrenschmidt Cc: "Randy Dunlap" , "Christophe Leroy" , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Message-Id: <0c11c0770fc4ec7e80a4b2e0ffce1055b792cfdb.1647854880.git.fthain@linux-m68k.org> From: Finn Thain Subject: [PATCH v2] macintosh/via-pmu: Avoid compiler warnings when CONFIG_PROC_FS is disabled Date: Mon, 21 Mar 2022 20:28:00 +1100 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE,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 drivers/macintosh/via-pmu.c:897:12: warning: 'pmu_battery_proc_show' defined but not used [-Wunused-function] static int pmu_battery_proc_show(struct seq_file *m, void *v) ^~~~~~~~~~~~~~~~~~~~~ drivers/macintosh/via-pmu.c:871:12: warning: 'pmu_irqstats_proc_show' defined but not used [-Wunused-function] static int pmu_irqstats_proc_show(struct seq_file *m, void *v) ^~~~~~~~~~~~~~~~~~~~~~ drivers/macintosh/via-pmu.c:860:12: warning: 'pmu_info_proc_show' defined but not used [-Wunused-function] static int pmu_info_proc_show(struct seq_file *m, void *v) ^~~~~~~~~~~~~~~~~~ Add some #ifdefs to avoid unused code warnings when CONFIG_PROC_FS is disabled. Cc: Randy Dunlap Cc: Christophe Leroy Reported-by: Randy Dunlap Suggested-by: Christophe Leroy Signed-off-by: Finn Thain --- Changed since v1: - Simplified to take advantage of the fact that proc_mkdir() is stubbed out when CONFIG_PROC_FS=n. Hence that call doesn't need to move within the #ifdef. --- drivers/macintosh/via-pmu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index 2109129ea1bb..495fd35b11de 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c @@ -204,9 +204,11 @@ static int init_pmu(void); static void pmu_start(void); static irqreturn_t via_pmu_interrupt(int irq, void *arg); static irqreturn_t gpio1_interrupt(int irq, void *arg); +#ifdef CONFIG_PROC_FS static int pmu_info_proc_show(struct seq_file *m, void *v); static int pmu_irqstats_proc_show(struct seq_file *m, void *v); static int pmu_battery_proc_show(struct seq_file *m, void *v); +#endif static void pmu_pass_intr(unsigned char *data, int len); static const struct proc_ops pmu_options_proc_ops; @@ -857,6 +859,7 @@ query_battery_state(void) 2, PMU_SMART_BATTERY_STATE, pmu_cur_battery+1); } +#ifdef CONFIG_PROC_FS static int pmu_info_proc_show(struct seq_file *m, void *v) { seq_printf(m, "PMU driver version : %d\n", PMU_DRIVER_VERSION); @@ -977,6 +980,7 @@ static const struct proc_ops pmu_options_proc_ops = { .proc_release = single_release, .proc_write = pmu_options_proc_write, }; +#endif #ifdef CONFIG_ADB /* Send an ADB command */ -- 2.32.0