From patchwork Wed Nov 19 15:01:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 41173 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8FFDF20CBB for ; Wed, 19 Nov 2014 15:01:46 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id mc6sf537689lab.7 for ; Wed, 19 Nov 2014 07:01:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :reply-to:references:mime-version:content-type:content-disposition :in-reply-to:user-agent:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=bRzP5yyfVqXIont8APqEBfn00mAMZGEen5/vfDfk1/c=; b=aNett7T5qxa1ZL6iSRjd7v6VlIwIJ99TqB0L0j6A5DsSbA39F8FDgTmWuQIf9Az5Xu TSpEevMcdIyIIWV3U3rMZVkDLvXfUO/BYZanr9s1eZsz2mB81xR52JNiRH2P+ceP26PH fqKXOvvu+u9bY0JQacKqx6xGy+2rV++z7KnAvTJUs4+ZtWRQHgWGFLviZ5VBkoGEc8Rl W3iKMiKMnyp7lAQ6WcRYWgY2C/HbRmsFUwvlX0wKDapPzAIQJX92QwDmCacT4DGIJtIY LJ607mvxruQVDI0+Gz4eWDkrdAGOzMpdOcFMGVB9aDnjUrPb25ObF5xozzHKiPfkNWak 3ApA== X-Gm-Message-State: ALoCoQkBxM+FJpmnJdLrhOIXTONY3+Xd2QuVTwwDhm/x8RTtOvKQrb5Gb0cKSOOMJ7+zTbNXqku+ X-Received: by 10.195.17.134 with SMTP id ge6mr4223154wjd.2.1416409305399; Wed, 19 Nov 2014 07:01:45 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.227 with SMTP id v3ls1522017lav.91.gmail; Wed, 19 Nov 2014 07:01:45 -0800 (PST) X-Received: by 10.112.170.99 with SMTP id al3mr43308959lbc.17.1416409305142; Wed, 19 Nov 2014 07:01:45 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id cz5si2002892lac.123.2014.11.19.07.01.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Nov 2014 07:01:45 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id pn19so625637lab.40 for ; Wed, 19 Nov 2014 07:01:45 -0800 (PST) X-Received: by 10.112.45.102 with SMTP id l6mr5795740lbm.46.1416409305022; Wed, 19 Nov 2014 07:01:45 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp97458lbc; Wed, 19 Nov 2014 07:01:42 -0800 (PST) X-Received: by 10.68.91.66 with SMTP id cc2mr20331311pbb.156.1416409302167; Wed, 19 Nov 2014 07:01:42 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bj4si3047091pbc.143.2014.11.19.07.01.41 for ; Wed, 19 Nov 2014 07:01:42 -0800 (PST) Received-SPF: none (google.com: linux-usb-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755819AbaKSPBi (ORCPT + 3 others); Wed, 19 Nov 2014 10:01:38 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:36475 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755774AbaKSPBg (ORCPT ); Wed, 19 Nov 2014 10:01:36 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id sAJF1TbC020883; Wed, 19 Nov 2014 09:01:29 -0600 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id sAJF1TmJ026300; Wed, 19 Nov 2014 09:01:29 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Wed, 19 Nov 2014 09:01:29 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id sAJF1STx022542; Wed, 19 Nov 2014 09:01:29 -0600 Date: Wed, 19 Nov 2014 09:01:48 -0600 From: Felipe Balbi To: Fabio Estevam , "Rafael J. Wysocki" CC: , , , Subject: Re: [PATCH] usb: dwc2: Fix build warning when CONFIG_PM_SLEEP=n Message-ID: <20141119150148.GA5202@saruman> Reply-To: References: <1416407873-18166-1-git-send-email-fabio.estevam@freescale.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1416407873-18166-1-git-send-email-fabio.estevam@freescale.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , HI, On Wed, Nov 19, 2014 at 12:37:53PM -0200, Fabio Estevam wrote: > Building with bcm2835_defconfig, which has CONFIG_PM_SLEEP=n causes the > following build warning: > > drivers/usb/dwc2/platform.c:227:12: warning: 'dwc2_suspend' defined but not used [-Wunused-function] > drivers/usb/dwc2/platform.c:237:12: warning: 'dwc2_resume' defined but not used [-Wunused-function] > > Annotate these functions with '__maybe_unused' to prevent the warnings. > > Reported-by: Olof's autobuilder > Signed-off-by: Fabio Estevam > --- > drivers/usb/dwc2/platform.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c > index 57eb8a3..ff0ed0b 100644 > --- a/drivers/usb/dwc2/platform.c > +++ b/drivers/usb/dwc2/platform.c > @@ -224,7 +224,7 @@ static int dwc2_driver_probe(struct platform_device *dev) > return retval; > } > > -static int dwc2_suspend(struct device *dev) > +static int __maybe_unused dwc2_suspend(struct device *dev) that SET_SYSTEM_SLEEP_PM_OPS again. Rafael, do you mind taking a patch like below: nobody will ever build a kernel without CONFIG_PM or any of its friends anyway and all that ifdeferry or __maybe_unused just to silence compilers warnings are very annoying. diff --git a/include/linux/pm.h b/include/linux/pm.h index 383fd68..928e295 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -318,7 +318,6 @@ struct dev_pm_ops { int (*runtime_idle)(struct device *dev); }; -#ifdef CONFIG_PM_SLEEP #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ .suspend = suspend_fn, \ .resume = resume_fn, \ @@ -326,11 +325,7 @@ struct dev_pm_ops { .thaw = resume_fn, \ .poweroff = suspend_fn, \ .restore = resume_fn, -#else -#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) -#endif -#ifdef CONFIG_PM_SLEEP #define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ .suspend_late = suspend_fn, \ .resume_early = resume_fn, \ @@ -338,27 +333,16 @@ struct dev_pm_ops { .thaw_early = resume_fn, \ .poweroff_late = suspend_fn, \ .restore_early = resume_fn, -#else -#define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) -#endif -#ifdef CONFIG_PM_RUNTIME #define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ .runtime_suspend = suspend_fn, \ .runtime_resume = resume_fn, \ .runtime_idle = idle_fn, -#else -#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) -#endif -#ifdef CONFIG_PM #define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ .runtime_suspend = suspend_fn, \ .runtime_resume = resume_fn, \ .runtime_idle = idle_fn, -#else -#define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) -#endif /* * Use this if you want to use the same suspend and resume callbacks for suspend