From patchwork Thu Dec 29 12:01:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 9491169 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C830060838 for ; Thu, 29 Dec 2016 12:02:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C43E11FF1D for ; Thu, 29 Dec 2016 12:02:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B922725250; Thu, 29 Dec 2016 12:02:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 668621FF1D for ; Thu, 29 Dec 2016 12:02:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752582AbcL2MBp (ORCPT ); Thu, 29 Dec 2016 07:01:45 -0500 Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:43642 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752562AbcL2MBp (ORCPT ); Thu, 29 Dec 2016 07:01:45 -0500 Received: from valkosipuli.retiisi.org.uk (valkosipuli.retiisi.org.uk [IPv6:2001:1bc8:1a6:d3d5::80:2]) by hillosipuli.retiisi.org.uk (Postfix) with ESMTP id D538260097; Thu, 29 Dec 2016 14:01:38 +0200 (EET) Received: by valkosipuli.retiisi.org.uk (Postfix, from userid 1000) id 8115B2034F; Thu, 29 Dec 2016 14:01:37 +0200 (EET) Date: Thu, 29 Dec 2016 14:01:37 +0200 From: Sakari Ailus To: Augusto Mecking Caringi Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [media] smiapp: Fix build warnings when !CONFIG_PM_SLEEP Message-ID: <20161229120137.GB3958@valkosipuli.retiisi.org.uk> References: <1483011924-10787-1-git-send-email-augustocaringi@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1483011924-10787-1-git-send-email-augustocaringi@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Augusto, On Thu, Dec 29, 2016 at 11:45:07AM +0000, Augusto Mecking Caringi wrote: > Fix the following build warnings when CONFIG_PM is set but > CONFIG_PM_SLEEP is not: > > drivers/media/i2c/smiapp/smiapp-core.c:2746:12: warning: > ‘smiapp_suspend’ defined but not used [-Wunused-function] > static int smiapp_suspend(struct device *dev) > ^ > drivers/media/i2c/smiapp/smiapp-core.c:2771:12: warning: ‘smiapp_resume’ > defined but not used [-Wunused-function] > static int smiapp_resume(struct device *dev) > ^ > > Signed-off-by: Augusto Mecking Caringi Thanks for the patch. I believe this is already fixed by the following patch: commit 4bfb934b0067b7f6a24470682c5f7254fd4d8282 Author: Sakari Ailus Date: Sat Nov 19 19:50:10 2016 -0200 [media] smiapp: Make suspend and resume functions __maybe_unused The smiapp_suspend() and smiapp_resume() functions will end up being unused if CONFIG_PM is enabled but CONFIG_PM_SLEEP is disabled, causing a compiler warning from both of the function definitions. Fix this by marking the functions with __maybe_unused. Suggested-by: Arnd Bergmann Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index 620f8ce..f4e92bd 100644 --- a/drivers/media/i2c/smiapp/smiapp-core.c +++ b/drivers/media/i2c/smiapp/smiapp-core.c @@ -2741,7 +2741,7 @@ static const struct v4l2_subdev_internal_ops smiapp_internal_ops = { * I2C Driver */ -static int smiapp_suspend(struct device *dev) +static int __maybe_unused smiapp_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct v4l2_subdev *subdev = i2c_get_clientdata(client); @@ -2766,7 +2766,7 @@ static int smiapp_suspend(struct device *dev) return 0; } -static int smiapp_resume(struct device *dev) +static int __maybe_unused smiapp_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct v4l2_subdev *subdev = i2c_get_clientdata(client);