From patchwork Wed Mar 11 21:08:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 5988811 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 23CA79F399 for ; Wed, 11 Mar 2015 21:08:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45531203A0 for ; Wed, 11 Mar 2015 21:08:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 671D620396 for ; Wed, 11 Mar 2015 21:08:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751789AbbCKVIq (ORCPT ); Wed, 11 Mar 2015 17:08:46 -0400 Received: from mail-ie0-f171.google.com ([209.85.223.171]:35041 "EHLO mail-ie0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751742AbbCKVIp (ORCPT ); Wed, 11 Mar 2015 17:08:45 -0400 Received: by ieclw3 with SMTP id lw3so6427056iec.2; Wed, 11 Mar 2015 14:08:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=0D0+jjZIqb0saItR8JjSlItlleEGNYxU8YuGl4pkbHo=; b=CYCNEZT5n6jcGKE9ykECJuJk5Rx3RHHlP0gMhyfpr/0AkMPCP3UNzTa4vQDx5tSAtR kgRo+JvEWIaNbG56LyCtGkw5W09BDSQ1Q9N6VJGfe1S62WN8EjmVqch8Um7s1q2acmkc sK01l+Sym9xBJD8FjATa0wRVjUDWanNuyVAkdjPm+ZIiEIxzh1U015Oft8q85T4C/w64 Kws3eOKAu/LQXfOIBlX27d7xyndX2elApCSns+dnZAOWKBK+Xz/fiv2wjinoJNfAuPkr 6d9cIvTtq4Fk3TaZ8yTPzD1tAOiyHP4eZsufaQxUnckj0c4HGNnY9emkkjpc4aRoW+dA og1Q== X-Received: by 10.42.247.68 with SMTP id mb4mr43910489icb.2.1426108120967; Wed, 11 Mar 2015 14:08:40 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1301:d499:deb3:5bf6:e8c1]) by mx.google.com with ESMTPSA id p76sm3142736iop.14.2015.03.11.14.08.38 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 11 Mar 2015 14:08:39 -0700 (PDT) Date: Wed, 11 Mar 2015 14:08:36 -0700 From: Dmitry Torokhov To: Herbert Xu Cc: Deepak Saxena , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH] hwrng: omap - remove #ifdefery around PM methods Message-ID: <20150311210836.GA8253@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of using #ifdefs let's mark suspend and resume methods as __maybe_unused which will suppress compiler warnings about them being unused and provide better compile coverage. Because SIMPLE_DEV_PM_OPS() produces an empty omap_rng_pm structure in case of !CONFIG_PM_SLEEP neither omap_rng_suspend nor omap_rng_resume will end up being referenced and the change will not result in increasing image size. Signed-off-by: Dmitry Torokhov --- drivers/char/hw_random/omap-rng.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c index 7f3597d..5c171b1 100644 --- a/drivers/char/hw_random/omap-rng.c +++ b/drivers/char/hw_random/omap-rng.c @@ -422,9 +422,7 @@ static int omap_rng_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP - -static int omap_rng_suspend(struct device *dev) +static int __maybe_unused omap_rng_suspend(struct device *dev) { struct omap_rng_dev *priv = dev_get_drvdata(dev); @@ -434,7 +432,7 @@ static int omap_rng_suspend(struct device *dev) return 0; } -static int omap_rng_resume(struct device *dev) +static int __maybe_unused omap_rng_resume(struct device *dev) { struct omap_rng_dev *priv = dev_get_drvdata(dev); @@ -445,18 +443,11 @@ static int omap_rng_resume(struct device *dev) } static SIMPLE_DEV_PM_OPS(omap_rng_pm, omap_rng_suspend, omap_rng_resume); -#define OMAP_RNG_PM (&omap_rng_pm) - -#else - -#define OMAP_RNG_PM NULL - -#endif static struct platform_driver omap_rng_driver = { .driver = { .name = "omap_rng", - .pm = OMAP_RNG_PM, + .pm = &omap_rng_pm, .of_match_table = of_match_ptr(omap_rng_of_match), }, .probe = omap_rng_probe,