From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: [PATCH] thermal: tegra: mark PM functions __maybe_unused Date: Sat, 16 Apr 2016 22:19:33 +0200 Message-ID: <1460838026-1242452-1-git-send-email-arnd@arndb.de> Return-path: Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Eduardo Valentin , Wei Ni Cc: Arnd Bergmann , Zhang Rui , Stephen Warren , Thierry Reding , Alexandre Courbot , linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-tegra@vger.kernel.org After the PM support has been added to this driver, we get a harmless warning when that support is disabled at compile time: drivers/thermal/tegra/soctherm.c:641:12: error: 'soctherm_resume' defined but not used [-Werror=unused-function] static int soctherm_resume(struct device *dev) This marks the two PM functions as __maybe_unused to shut up the warning. This is preferred over adding an #ifdef around them, as it is harder to get wrong, and provides better compile-time coverage. Signed-off-by: Arnd Bergmann Fixes: a134b4143b65 ("thermal: tegra: add PM support") --- drivers/thermal/tegra/soctherm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c index 559c74279eb8..be829d6e131c 100644 --- a/drivers/thermal/tegra/soctherm.c +++ b/drivers/thermal/tegra/soctherm.c @@ -629,7 +629,7 @@ static int tegra_soctherm_remove(struct platform_device *pdev) return 0; } -static int soctherm_suspend(struct device *dev) +static int __maybe_unused soctherm_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); @@ -638,7 +638,7 @@ static int soctherm_suspend(struct device *dev) return 0; } -static int soctherm_resume(struct device *dev) +static int __maybe_unused soctherm_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct tegra_soctherm *tegra = platform_get_drvdata(pdev); -- 2.7.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752030AbcDPUUp (ORCPT ); Sat, 16 Apr 2016 16:20:45 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:55398 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751574AbcDPUUn (ORCPT ); Sat, 16 Apr 2016 16:20:43 -0400 From: Arnd Bergmann To: Eduardo Valentin , Wei Ni Cc: Arnd Bergmann , Zhang Rui , Stephen Warren , Thierry Reding , Alexandre Courbot , linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] thermal: tegra: mark PM functions __maybe_unused Date: Sat, 16 Apr 2016 22:19:33 +0200 Message-Id: <1460838026-1242452-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:5egZPNho0y7o/qbJ9YarbW8PuwF8+1NkfE7yp6D69HDhHraYoU4 xMAT2DcQoC7h/mVhcVT1dwQyilHVPXUYr8f3a9/DObPlnGXnkWkQEN5H/G3B6ZTKLmm9CDC M6iWnBvjXZDPR/mtuuyqrJYAglOMQCpriM95CttSsewzdY9sdLYSrdN9o0ZWMG2Ueut/1lZ r/2hTFhpGw2k/OVVR9eKA== X-UI-Out-Filterresults: notjunk:1;V01:K0:/x9im3k0psw=:PsqQk0BKsjoCYRNIJ3W/Wt nRXJe4QAJ0fc7RQI07DajVWvfyS7l8yqNCvQ1RQ/yom+fdpNp+HdtUJQExJM7uldCp3QQXBdj sOPleqlBKZBJATlcenyCp60WSOPCwWaV8+nUjDK2A81AQjOrT0+diiMsgIi9ynpkaxPIqqcEf Z0RzqFQw8lpioUoZZT59K7PJ9DE12//nwmXRF2+EIkQ4xG8AIMBvmuutC8KbIcG/6gA+8kKkb Mhk14lDXVvewvrVtIFZbpxZcepqDrnHAzqxtA6WQnGGM4sPlApD/ogtVjhyQJph1BHUMl4KO2 f7S8a4MdYCT3COYADT2NXeSfNqe3n36WEQTVW/YrdP7G9hQvIi1xaD1yEXJRVOUMTZNvEPuvd XbNTtZTvBkW5RgLKhiXkN/L0+JdRoTVTPnpW6egJx4g9WW9YUcgRWpscwYFCp30Uh/D0BWsPL wdZQIJOP21p8ePOpcWdO7Bqfp/SeIlwBwzPx16fQsP9NQsQIdiCJbDVgJlcAtJvXxJhb065cV 4zAhdCc4IX7HVnQShj8b7F6VQYm6aLvv7L0JzBVzuN+9v/4wAYCo3YYQOxSpkq9Zp1ttZp7CG IrQPphVXIU+n4pf1WXWlaSN2CgJy1lFA44c2W089H5MRzTiygHCIc/7Kyl3JCoiC8X1vMjqh5 ptykL7DDr+5Ex92kZ+5HPrVJ5y0lS82yZLfAdFkAmwmkGGFOcmIVkgY1LdAmC1EP0cFY= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After the PM support has been added to this driver, we get a harmless warning when that support is disabled at compile time: drivers/thermal/tegra/soctherm.c:641:12: error: 'soctherm_resume' defined but not used [-Werror=unused-function] static int soctherm_resume(struct device *dev) This marks the two PM functions as __maybe_unused to shut up the warning. This is preferred over adding an #ifdef around them, as it is harder to get wrong, and provides better compile-time coverage. Signed-off-by: Arnd Bergmann Fixes: a134b4143b65 ("thermal: tegra: add PM support") --- drivers/thermal/tegra/soctherm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c index 559c74279eb8..be829d6e131c 100644 --- a/drivers/thermal/tegra/soctherm.c +++ b/drivers/thermal/tegra/soctherm.c @@ -629,7 +629,7 @@ static int tegra_soctherm_remove(struct platform_device *pdev) return 0; } -static int soctherm_suspend(struct device *dev) +static int __maybe_unused soctherm_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); @@ -638,7 +638,7 @@ static int soctherm_suspend(struct device *dev) return 0; } -static int soctherm_resume(struct device *dev) +static int __maybe_unused soctherm_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct tegra_soctherm *tegra = platform_get_drvdata(pdev); -- 2.7.0