Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1991570ybz; Sun, 26 Apr 2020 08:42:54 -0700 (PDT) X-Google-Smtp-Source: APiQypKyqJzu+J3fPcMNzOdXl5pzzflQ8Jo/wWFZJfaBTPxEJhtml5ipDSQcYfTvTSAkH2a3RAZ/ X-Received: by 2002:a50:fb93:: with SMTP id e19mr7180790edq.72.1587915774128; Sun, 26 Apr 2020 08:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587915774; cv=none; d=google.com; s=arc-20160816; b=DqgGfnA1gwpyXNyB2DPhHizGxqWEXTKnwfxMYXEtS03TLvs1IDdjS5AUc4HDMTOTMQ Zp+J/QfaEDU9yz5Dz0I7BygRvMUI/AFS7G12ur0+/ZBsND8DzFcABJY97yqhV/wrzlsU F3c1M9AugKvzzyMqZdZeUCF33xnNdZwvx+FlQ5Vw2f1/cuM6tfnQ3R7iKsCuujBeNcre Ez2yl+1FsdLL4v2sMYZBbUFjEBlU5igEVjS99I2TMpj/XWT2bGM3kGWq45NfdRhe/gXB V4G8yIS/G/idTVfNXwx1tB9CjchIrAqYyePS2hKEfjpHiQcd5TFiHa5PZ5jDtLbRSsRr OYUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=sTsRjofJ6c2Tb0CVoG/TsJ9aB5CbDyCSAbMHYL487uo=; b=A+L4itcf+0IkVx7BYW5sHMyTJEdMQhb7JbGEsPrOYzbTWr65Q2skZWSFGAx5jGzOSD kWBNNUCVQFcpGrswR6UYEZHws5hbZlM38oSKE80eGFOJMtTows5eBJ4M3um9a6ymb916 09xf51lR0RWwnq7LFBnLECRm8Kqhq5ZYLVAKOXoAQZlvU+qUGmjVdk7CP5xkbzFbOxLp ac0xsEkqgyjM+72nu7awxMHUi756CBKQgicSxztZvR+Hdbw+hapd1usyUylLhpxCsTKf Te9wktZXZiSIx5gJiHQlwusPyrbssyMIhHVN3VNc9K1oij/C9zIx5EWiIEbfQREXlEje ztuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a19si6536565edr.254.2020.04.26.08.42.30; Sun, 26 Apr 2020 08:42:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726189AbgDZPkq (ORCPT + 99 others); Sun, 26 Apr 2020 11:40:46 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:50700 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726143AbgDZPkp (ORCPT ); Sun, 26 Apr 2020 11:40:45 -0400 Received: from 185.80.35.16 (185.80.35.16) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.415) id 0e8da9b97d105e2b; Sun, 26 Apr 2020 17:40:43 +0200 From: "Rafael J. Wysocki" To: Paul Cercueil Cc: Ulf Hansson , Pavel Machek , Len Brown , od@zcrc.me, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH v2 1/3] PM: introduce pm_ptr() macro Date: Sun, 26 Apr 2020 17:40:43 +0200 Message-ID: <2708095.iQXV2FnTNx@kreacher> In-Reply-To: <20200413123207.74552-1-paul@crapouillou.net> References: <20200413123207.74552-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, April 13, 2020 2:32:05 PM CEST Paul Cercueil wrote: > This macro is analogous to the infamous of_match_ptr(). If CONFIG_PM > is enabled, this macro will resolve to its argument, otherwise to NULL. Well, this is going to result in quite a bit of unused code being added to the kernels built with CONFIG_PM unset. Is there any way to avoid that somehow? > Signed-off-by: Paul Cercueil > --- > > Notes: > v2: Remove pm_sleep_ptr() macro > > include/linux/pm.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/include/linux/pm.h b/include/linux/pm.h > index e057d1fa2469..1c0eec06905d 100644 > --- a/include/linux/pm.h > +++ b/include/linux/pm.h > @@ -374,6 +374,12 @@ const struct dev_pm_ops name = { \ > SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ > } > > +#ifdef CONFIG_PM > +#define pm_ptr(_ptr) (_ptr) > +#else > +#define pm_ptr(_ptr) NULL > +#endif > + > /* > * PM_EVENT_ messages > * >