From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD1FCC2BBD4 for ; Fri, 4 Dec 2020 10:04:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6399822795 for ; Fri, 4 Dec 2020 10:04:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729711AbgLDKDv (ORCPT ); Fri, 4 Dec 2020 05:03:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387851AbgLDKDu (ORCPT ); Fri, 4 Dec 2020 05:03:50 -0500 Received: from mail-vs1-xe43.google.com (mail-vs1-xe43.google.com [IPv6:2607:f8b0:4864:20::e43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5B1DC061A4F for ; Fri, 4 Dec 2020 02:03:09 -0800 (PST) Received: by mail-vs1-xe43.google.com with SMTP id x4so2922316vsp.7 for ; Fri, 04 Dec 2020 02:03:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Rcku4lPAn/y4YhBZdjYlkKZQc+t40+z/luVVG1YdFJI=; b=DHGwreClgzq5UgdvP5poTN7RLhMGva3+Muj5jp5VFGgimCmx9WYcK0eAsHiPKmOBvm fNIxvrpnxT7enGivLKac/vig8mhqLw+2Cr5Ryv3fxuRyEA+glFI9u5W3FH+lcviTWeGe gBc30+jMZuskqlYBYm3IDHW+cnGRkBk2GrNsHGWwfc0la+TFas3pa3GnvnDDDfrSJ5E/ lbhQqn6JI6qM9R1x/J78C+8KnVayuEfKRieda9i6E3ekSvyEAadWUtTwn7t5ZCmq1hzh 964NVr4rM402IWoljsqluvgZHAACwUvLsZ+XPrjLvLBmKS08Kc99fr5VRKqG48f1KGm8 G7Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Rcku4lPAn/y4YhBZdjYlkKZQc+t40+z/luVVG1YdFJI=; b=kqUB2zkqZvJxBPg6OXfc74CVpzHOU6/eMVk8dfkakmtKdigNA/Pz5SZHGg/+5iy+0P NbvI8loYfbbPtEj3crOR9gsX0/SSPexGBRWs0ehY6jRlkVkR0XoyjSAkz+CiqUxds7fg 2DxJwML6oszY/SEYheFVy8wZQ0lHBHggAbfbXlzdWZGN2h8RJFr0KCTAbC4NDcGpqhWh Gg3/TYZlEejTB8On5Dj4bj2FNJulIxN/JEDhzWDdP8KAFVVoDzrS9u9mjFm/+uM+g5qP 9Htt++xTc6BnFsh/lxMOYKC+wR4KdkPNJA3grvoVGGc91RsBs60fT77O8Y8aJliSdhQT KOpA== X-Gm-Message-State: AOAM532pyMsDspfhk2YwtUpsuQ9skzE4L14nm+a1qSjGYGxwuWNrRR3d pvRHoQOQeZMQnBIZn6D0wzEOGFnnaCZNfV7BRCpDCA== X-Google-Smtp-Source: ABdhPJzF251m6Qz8Y2YtlC0BVJfa4JQ2d5vZe0SrIQHOSN0qQQLEJYfanTHuPYzxI3so5RnK5TCTPRNHPYoR6mFf9U4= X-Received: by 2002:a67:fe85:: with SMTP id b5mr241341vsr.19.1607076189014; Fri, 04 Dec 2020 02:03:09 -0800 (PST) MIME-Version: 1.0 References: <20201203222922.1067522-1-arnd@kernel.org> In-Reply-To: <20201203222922.1067522-1-arnd@kernel.org> From: Ulf Hansson Date: Fri, 4 Dec 2020 11:02:32 +0100 Message-ID: Subject: Re: [PATCH] mmc: mediatek: mark PM functions as __maybe_unused To: Arnd Bergmann Cc: Chaotian Jing , Matthias Brugger , Wenbin Mei , Arnd Bergmann , Chun-Hung Wu , yong mao , Amey Narkhede , Marek Vasut , "linux-mmc@vger.kernel.org" , Linux ARM , "moderated list:ARM/Mediatek SoC support" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 3 Dec 2020 at 23:29, Arnd Bergmann wrote: > > From: Arnd Bergmann > > The #ifdef check for the suspend/resume functions is wrong: > > drivers/mmc/host/mtk-sd.c:2765:12: error: unused function 'msdc_suspend' [-Werror,-Wunused-function] > static int msdc_suspend(struct device *dev) > drivers/mmc/host/mtk-sd.c:2779:12: error: unused function 'msdc_resume' [-Werror,-Wunused-function] > static int msdc_resume(struct device *dev) > > Remove the #ifdef and mark all four as __maybe_unused to aovid the > problem. > > Fixes: c0a2074ac575 ("mmc: mediatek: Fix system suspend/resume support for CQHCI") > Signed-off-by: Arnd Bergmann > --- > drivers/mmc/host/mtk-sd.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c > index d057fb11112a..de09c6347524 100644 > --- a/drivers/mmc/host/mtk-sd.c > +++ b/drivers/mmc/host/mtk-sd.c > @@ -2683,7 +2683,6 @@ static int msdc_drv_remove(struct platform_device *pdev) > return 0; > } > > -#ifdef CONFIG_PM > static void msdc_save_reg(struct msdc_host *host) Shouldn't msdc_save|restore_reg() be turned into "__maybe_unused" as well? > { > u32 tune_reg = host->dev_comp->pad_tune_reg; > @@ -2742,7 +2741,7 @@ static void msdc_restore_reg(struct msdc_host *host) > __msdc_enable_sdio_irq(host, 1); > } > > -static int msdc_runtime_suspend(struct device *dev) > +static int __maybe_unused msdc_runtime_suspend(struct device *dev) > { > struct mmc_host *mmc = dev_get_drvdata(dev); > struct msdc_host *host = mmc_priv(mmc); > @@ -2752,7 +2751,7 @@ static int msdc_runtime_suspend(struct device *dev) > return 0; > } > > -static int msdc_runtime_resume(struct device *dev) > +static int __maybe_unused msdc_runtime_resume(struct device *dev) > { > struct mmc_host *mmc = dev_get_drvdata(dev); > struct msdc_host *host = mmc_priv(mmc); > @@ -2762,7 +2761,7 @@ static int msdc_runtime_resume(struct device *dev) > return 0; > } > > -static int msdc_suspend(struct device *dev) > +static int __maybe_unused msdc_suspend(struct device *dev) > { > struct mmc_host *mmc = dev_get_drvdata(dev); > int ret; > @@ -2776,11 +2775,10 @@ static int msdc_suspend(struct device *dev) > return pm_runtime_force_suspend(dev); > } > > -static int msdc_resume(struct device *dev) > +static int __maybe_unused msdc_resume(struct device *dev) > { > return pm_runtime_force_resume(dev); > } > -#endif > > static const struct dev_pm_ops msdc_dev_pm_ops = { You may also change this to a __maybe_unused, as long as you also assign the .pm pointer in the mt_msdc_driver with pm_ptr(&msdc_dev_pm_ops). Ideally the compiler should drop these functions/datas entirely then. > SET_SYSTEM_SLEEP_PM_OPS(msdc_suspend, msdc_resume) > -- > 2.27.0 > Kind regards Uffe From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2048EC433FE for ; Fri, 4 Dec 2020 10:03:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BBC2122795 for ; Fri, 4 Dec 2020 10:03:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBC2122795 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6g/8F797BNmzYxvA6IYKEkEIiidyh8PqlS95hpS0wOs=; b=MSBgZomsGbrmUQRKXKNJ9zbQ2 eByy/9R1WuKrAiGzmKzi7LJlLPKv8CdlA7fTScjnmcnlTnDKSvnuLZA41JTlFTccKNh9l+R/51w7n FcTpdztzax57bYWLo9aTorse3yabDc7A83/NbtKcM4wTVsO2PmOY9UPZn64AiNCOGEeU+TvY6+gvo w7k9AfoWThgwapQOrTX2hPSxBgcGJ2gIuaJpXGpJCXsZAN3BOxW1uwub0v5HmsNJkHQaGTdN3TZxc AXr4iLlGkvEZBINiHY0reX4FarFVqWINeMQCa+4G0TV9Fl1FXvqJjQXcVTJNMwZNO0xlAIdULUO9v pvtiOVUhg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kl7vo-0005iY-WC; Fri, 04 Dec 2020 10:03:17 +0000 Received: from mail-vs1-xe42.google.com ([2607:f8b0:4864:20::e42]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kl7vk-0005h9-DS for linux-mediatek@lists.infradead.org; Fri, 04 Dec 2020 10:03:13 +0000 Received: by mail-vs1-xe42.google.com with SMTP id w18so2912090vsk.12 for ; Fri, 04 Dec 2020 02:03:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Rcku4lPAn/y4YhBZdjYlkKZQc+t40+z/luVVG1YdFJI=; b=DHGwreClgzq5UgdvP5poTN7RLhMGva3+Muj5jp5VFGgimCmx9WYcK0eAsHiPKmOBvm fNIxvrpnxT7enGivLKac/vig8mhqLw+2Cr5Ryv3fxuRyEA+glFI9u5W3FH+lcviTWeGe gBc30+jMZuskqlYBYm3IDHW+cnGRkBk2GrNsHGWwfc0la+TFas3pa3GnvnDDDfrSJ5E/ lbhQqn6JI6qM9R1x/J78C+8KnVayuEfKRieda9i6E3ekSvyEAadWUtTwn7t5ZCmq1hzh 964NVr4rM402IWoljsqluvgZHAACwUvLsZ+XPrjLvLBmKS08Kc99fr5VRKqG48f1KGm8 G7Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Rcku4lPAn/y4YhBZdjYlkKZQc+t40+z/luVVG1YdFJI=; b=Ol/hufzItWuvwi9OYrnnGS37BUgeCPqi5vw1J13lGlvBIK4q7H7KIvw27NIlB7xXIK oGxCNk/R9fdl8qIyml0nOPXzpngLvT4OKrE8EqMYkTmLQHGLgg92i/UI/hszzoC/PUJQ NtB8ZF67ESJV7pzB9wGFNn/cHZwW5LFfuYaghSZ4NwImI6Tg35tcSMEkN6tHX4x+ReV1 37ACGzzDM1sMzfMXW6w3ThEvpFlQhgWEXcxDW8XBgzKgcsSJBciQIVWxhDO7gHBDiDJw /eFGxYASF6vc+oBD23aZJQTP1RIz3nFCnpn1h/uk9glJn6ZQ4IrgUkAAn0iA822tU8hh ovTg== X-Gm-Message-State: AOAM532mncIRYCEwXAITVyRE309Uxav86jnetv0VeT3iMJVTIW2ciH8a BdnpQdnokSmFrWHa1H0t52ZBhnXvBhTyKgs47olbiyc3vCbY5NQS X-Google-Smtp-Source: ABdhPJzF251m6Qz8Y2YtlC0BVJfa4JQ2d5vZe0SrIQHOSN0qQQLEJYfanTHuPYzxI3so5RnK5TCTPRNHPYoR6mFf9U4= X-Received: by 2002:a67:fe85:: with SMTP id b5mr241341vsr.19.1607076189014; Fri, 04 Dec 2020 02:03:09 -0800 (PST) MIME-Version: 1.0 References: <20201203222922.1067522-1-arnd@kernel.org> In-Reply-To: <20201203222922.1067522-1-arnd@kernel.org> From: Ulf Hansson Date: Fri, 4 Dec 2020 11:02:32 +0100 Message-ID: Subject: Re: [PATCH] mmc: mediatek: mark PM functions as __maybe_unused To: Arnd Bergmann X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201204_050312_504140_942B381F X-CRM114-Status: GOOD ( 21.08 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Wenbin Mei , Arnd Bergmann , Chun-Hung Wu , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , yong mao , Amey Narkhede , "moderated list:ARM/Mediatek SoC support" , Linux ARM , Matthias Brugger , Chaotian Jing Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Thu, 3 Dec 2020 at 23:29, Arnd Bergmann wrote: > > From: Arnd Bergmann > > The #ifdef check for the suspend/resume functions is wrong: > > drivers/mmc/host/mtk-sd.c:2765:12: error: unused function 'msdc_suspend' [-Werror,-Wunused-function] > static int msdc_suspend(struct device *dev) > drivers/mmc/host/mtk-sd.c:2779:12: error: unused function 'msdc_resume' [-Werror,-Wunused-function] > static int msdc_resume(struct device *dev) > > Remove the #ifdef and mark all four as __maybe_unused to aovid the > problem. > > Fixes: c0a2074ac575 ("mmc: mediatek: Fix system suspend/resume support for CQHCI") > Signed-off-by: Arnd Bergmann > --- > drivers/mmc/host/mtk-sd.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c > index d057fb11112a..de09c6347524 100644 > --- a/drivers/mmc/host/mtk-sd.c > +++ b/drivers/mmc/host/mtk-sd.c > @@ -2683,7 +2683,6 @@ static int msdc_drv_remove(struct platform_device *pdev) > return 0; > } > > -#ifdef CONFIG_PM > static void msdc_save_reg(struct msdc_host *host) Shouldn't msdc_save|restore_reg() be turned into "__maybe_unused" as well? > { > u32 tune_reg = host->dev_comp->pad_tune_reg; > @@ -2742,7 +2741,7 @@ static void msdc_restore_reg(struct msdc_host *host) > __msdc_enable_sdio_irq(host, 1); > } > > -static int msdc_runtime_suspend(struct device *dev) > +static int __maybe_unused msdc_runtime_suspend(struct device *dev) > { > struct mmc_host *mmc = dev_get_drvdata(dev); > struct msdc_host *host = mmc_priv(mmc); > @@ -2752,7 +2751,7 @@ static int msdc_runtime_suspend(struct device *dev) > return 0; > } > > -static int msdc_runtime_resume(struct device *dev) > +static int __maybe_unused msdc_runtime_resume(struct device *dev) > { > struct mmc_host *mmc = dev_get_drvdata(dev); > struct msdc_host *host = mmc_priv(mmc); > @@ -2762,7 +2761,7 @@ static int msdc_runtime_resume(struct device *dev) > return 0; > } > > -static int msdc_suspend(struct device *dev) > +static int __maybe_unused msdc_suspend(struct device *dev) > { > struct mmc_host *mmc = dev_get_drvdata(dev); > int ret; > @@ -2776,11 +2775,10 @@ static int msdc_suspend(struct device *dev) > return pm_runtime_force_suspend(dev); > } > > -static int msdc_resume(struct device *dev) > +static int __maybe_unused msdc_resume(struct device *dev) > { > return pm_runtime_force_resume(dev); > } > -#endif > > static const struct dev_pm_ops msdc_dev_pm_ops = { You may also change this to a __maybe_unused, as long as you also assign the .pm pointer in the mt_msdc_driver with pm_ptr(&msdc_dev_pm_ops). Ideally the compiler should drop these functions/datas entirely then. > SET_SYSTEM_SLEEP_PM_OPS(msdc_suspend, msdc_resume) > -- > 2.27.0 > Kind regards Uffe _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E293C4361A for ; Fri, 4 Dec 2020 10:04:33 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A869922795 for ; Fri, 4 Dec 2020 10:04:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A869922795 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jiv1G9HDCItsnS/jdzW9W9NjhLwTvXTFwxwjdXiWhTg=; b=uv0GbnNeDnyC4V1h1uQogUaNk piAg8VOUawvqLLYr1EIDRblmgK1P40HRccZuSZK4rBus+O697SNxWXBwdPC8kgNzDBXaRiGAVCXMC CNW4iKevn/GbPaF5i2FUVdR1EfuPhJbID6ehRjnN0sDTgdsWOh3zDBfWuIqgCO6/HdNxE/yZ4pGxp KBkm40/14Rfbm9cr2VGrTZKyP1YD0WWh7J4J0pFI6rxKAqK+CDTovXu1AOruch6a6VsGL7+UQ7JtY G3wTDMvxJT4NVDKHu1X5pt+QZNc0c+NUyOgcSP2L0XPLreeNIuyuKDUQwNhFgGuOJP9DNx7COfrVQ TWX6EVBtg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kl7vn-0005hu-4F; Fri, 04 Dec 2020 10:03:15 +0000 Received: from mail-vs1-xe41.google.com ([2607:f8b0:4864:20::e41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kl7vk-0005hA-Ee for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2020 10:03:13 +0000 Received: by mail-vs1-xe41.google.com with SMTP id q5so2952529vsg.0 for ; Fri, 04 Dec 2020 02:03:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Rcku4lPAn/y4YhBZdjYlkKZQc+t40+z/luVVG1YdFJI=; b=DHGwreClgzq5UgdvP5poTN7RLhMGva3+Muj5jp5VFGgimCmx9WYcK0eAsHiPKmOBvm fNIxvrpnxT7enGivLKac/vig8mhqLw+2Cr5Ryv3fxuRyEA+glFI9u5W3FH+lcviTWeGe gBc30+jMZuskqlYBYm3IDHW+cnGRkBk2GrNsHGWwfc0la+TFas3pa3GnvnDDDfrSJ5E/ lbhQqn6JI6qM9R1x/J78C+8KnVayuEfKRieda9i6E3ekSvyEAadWUtTwn7t5ZCmq1hzh 964NVr4rM402IWoljsqluvgZHAACwUvLsZ+XPrjLvLBmKS08Kc99fr5VRKqG48f1KGm8 G7Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Rcku4lPAn/y4YhBZdjYlkKZQc+t40+z/luVVG1YdFJI=; b=thx//kUlJs/KxWqgncklKGvlmRD/A/2AmM0hbrmk3Gt0ACMAqfbfnK7Zj2cZHRunIs UAK630SJI55W7UQaJ6BIFHLiERYCbDZxWWxW1ovwyPTzqvUlLJwwc54GCWA9YK4mMug9 c5tyWsXj/nnT2uMoOPNPkcfm3fE13MEoc3O1WId57pQW/juWW5oUQfMGoGukd0UHcU5K gu++zw4yAuZlgffeKPBiVGEIGuFIqwB/5Yxf6NgeFs3KifhoQ0HJfe6CHeOSNrszafv8 ki522byBMQmO6BiUnqXpMKwwIkOKBsIxmBD1ytvhPnHbh9X9dOzhMett1JBxtAonCztu gUjg== X-Gm-Message-State: AOAM531lqz5MBZe3L00e5VUhWfV/TPCJi/1RKB1ejuXP6RiFIYB5W/Xg zaASRo24Bx6KCwvSjAPAm8j8Y0BUrSyDie+jAIINlg== X-Google-Smtp-Source: ABdhPJzF251m6Qz8Y2YtlC0BVJfa4JQ2d5vZe0SrIQHOSN0qQQLEJYfanTHuPYzxI3so5RnK5TCTPRNHPYoR6mFf9U4= X-Received: by 2002:a67:fe85:: with SMTP id b5mr241341vsr.19.1607076189014; Fri, 04 Dec 2020 02:03:09 -0800 (PST) MIME-Version: 1.0 References: <20201203222922.1067522-1-arnd@kernel.org> In-Reply-To: <20201203222922.1067522-1-arnd@kernel.org> From: Ulf Hansson Date: Fri, 4 Dec 2020 11:02:32 +0100 Message-ID: Subject: Re: [PATCH] mmc: mediatek: mark PM functions as __maybe_unused To: Arnd Bergmann X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201204_050312_514042_C1563CF7 X-CRM114-Status: GOOD ( 22.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Wenbin Mei , Arnd Bergmann , Chun-Hung Wu , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , yong mao , Amey Narkhede , "moderated list:ARM/Mediatek SoC support" , Linux ARM , Matthias Brugger , Chaotian Jing Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 3 Dec 2020 at 23:29, Arnd Bergmann wrote: > > From: Arnd Bergmann > > The #ifdef check for the suspend/resume functions is wrong: > > drivers/mmc/host/mtk-sd.c:2765:12: error: unused function 'msdc_suspend' [-Werror,-Wunused-function] > static int msdc_suspend(struct device *dev) > drivers/mmc/host/mtk-sd.c:2779:12: error: unused function 'msdc_resume' [-Werror,-Wunused-function] > static int msdc_resume(struct device *dev) > > Remove the #ifdef and mark all four as __maybe_unused to aovid the > problem. > > Fixes: c0a2074ac575 ("mmc: mediatek: Fix system suspend/resume support for CQHCI") > Signed-off-by: Arnd Bergmann > --- > drivers/mmc/host/mtk-sd.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c > index d057fb11112a..de09c6347524 100644 > --- a/drivers/mmc/host/mtk-sd.c > +++ b/drivers/mmc/host/mtk-sd.c > @@ -2683,7 +2683,6 @@ static int msdc_drv_remove(struct platform_device *pdev) > return 0; > } > > -#ifdef CONFIG_PM > static void msdc_save_reg(struct msdc_host *host) Shouldn't msdc_save|restore_reg() be turned into "__maybe_unused" as well? > { > u32 tune_reg = host->dev_comp->pad_tune_reg; > @@ -2742,7 +2741,7 @@ static void msdc_restore_reg(struct msdc_host *host) > __msdc_enable_sdio_irq(host, 1); > } > > -static int msdc_runtime_suspend(struct device *dev) > +static int __maybe_unused msdc_runtime_suspend(struct device *dev) > { > struct mmc_host *mmc = dev_get_drvdata(dev); > struct msdc_host *host = mmc_priv(mmc); > @@ -2752,7 +2751,7 @@ static int msdc_runtime_suspend(struct device *dev) > return 0; > } > > -static int msdc_runtime_resume(struct device *dev) > +static int __maybe_unused msdc_runtime_resume(struct device *dev) > { > struct mmc_host *mmc = dev_get_drvdata(dev); > struct msdc_host *host = mmc_priv(mmc); > @@ -2762,7 +2761,7 @@ static int msdc_runtime_resume(struct device *dev) > return 0; > } > > -static int msdc_suspend(struct device *dev) > +static int __maybe_unused msdc_suspend(struct device *dev) > { > struct mmc_host *mmc = dev_get_drvdata(dev); > int ret; > @@ -2776,11 +2775,10 @@ static int msdc_suspend(struct device *dev) > return pm_runtime_force_suspend(dev); > } > > -static int msdc_resume(struct device *dev) > +static int __maybe_unused msdc_resume(struct device *dev) > { > return pm_runtime_force_resume(dev); > } > -#endif > > static const struct dev_pm_ops msdc_dev_pm_ops = { You may also change this to a __maybe_unused, as long as you also assign the .pm pointer in the mt_msdc_driver with pm_ptr(&msdc_dev_pm_ops). Ideally the compiler should drop these functions/datas entirely then. > SET_SYSTEM_SLEEP_PM_OPS(msdc_suspend, msdc_resume) > -- > 2.27.0 > Kind regards Uffe _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel