From patchwork Thu Oct 19 18:45:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 10018169 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C5C7760224 for ; Thu, 19 Oct 2017 18:45:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB76928E2D for ; Thu, 19 Oct 2017 18:45:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B04D028E2F; Thu, 19 Oct 2017 18:45:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65D9E28E2D for ; Thu, 19 Oct 2017 18:45:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752846AbdJSSpY (ORCPT ); Thu, 19 Oct 2017 14:45:24 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:44136 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751458AbdJSSpX (ORCPT ); Thu, 19 Oct 2017 14:45:23 -0400 Received: by mail-io0-f194.google.com with SMTP id m16so10879294iod.1 for ; Thu, 19 Oct 2017 11:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=UPXeaZgB7V0rLhcHio72yCdiPyaBcYoMSDDJoO+xlrI=; b=aqi4sGSlHRqtEXlL3WAvIpqmOO/+8yX5qn2sk6izlYAa5iWo/n2QWyB22/hUJ3lS2r qypac5QXW+nY7OawQCKHI1f1ynoaeLmGzXqkJDqIjlb4hQYHISIFq9BCeQMm6K3WyRBa 2CCd0K/EUgGgrtfbMlxLy54EouI3jlB3kGY2Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=UPXeaZgB7V0rLhcHio72yCdiPyaBcYoMSDDJoO+xlrI=; b=R4ZfbKagqkaOMT2Q6YePF5wrz62Adsdmua3Nxu+LPrUWqiixbNBHQNcC3cVmDvg29i IIeQAsZFNIMKYOtOr7LBfbYcbAkHbw3oVTZ7lpBGxpXQZnX9S13m+NbYWBPH2hYVLpex P75u0RadVUGW+iyJj00xcAgkwuRZS03PZWzhQIlPcTVZCarzel0/bi+TTw+D1wrrq9VX /afTQSkg2jpKloUDq2Ep2ziTKVbkQ4qYk7C7BIrpnj5GN03BEORQjrO4DoqA5AYE18ZK cEoAZmnlgJF6cKqiojet7FqmnzW6act0ppkerdNQ8pXjngQu4OsSSuOYbrw3GV3rq27c GmKA== X-Gm-Message-State: AMCzsaVhh5fc9iz1oLvbm0G1aO4v+wtFbmg6LeYnbZ95fryAPVQyPau1 ulyuTeOajxw3pUMtmc/0Dyweuw== X-Google-Smtp-Source: ABhQp+QEEhhQ//opgIPX2oGLL5PUHqcha69TnzRmn2GvtEn/fVHIZa7y1G5aWxFLMIiTcfEKdEuncg== X-Received: by 10.107.1.198 with SMTP id 189mr2933986iob.75.1508438722436; Thu, 19 Oct 2017 11:45:22 -0700 (PDT) Received: from google.com ([2620:0:1000:1600:41a3:7beb:9a9d:6d9]) by smtp.gmail.com with ESMTPSA id y132sm5655893ioy.69.2017.10.19.11.45.20 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 19 Oct 2017 11:45:21 -0700 (PDT) Date: Thu, 19 Oct 2017 11:45:19 -0700 From: Brian Norris To: Kalle Valo Cc: Ryan Hsu , Grant Grundler , "linux-wireless@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "ath10k@lists.infradead.org" , Arnd Bergmann Subject: [PATCH] ath10k: fix build errors with !CONFIG_PM Message-ID: <20171019184517.GA76422@google.com> References: <20170919232416.108247-1-briannorris@chromium.org> <2809b2cf512d4c198d3cef3f5e468c3c@euamsexm01e.eu.qualcomm.com> <87vajbgqcz.fsf@kamboji.qca.qualcomm.com> <20171019171224.GA46096@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20171019171224.GA46096@google.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Build errors have been reported with CONFIG_PM=n: drivers/net/wireless/ath/ath10k/pci.c:3416:8: error: implicit declaration of function 'ath10k_pci_suspend' [-Werror=implicit-function-declaration] drivers/net/wireless/ath/ath10k/pci.c:3428:8: error: implicit declaration of function 'ath10k_pci_resume' [-Werror=implicit-function-declaration] These are caused by the combination of the following two commits: 6af1de2e4ec4 ("ath10k: mark PM functions as __maybe_unused") 96378bd2c6cd ("ath10k: fix core PCI suspend when WoWLAN is supported but disabled") Both build fine on their own. But now that ath10k_pci_pm_{suspend,resume}() is compiled unconditionally, we should also compile ath10k_pci_{suspend,resume}() unconditionally. And drop the #ifdef around ath10k_pci_hif_{suspend,resume}() too; they are trivial (empty), so we're not saving much space by compiling them out. And the alternatives would be to sprinkle more __maybe_unused, or spread the #ifdef's further. Build tested with the following combinations: CONFIG_PM=y && CONFIG_PM_SLEEP=y CONFIG_PM=y && CONFIG_PM_SLEEP=n CONFIG_PM=n Fixes: 96378bd2c6cd ("ath10k: fix core PCI suspend when WoWLAN is supported but disabled") Fixes: 096ad2a15fd8 ("Merge branch 'ath-next'") Signed-off-by: Brian Norris --- drivers/net/wireless/ath/ath10k/pci.c | 5 ----- 1 file changed, 5 deletions(-) On Thu, Oct 19, 2017 at 10:12:25AM -0700, Brian Norris wrote: > The solution would seem to be either to kill the #ifdefs around > ath10k_pci_{suspend,resume}() and friends (and use __maybe_unused > instead, to further extend Arnd's patch), or else revert Arnd's stuff > and go with CONFIG_PM_SLEEP everywhere, which would resolve the original > warning (promoted to error) that Arnd was resolving. > > I can send out one of these if you'd like. Here you go :) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index b18a9b690df4..d790ea20b95d 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -2577,8 +2577,6 @@ void ath10k_pci_hif_power_down(struct ath10k *ar) */ } -#ifdef CONFIG_PM - static int ath10k_pci_hif_suspend(struct ath10k *ar) { /* Nothing to do; the important stuff is in the driver suspend. */ @@ -2627,7 +2625,6 @@ static int ath10k_pci_resume(struct ath10k *ar) return ret; } -#endif static bool ath10k_pci_validate_cal(void *data, size_t size) { @@ -2782,10 +2779,8 @@ static const struct ath10k_hif_ops ath10k_pci_hif_ops = { .power_down = ath10k_pci_hif_power_down, .read32 = ath10k_pci_read32, .write32 = ath10k_pci_write32, -#ifdef CONFIG_PM .suspend = ath10k_pci_hif_suspend, .resume = ath10k_pci_hif_resume, -#endif .fetch_cal_eeprom = ath10k_pci_hif_fetch_cal_eeprom, };