From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sn1nam02on0103.outbound.protection.outlook.com ([104.47.36.103]:11220 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032568AbeCAPig (ORCPT ); Thu, 1 Mar 2018 10:38:36 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Arnd Bergmann , Tomi Valkeinen , Sasha Levin Subject: [added to the 4.1 stable tree] fbdev: s6e8ax0: avoid unused function warnings Date: Thu, 1 Mar 2018 15:27:29 +0000 Message-ID: <20180301152116.1486-466-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Arnd Bergmann This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit b54729b6cea7d1f46b1ed70cb7065c6bdefaa780 ] The s6e8ax0 suspend/resume functions are hidden inside of an #ifdef when CONFIG_PM is set to avoid unused function warnings, but they call some other functions that nothing else calls, and we get warnings about those: drivers/video/fbdev/exynos/s6e8ax0.c:449:13: error: 's6e8ax0_sleep_in' defi= ned but not used [-Werror=3Dunused-function] drivers/video/fbdev/exynos/s6e8ax0.c:485:13: error: 's6e8ax0_display_off' d= efined but not used [-Werror=3Dunused-function] This marks the PM functions as __maybe_unused so the compiler can silently drop them when they are not referenced. Signed-off-by: Arnd Bergmann Reviewed-by: Krzysztof Kozlowski Signed-off-by: Tomi Valkeinen Signed-off-by: Sasha Levin --- drivers/video/fbdev/exynos/s6e8ax0.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/video/fbdev/exynos/s6e8ax0.c b/drivers/video/fbdev/exy= nos/s6e8ax0.c index 95873f26e39c..de2f3e793786 100644 --- a/drivers/video/fbdev/exynos/s6e8ax0.c +++ b/drivers/video/fbdev/exynos/s6e8ax0.c @@ -829,8 +829,7 @@ static int s6e8ax0_probe(struct mipi_dsim_lcd_device *d= sim_dev) return 0; } =20 -#ifdef CONFIG_PM -static int s6e8ax0_suspend(struct mipi_dsim_lcd_device *dsim_dev) +static int __maybe_unused s6e8ax0_suspend(struct mipi_dsim_lcd_device *dsi= m_dev) { struct s6e8ax0 *lcd =3D dev_get_drvdata(&dsim_dev->dev); =20 @@ -843,7 +842,7 @@ static int s6e8ax0_suspend(struct mipi_dsim_lcd_device = *dsim_dev) return 0; } =20 -static int s6e8ax0_resume(struct mipi_dsim_lcd_device *dsim_dev) +static int __maybe_unused s6e8ax0_resume(struct mipi_dsim_lcd_device *dsim= _dev) { struct s6e8ax0 *lcd =3D dev_get_drvdata(&dsim_dev->dev); =20 @@ -855,10 +854,6 @@ static int s6e8ax0_resume(struct mipi_dsim_lcd_device = *dsim_dev) =20 return 0; } -#else -#define s6e8ax0_suspend NULL -#define s6e8ax0_resume NULL -#endif =20 static struct mipi_dsim_lcd_driver s6e8ax0_dsim_ddi_driver =3D { .name =3D "s6e8ax0", @@ -867,8 +862,8 @@ static struct mipi_dsim_lcd_driver s6e8ax0_dsim_ddi_dri= ver =3D { .power_on =3D s6e8ax0_power_on, .set_sequence =3D s6e8ax0_set_sequence, .probe =3D s6e8ax0_probe, - .suspend =3D s6e8ax0_suspend, - .resume =3D s6e8ax0_resume, + .suspend =3D IS_ENABLED(CONFIG_PM) ? s6e8ax0_suspend : NULL, + .resume =3D IS_ENABLED(CONFIG_PM) ? s6e8ax0_resume : NULL, }; =20 static int s6e8ax0_init(void) --=20 2.14.1