From patchwork Mon Mar 20 09:47:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9633621 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 654376020B for ; Mon, 20 Mar 2017 09:53:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D71C27A98 for ; Mon, 20 Mar 2017 09:53:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5181C2810E; Mon, 20 Mar 2017 09:53:44 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 0562C27A98 for ; Mon, 20 Mar 2017 09:53:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752940AbdCTJvM (ORCPT ); Mon, 20 Mar 2017 05:51:12 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:52330 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753406AbdCTJu2 (ORCPT ); Mon, 20 Mar 2017 05:50:28 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0MNcni-1crZwp3gtu-007AOM; Mon, 20 Mar 2017 10:48:42 +0100 From: Arnd Bergmann To: Rick Chang , Bin Liu , Mauro Carvalho Chehab Cc: Arnd Bergmann , Matthias Brugger , Minghsiu Tsai , Ricky Liang , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] [media] vcodec: mediatek: mark pm functions as __maybe_unused Date: Mon, 20 Mar 2017 10:47:55 +0100 Message-Id: <20170320094812.1365229-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170320094812.1365229-1-arnd@arndb.de> References: <20170320094812.1365229-1-arnd@arndb.de> X-Provags-ID: V03:K0:g/Nyuin6Kq1gLXpESeInO5CvRjqbv1TbP2o3Udb7y64hZzgybLa lZE5lfxEszLwW99atooZIC6dMopQngs7pCyHcI+qU/4WCm2u5rlXDnef9BHokT3vWD0xD9C fIa1l6mA+4erC3Kqukg8WhBv32lB6awp0NH/KcjUCJ/C+DNFQd7so6IJdAWZ2gUXuWz33L2 SJ97rxk7dMnxiMVj5GQZw== X-UI-Out-Filterresults: notjunk:1; V01:K0:/RLPK+P9ZLk=:7qieO08GCnr/6a+nE0hDD1 +RwvI62AYaYXnPzubxWXHWKWnKziS1vTGGK5V2x/MJ3OBhZj/kEb+K0/JWQ3F9aHnjEASHRCn gGTWirbdNExvv/TrGVq5BjmhNZBuv6obiuzM8s9ipyXnuFXlGDnsgFuortlG4ba0DMgQGmVac 8gBholZNHrO+2qmnpa2HvF/4giX9+xpXAZn1XqAk0t7SJTN2f1JRuJLf2VmMvpjGb4urQ8ctg wjBF2sY6gFf/BdBpVMGyfjuTfq9d9cV7/PpJhEvGwWCRIsMkDdVIvKjEG7nYAjoaBY5GUsaHM xWCOYSs+8RZqAUjRfE5E8sGY67qHxJwXVe4KNrFWldStpMhVa3MsG9x85Dh4qTYllSa4QLVQY QKUFcQ7hGno8xGnQ3OHNpF72Mi7mhTghwSQii+HB+gg0kevlOuwlteVD5vzpwEZRCmIqZ5Eew 05stAlodQ6s5ROWN01U3jozDRt+mcXzcgALF/0fhaDmvNWmS9kudoQLr5qQqgICSzsjvtuG4V pQjTGtlPX0HjZ88LPNuYZTBTJ/pNHXf4ILU5DK8p3l1fonhLnTL0UczpIZ/UXWz3E0PO4Azkb R88h/GmyXuRUStjg7MNGDEy0TEae2I698t3ollBX2eaGi/s0T7XeXOf5DB4TU6NbyDV85b5lu BYCo1mPNH2ti6zaIPW79uWHaDC0nuOq9OjZSw6vY+5TcR2Vocn9k0cniVWcu3CBc6wA4= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When CONFIG_PM is disabled, we get a couple of unused functions: drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c:927:13: error: 'mtk_jpeg_clk_off' defined but not used [-Werror=unused-function] static void mtk_jpeg_clk_off(struct mtk_jpeg_dev *jpeg) ^~~~~~~~~~~~~~~~ drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c:916:13: error: 'mtk_jpeg_clk_on' defined but not used [-Werror=unused-function] static void mtk_jpeg_clk_on(struct mtk_jpeg_dev *jpeg) Rather than adding more error-prone #ifdefs around those, this patch removes the existing #ifdef checks and marks the PM functions as __maybe_unused to let gcc do the right thing. Signed-off-by: Arnd Bergmann Acked-by: Rick Chang --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c index f9bd58ce7d32..7103b6da25d2 100644 --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c @@ -1224,8 +1224,7 @@ static int mtk_jpeg_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM -static int mtk_jpeg_pm_suspend(struct device *dev) +static __maybe_unused int mtk_jpeg_pm_suspend(struct device *dev) { struct mtk_jpeg_dev *jpeg = dev_get_drvdata(dev); @@ -1235,7 +1234,7 @@ static int mtk_jpeg_pm_suspend(struct device *dev) return 0; } -static int mtk_jpeg_pm_resume(struct device *dev) +static __maybe_unused int mtk_jpeg_pm_resume(struct device *dev) { struct mtk_jpeg_dev *jpeg = dev_get_drvdata(dev); @@ -1244,10 +1243,8 @@ static int mtk_jpeg_pm_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM */ -#ifdef CONFIG_PM_SLEEP -static int mtk_jpeg_suspend(struct device *dev) +static __maybe_unused int mtk_jpeg_suspend(struct device *dev) { int ret; @@ -1258,7 +1255,7 @@ static int mtk_jpeg_suspend(struct device *dev) return ret; } -static int mtk_jpeg_resume(struct device *dev) +static __maybe_unused int mtk_jpeg_resume(struct device *dev) { int ret; @@ -1269,7 +1266,6 @@ static int mtk_jpeg_resume(struct device *dev) return ret; } -#endif /* CONFIG_PM_SLEEP */ static const struct dev_pm_ops mtk_jpeg_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(mtk_jpeg_suspend, mtk_jpeg_resume)