Received: by 10.223.185.116 with SMTP id b49csp1129018wrg; Fri, 23 Feb 2018 12:26:30 -0800 (PST) X-Google-Smtp-Source: AH8x227Faxs1S7wgukhR7BfDo+9iZ7t6jTUj2ikPxW9hpeRZM1nixK38ki9yv/u3+H849pFcaYGg X-Received: by 2002:a17:902:f44:: with SMTP id 62-v6mr2742768ply.27.1519417590286; Fri, 23 Feb 2018 12:26:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519417590; cv=none; d=google.com; s=arc-20160816; b=FHJJfVEMdgJdYvZhagq7uk5XNGv9+1I8SgIIYV6m1WeF3J1JcPwoJs9hJnotfa7Zll HrIrDEy2Q7T0JTJf74PdkFmsY7Zb72D/RxFMMCmK7gG9uY9U7raseZwMyFn79FlJnL4C 1XCyFP38M5Z67e9hYWWcLYLuntPEBB7xUF2aQIm54VAM//CM9cyBXzMWQtRem/NSTCab cB8dqVsuZXzxgNEYqpzKMC9nma+9GGUAPa2XdUv4fV3IGEiXTPUaB8glPPBhmBb45eJT VP2AeODXikYBErviuGn95ylxSpyYnXs+n+ngnUX6rNZ8ezCjYYW41anVXt0EtgN4DI94 XKyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=tvBYzEOtrEphg7avkvYaat5BdxUEoNfSCaXZlna6cQE=; b=mAfU3sslTdlP4MbEkJ9TUFAB+94msCLaOley1PlWDech0pNKj3sElmIKLAtGYxAm82 pGrRu4LNP/qu1u29LPX/uIT14QLJ+DM0pLEzliFuIlqQTO3yFR11c/L52FAXlorJMEr5 k8DcxfS/e5MaCzmGJPCcjCRW8VZjceGEpLC6dIdktqpDuDNeCO1QMNmrO6nVec/iwysu DEIVyYHbNGbwaI1dfK+tId8T0XygAHLL6Iqw+LAce9Vjw2xBg2RaAHES5zM2h2lKu2BY 4UyeQOf0TpskwTviEnLfo7K77EHTiSux8tTU5KOP4Qx0trnv7lWAlxhFTl2b/06a9g/e x1QQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o11si1930229pgn.364.2018.02.23.12.26.15; Fri, 23 Feb 2018 12:26:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932269AbeBWSh5 (ORCPT + 99 others); Fri, 23 Feb 2018 13:37:57 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:38810 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932257AbeBWShy (ORCPT ); Fri, 23 Feb 2018 13:37:54 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 439B2BBF; Fri, 23 Feb 2018 18:37:53 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Tomi Valkeinen Subject: [PATCH 4.4 111/193] fbdev: sm712fb: avoid unused function warnings Date: Fri, 23 Feb 2018 19:25:44 +0100 Message-Id: <20180223170343.328363047@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170325.997716448@linuxfoundation.org> References: <20180223170325.997716448@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit 24ed78dc2e8b2428eccc70c3162e70d33ab448c4 upstream. The sm712fb framebuffer driver encloses the power-management functions in #ifdef CONFIG_PM, but the smtcfb_pci_suspend/resume functions are only really used when CONFIG_PM_SLEEP is also set, as a frequent gcc warning shows: fbdev/sm712fb.c:1549:12: warning: 'smtcfb_pci_suspend' defined but not used fbdev/sm712fb.c:1572:12: warning: 'smtcfb_pci_resume' defined but not used The driver also avoids using the SIMPLE_DEV_PM_OPS macro when CONFIG_PM is unset, which is redundant. This changes the driver to remove the #ifdef and instead mark the functions as __maybe_unused, which is a nicer anyway, as it provides build testing for all the code in all configurations and is harder to get wrong. Signed-off-by: Arnd Bergmann Signed-off-by: Tomi Valkeinen Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/sm712fb.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) --- a/drivers/video/fbdev/sm712fb.c +++ b/drivers/video/fbdev/sm712fb.c @@ -28,9 +28,7 @@ #include #include -#ifdef CONFIG_PM #include -#endif #include "sm712.h" @@ -1545,8 +1543,7 @@ static void smtcfb_pci_remove(struct pci pci_disable_device(pdev); } -#ifdef CONFIG_PM -static int smtcfb_pci_suspend(struct device *device) +static int __maybe_unused smtcfb_pci_suspend(struct device *device) { struct pci_dev *pdev = to_pci_dev(device); struct smtcfb_info *sfb; @@ -1569,7 +1566,7 @@ static int smtcfb_pci_suspend(struct dev return 0; } -static int smtcfb_pci_resume(struct device *device) +static int __maybe_unused smtcfb_pci_resume(struct device *device) { struct pci_dev *pdev = to_pci_dev(device); struct smtcfb_info *sfb; @@ -1610,20 +1607,13 @@ static int smtcfb_pci_resume(struct devi } static SIMPLE_DEV_PM_OPS(sm7xx_pm_ops, smtcfb_pci_suspend, smtcfb_pci_resume); -#define SM7XX_PM_OPS (&sm7xx_pm_ops) - -#else /* !CONFIG_PM */ - -#define SM7XX_PM_OPS NULL - -#endif /* !CONFIG_PM */ static struct pci_driver smtcfb_driver = { .name = "smtcfb", .id_table = smtcfb_pci_table, .probe = smtcfb_pci_probe, .remove = smtcfb_pci_remove, - .driver.pm = SM7XX_PM_OPS, + .driver.pm = &sm7xx_pm_ops, }; static int __init sm712fb_init(void)