Path: csiph.com!goblin2!goblin.stu.neva.ru!aioe.org!bofh.it!news.nic.it!robomod From: Arnd Bergmann Newsgroups: linux.kernel Subject: [PATCH] gpio: xgene: mark PM functions as __maybe_unused Date: Tue, 14 Feb 2017 22:30:03 +0100 Message-ID: X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:oVZPkad1tfUaCh9OEPkDzHFoIlus7lpsffGk01d0Lb6OTUc8yQN 132wCbtTkCiTVk5oJZaXmRKZmMjcq7Ss1a7+FqPtOSrzfAPS99HgBp4dGtuKtJDDpjYxprP huOQ/KNy/NHdHJgSZHCX3hchGCSaImq4I2wa61Q8Tr2E/vURbnxP5HAaA3FulmoDDqJwbFZ EYYHZ9eL3MJsP2Eh/ePiQ== X-Ui-Out-Filterresults: notjunk:1;V01:K0:6LnBHg0mFKM=:12+70S89K0pwSXKGfc/2QV 2BSCg5u+7pfSUzql6OVjfift+LbirCJwWKVpCVcU4IHN6TmF/1mtqbbzsWSPRI3s5XB4VkQEy SDl9JBzI/wOQoo/4kE8be9/ptuxqBEobVa/qQ0tBZlQnpu6lfDRuVoOpuVqESzR4N88Otlvvg mYegHzo+Yhfey2GgbpAvcz1Yt2jthzYKnvCEwIEF7r8MBls8jNpI43pN0LST4FxKiRVY5nknZ k+KKT1N2smX54AsCyJBNIEJor9EVIkYLnoqEjgTfbwEQJA8kc+IhvFcUwtT/o+WU3trUxpx2S zPOd9Q32UJcTOVeZinh7O5XydwqoWXNxo3AMkUcIU47x0Vihzr6fgI9wo6wrYWda/1wWMLsAQ qD/JHfTOSXQvPEL1Wj2jM7iXS8CybpAF+KHmR7HM4gUkg1efPiB+4B2ZpuCjpHMM3QKLV1r4h 4d3bO1pj+m4xNbvapbO1e3clWLRZDB8lOOlPnwvvsyl+NS+J+T6btBljLGqOmXR2QMDOs5Uhq w4Sa9QQC78ffthrL43aTjR4TH6QaJ/84sz/XIFhIKjo+41VCkNWAjg60Qb8XK0vVxECeDWsyy /Do1B+KzpOxK6o0ACZD32KlghSKN0/cncn4wsuCbv/ndtSSmpO/B2tSeMKxtE/g9eH8mk1bBP A8VDNDEqdWK5hVLIsEH7bABFTwd4IZe9962AlU9Mp0XM962rVCRfWrBPeT6QoXnmkNJQ= Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 61 Organization: linux.* mail to news gateway X-Original-Cc: Arnd Bergmann , Alexandre Courbot , Duc Dang , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org X-Original-Date: Tue, 14 Feb 2017 22:20:07 +0100 X-Original-Message-ID: <20170214212032.2676656-1-arnd@arndb.de> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1580879 When CONFIG_PM_SLEEP is disabled, we get a warning about unused functions: drivers/gpio/gpio-xgene.c:155:12: warning: 'xgene_gpio_resume' defined but not used [-Wunused-function] static int xgene_gpio_resume(struct device *dev) ^~~~~~~~~~~~~~~~~ drivers/gpio/gpio-xgene.c:142:12: warning: 'xgene_gpio_suspend' defined but not used [-Wunused-function] static int xgene_gpio_suspend(struct device *dev) The warnings are harmless and can be avoided by simplifying the code and marking the functions as __maybe_unused. Signed-off-by: Arnd Bergmann --- drivers/gpio/gpio-xgene.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c index 40a8881c2ce8..1fd62bef562b 100644 --- a/drivers/gpio/gpio-xgene.c +++ b/drivers/gpio/gpio-xgene.c @@ -138,8 +138,7 @@ static int xgene_gpio_dir_out(struct gpio_chip *gc, return 0; } -#ifdef CONFIG_PM -static int xgene_gpio_suspend(struct device *dev) +static __maybe_unused int xgene_gpio_suspend(struct device *dev) { struct xgene_gpio *gpio = dev_get_drvdata(dev); unsigned long bank_offset; @@ -152,7 +151,7 @@ static int xgene_gpio_suspend(struct device *dev) return 0; } -static int xgene_gpio_resume(struct device *dev) +static __maybe_unused int xgene_gpio_resume(struct device *dev) { struct xgene_gpio *gpio = dev_get_drvdata(dev); unsigned long bank_offset; @@ -166,10 +165,6 @@ static int xgene_gpio_resume(struct device *dev) } static SIMPLE_DEV_PM_OPS(xgene_gpio_pm, xgene_gpio_suspend, xgene_gpio_resume); -#define XGENE_GPIO_PM_OPS (&xgene_gpio_pm) -#else -#define XGENE_GPIO_PM_OPS NULL -#endif static int xgene_gpio_probe(struct platform_device *pdev) { @@ -241,7 +236,7 @@ static struct platform_driver xgene_gpio_driver = { .name = "xgene-gpio", .of_match_table = xgene_gpio_of_match, .acpi_match_table = ACPI_PTR(xgene_gpio_acpi_match), - .pm = XGENE_GPIO_PM_OPS, + .pm = &xgene_gpio_pm, }, .probe = xgene_gpio_probe, }; -- 2.9.0