Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2304173pxp; Mon, 21 Mar 2022 16:23:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2H5XaD1BdR1PZEmwWGizX1r5gyIS8wHXVA+QHv5ari6Hg0o3DPLMfA00Fb9dBuKNK4rEF X-Received: by 2002:a17:902:b189:b0:14d:6f87:7c25 with SMTP id s9-20020a170902b18900b0014d6f877c25mr15287204plr.31.1647905035311; Mon, 21 Mar 2022 16:23:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647905035; cv=none; d=google.com; s=arc-20160816; b=IpvXCUmSFRm98118UYvjA8cxNxYMXqjjHB78G6yNSZcER4aT3LpxKFgxFiQEoVN+TU JUhQfqHV+QGyOARskf5i5mbiiEDb/itPI4aPaFVpKB/bpNr3Adw4F95Kk42APglEayXu oeVZuBIZMfzOR4VXQpkiX6BPeJ5EAImKTXHyprdYszPPN1don1zE+647yLKN4MsDWbQY dlpi9YJdgoCM9eMWdOLi92wIVZzCU5cqrCw3yM+zVn59T8Cubqh/n22pgEtE40bNZokh Y4ROlrm+b/hNMQiBxuwKN9RT6CA4L+/aAQWtSBd6DYuijNr7GCyGr2E36p2Tj1LGFnNQ +gCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=roFmIy7ERbZhzCdoKPTNzJ04IPexvyGINPkBzgIr3yI=; b=cJty8j1pPgPAiucgvkoPA7A6726oaxlzWLuHj+a1GQWtb+4c2QLOEIsT40rtSyDRhB 3olOjSSkKz6CDzG9t5BmdP1hHyyvl5LkSWjdjDvTCYHR3AtOlMfjFITP3cnzlFrKd+X4 qsT/D1Zh7xo3EUtaUxjr2voPTDDVgDCSflMSrsH9g9W+I+jlCmYi/knfh5R0ZeU24pT+ wNa9IHY5EVQs7gLOYe0ykYH5+c9Kow/mMHCIFQFNpmZTZU5J9IYei2KgM83jtMdpPmLH h5YpEuHYcHVj7J0w9dIAwBjloeFYfTIcoEQIrAyxS8ONUIDwnnQzWTHEnhw0vlKldWjr gIBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=R5o7PYox; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 133-20020a62198b000000b004fa3a8dffbfsi7872871pfz.118.2022.03.21.16.23.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:23:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=R5o7PYox; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 084F042ECAB; Mon, 21 Mar 2022 15:24:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229706AbiCUWIH (ORCPT + 99 others); Mon, 21 Mar 2022 18:08:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbiCUWIF (ORCPT ); Mon, 21 Mar 2022 18:08:05 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C58EE3FCCE8 for ; Mon, 21 Mar 2022 14:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID: Sender:Reply-To:Content-ID:Content-Description; bh=roFmIy7ERbZhzCdoKPTNzJ04IPexvyGINPkBzgIr3yI=; b=R5o7PYoxgNC067hILjqK+/dz9x 6uL2vy8NfYNYqZLoYMbNS+EHz5nPJE5bk7D25QQjeW3WxYYSx86VOIRrPQ8b8Syse84r6KOTissD4 yjbAqu+w3nW1Lnam0BCg5VVUKNb7yI7yesp9xtp8iNjBl2tUWoYoD/J5HjKH3OTrkb8wKU2jm6n69 SXHWoqLSnQL/7tJmRC9I4SYEuMlZWekh+z12ONXpvusPF1sT1fl9tIkr2l6eAllnU7nC9mSVaX/iU Eloy61/03ss+UQXnBOsrZAgvemxmHYt+arYILd+7T6kMlWn+oKf8VXis+wOWfNXXzpWHm+l4VqzsD swVbh2jA==; Received: from [2601:1c0:6280:3f0::aa0b] by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWPzM-003G0Q-Em; Mon, 21 Mar 2022 21:54:56 +0000 Message-ID: <11533b46-70ec-6dde-fd18-af44cc36b1ab@infradead.org> Date: Mon, 21 Mar 2022 14:54:50 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v2] macintosh/via-pmu: Avoid compiler warnings when CONFIG_PROC_FS is disabled Content-Language: en-US To: Finn Thain , Benjamin Herrenschmidt Cc: Christophe Leroy , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <0c11c0770fc4ec7e80a4b2e0ffce1055b792cfdb.1647854880.git.fthain@linux-m68k.org> From: Randy Dunlap In-Reply-To: <0c11c0770fc4ec7e80a4b2e0ffce1055b792cfdb.1647854880.git.fthain@linux-m68k.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 On 3/21/22 02:28, Finn Thain wrote: > 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 Tested-by: Randy Dunlap Acked-by: Randy Dunlap Thanks. > --- > 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 */ -- ~Randy