Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1083379rwb; Wed, 7 Dec 2022 08:25:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf4jkYdv3AFwBlAjquFIoyN4W6JfWKYt8K/o7FNCXvFYBc8Wzd05XWHKyfIuqRttgJKbm3vI X-Received: by 2002:a17:902:8212:b0:186:85c3:98b7 with SMTP id x18-20020a170902821200b0018685c398b7mr76339151pln.31.1670430327845; Wed, 07 Dec 2022 08:25:27 -0800 (PST) Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a15-20020a170902b58f00b001822121c45fsi19976396pls.338.2022.12.07.08.25.17; Wed, 07 Dec 2022 08:25:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UadcctOF; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229850AbiLGP4l (ORCPT + 76 others); Wed, 7 Dec 2022 10:56:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229603AbiLGP4j (ORCPT ); Wed, 7 Dec 2022 10:56:39 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5190F2A426 for ; Wed, 7 Dec 2022 07:56:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670428598; x=1701964598; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=bkMdDuwr4QpYByzPrOwlRs7asuasHFf2FgUtHEkeqYg=; b=UadcctOFYrEReOH7v+VzXLyGHDTvWJGNerld4RJc+htK0yYvtHucaxg3 5GOVtLQQp62Yp5rjNpv+FImMHOpjaiXiZgQRNDiRBi0RjdutPrlgchsan Cl4kbVQRWCsILytwiYiynMMKGRkYUGVgpfid6N1qGEx/HKtxd09GwyqRb ZBd3p3xG6Q3ZrLKOuNlTUrJKcSF9A7md4XwdYo0FqP7zUucri0Ue7IRHf e70hDFWpE4JiXL5TrFgrttMl7aBix/WvkrnPCXjuaChTLoH2jsNRb61i2 c9KEtYuuDFuE0PnCvR3YX1c2J4kL3+pVtCJwdu5dFJqCeFblmNLUaB1fb A==; X-IronPort-AV: E=McAfee;i="6500,9779,10554"; a="297278191" X-IronPort-AV: E=Sophos;i="5.96,225,1665471600"; d="scan'208";a="297278191" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2022 07:56:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10554"; a="646652581" X-IronPort-AV: E=Sophos;i="5.96,225,1665471600"; d="scan'208";a="646652581" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga002.jf.intel.com with ESMTP; 07 Dec 2022 07:56:32 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 7 Dec 2022 07:56:31 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Wed, 7 Dec 2022 07:56:31 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.176) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Wed, 7 Dec 2022 07:56:31 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g0Hl0a4W6d5N9c9C3XqFKWjof4qpTVXpV39dU5wcCoVRxgnzHj2/R5TbUuFR3Id1MEmOX4D3ITnND/worM/6PB7tOo4vBKAHj3nreTkpAKxP1g00jvtQz1nYgy/sg13nG5wzyA80W77n4IJVFDsM/rRAaKu+5IQ+qgqiwyTQaq0GRohORhIdVkWqLCFK4qTGJjknVlS08LzINhFq1YqDx2jThHBRzHtCD6zOCvExgl7O2DqAM8LdRl/xk49pFpUCb4gQL4PG3F4E3oODMpAlp6hRhosUd5JFoI0JtxELBTQ6jvwyJKn2mDADXbEiAJHEQfKd27Eycuja00tbuNEiAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Du2E8Aqw3DGa4/YFP/8GgX85qdDM9OOQXzjHrFXyduc=; b=g7e0QraxKc6rJUTJCSiB9zDWjjOFO/N4KiHVPaQ+I4QCmIaqNoFJgiS0wPvQMoBzrhVQjrB9+argvrGukHFQ957y/R3H87aAYp/tq4MhxIhdFdCDBYgvya4X9xhjphdVTaZuHjiC+AQp+pIXgn11UFp2yEluPtVZv7sMssr7MCgrApoa0r44RWsGIFeDNksj7Il1A5xvzvzWrLDOk98P0veGs7/4TYyPKVX5H0CXT4hfwBrP3+QTHvm1KFsX1ApT2m9N1aYsT9RkWOHuuxTHyr9zRb345ooRprWaV+0o+iy/VJGBG/cyTcgKtWjF5aywXEz0n/EtcyIcOCxPtCmt7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MN0PR11MB6059.namprd11.prod.outlook.com (2603:10b6:208:377::9) by SN7PR11MB6898.namprd11.prod.outlook.com (2603:10b6:806:2a6::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Wed, 7 Dec 2022 15:56:29 +0000 Received: from MN0PR11MB6059.namprd11.prod.outlook.com ([fe80::499c:efe3:4397:808]) by MN0PR11MB6059.namprd11.prod.outlook.com ([fe80::499c:efe3:4397:808%9]) with mapi id 15.20.5880.014; Wed, 7 Dec 2022 15:56:29 +0000 Date: Wed, 7 Dec 2022 10:56:25 -0500 From: Rodrigo Vivi To: Paul Cercueil CC: David Airlie , Daniel Vetter , , , Subject: Re: [Intel-gfx] [PATCH v2 26/26] drm/i915/gt: Remove #ifdef guards for PM related functions Message-ID: References: <20221129191733.137897-1-paul@crapouillou.net> <20221129191942.138244-1-paul@crapouillou.net> <20221129191942.138244-13-paul@crapouillou.net> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20221129191942.138244-13-paul@crapouillou.net> X-ClientProxiedBy: SJ0PR13CA0099.namprd13.prod.outlook.com (2603:10b6:a03:2c5::14) To MN0PR11MB6059.namprd11.prod.outlook.com (2603:10b6:208:377::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR11MB6059:EE_|SN7PR11MB6898:EE_ X-MS-Office365-Filtering-Correlation-Id: 04f73dec-0b44-4a1d-efb0-08dad86b9aa5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Nz9CKdncZwrsv3rS6F5AUDU+GIVTmw5lGsnda5CBExgV625OQH5dMHNF5rPo2xKFz8V2djhhWLcGujtZQ7LRq9Wr7KD975RwDl/Br4yT2420myz9JlAQlDfONYUCdNKl8KmWNPa5aXZAOqogngHP97aVnWqH0fjPTuddFOs4ua/LtRfAr0dZxkFKRuh66j5qAvbMNRAeODkgScYchcxE3BxPsaxkL/e/vqc7KTd0SeO0E8WHsa6oQAd3FblMxXxD2fUlu45+InY3uh3xdsUNHaMESbO8GCWN0vZ/zfXZwhDhnobTB86AwJv2t+eo11unukcF3vEOXzGjA2B8q+VDdi+yiPAys7ZDuGfqofBNaBtLBSxH5rAFj1rDJ+xXEVjjmLl3J0aO9sfA0nVJB5gzr2fV+1pk7Q43MDJTFUNieBxO+QYXZ0aN9dyc11ZohjHtc8vovnl/p+2YoeKV2gMkAiGkpsigkxxFY9bO93AKV5lZWuN8HZz4E0aFXRrIqu0WOi5BPjEZLF3i9H8BWZYuSRR2cdOKR2DeWGSB5eUzyrUcxHkzAKadxFL27EJMcERWMwADSt19ziX7nnvxhZNvRfkH7goPP+1GqqL/+1aAx33J6yrkgYoi+m3skMU+tzZPhIzX/eeMXDoD7oPF3zoF7w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR11MB6059.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(346002)(396003)(136003)(376002)(366004)(39860400002)(451199015)(6916009)(186003)(6666004)(6512007)(316002)(54906003)(8676002)(38100700002)(6506007)(4326008)(478600001)(2906002)(36756003)(66946007)(66556008)(6486002)(82960400001)(86362001)(66476007)(83380400001)(8936002)(41300700001)(2616005)(44832011)(26005)(5660300002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ke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LUM?= =?us-ascii?Q?h689hiLtrb50NLOeA3jmbMrk9Uqso6O8UYBTCNC2GtvxjaTSNAizykdFDpx7?= =?us-ascii?Q?5dzh7GiEiYzDIBYi+4954Ro0S0uOVvRbeKtHLL+QegHP0zOqR4rfhFUsfL6F?= =?us-ascii?Q?up8sVTJhO1M2pA/fb34bi7RMBuPJnELhcbq851Xtc0pk3/OfkmDa/Qip3WyV?= =?us-ascii?Q?pfPqjFCLD3XQEHO/iZz0NYBtlTX16sCPC6mMu5mXR7IGDNFF27m6VYx0udJL?= =?us-ascii?Q?nss8rVzR1wwZWtEuQdawwLXBmsi/8T7DVRNTU5EhEI/zwAWTNSAMrRS9fyS1?= =?us-ascii?Q?+zTs9eMy5J3cAe+SnVm6QI97RJneZVv4ClbEQLvRNmv0kxPJsN6tCXl/yUJ8?= =?us-ascii?Q?S2M5O3bihtiEqMGdOeXCcOa1xCXfWvN+GW3VMvi1bbeliCWDAywsDY4jgO5y?= =?us-ascii?Q?wkQvTOzGeI5Sb29DGN/LAvHYkJ6MNONwt/iBwbQq9NpzfFvEckN9rJEw2IbJ?= =?us-ascii?Q?hBnG6qEGhRIdwPLW+HjrInuOVn/8TgZW40W2TqkzUIdodZIfeJlrJVusO+/w?= =?us-ascii?Q?XjJw/WHOgc4Igf/Dussrrs0zckpSufjjzdNSaVt0vnl2EE8I4IGL/Y2rNaRi?= =?us-ascii?Q?SuMvW0sYSedqTNfTiiZWwYXsR+2ZDIT9ii0I9ng39U6gVWX1v7tk9e24t+1U?= =?us-ascii?Q?0xy7VNQmdzu5DILKophAI4puUnsHwezgZymTGjaDynPynA437KSMIxpuoebe?= =?us-ascii?Q?+Q=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 04f73dec-0b44-4a1d-efb0-08dad86b9aa5 X-MS-Exchange-CrossTenant-AuthSource: MN0PR11MB6059.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2022 15:56:29.7918 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: q/xWKYxQ8xLSp3L3Y3I226S4mj26AGnJaf2AnoJCMBV3qRahBP4yAbIMhfjHj8+msaLVVJmVOp1MUG2GAFmPFw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB6898 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 29, 2022 at 07:19:42PM +0000, Paul Cercueil wrote: > Instead of defining two versions of intel_sysfs_rc6_init(), one for each > value of CONFIG_PM, add a check on !IS_ENABLED(CONFIG_PM) early in the > function. This will allow the compiler to automatically drop the dead > code when CONFIG_PM is disabled, without having to use #ifdef guards. > > This has the advantage of always compiling these functions in, > independently of any Kconfig option. Thanks to that, bugs and other > regressions are subsequently easier to catch. > > Signed-off-by: Paul Cercueil > --- > Cc: Jani Nikula > Cc: Joonas Lahtinen > Cc: Rodrigo Vivi Reviewed-by: Rodrigo Vivi > Cc: Tvrtko Ursulin > Cc: intel-gfx@lists.freedesktop.org > --- > drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c > index cf71305ad586..09b9365ededd 100644 > --- a/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c > +++ b/drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c > @@ -164,7 +164,6 @@ sysfs_gt_attribute_r_func(struct kobject *kobj, struct attribute *attr, > NULL); \ > INTEL_GT_ATTR_RO(_name) > > -#ifdef CONFIG_PM > static u32 get_residency(struct intel_gt *gt, enum intel_rc6_res_type id) > { > intel_wakeref_t wakeref; > @@ -300,7 +299,7 @@ static void intel_sysfs_rc6_init(struct intel_gt *gt, struct kobject *kobj) > { > int ret; > > - if (!HAS_RC6(gt->i915)) > + if (!IS_ENABLED(CONFIG_PM) || !HAS_RC6(gt->i915)) > return; > > ret = __intel_gt_sysfs_create_group(kobj, rc6_attr_group); > @@ -329,11 +328,6 @@ static void intel_sysfs_rc6_init(struct intel_gt *gt, struct kobject *kobj) > gt->info.id, ERR_PTR(ret)); > } > } > -#else > -static void intel_sysfs_rc6_init(struct intel_gt *gt, struct kobject *kobj) > -{ > -} > -#endif /* CONFIG_PM */ > > static u32 __act_freq_mhz_show(struct intel_gt *gt) > { > -- > 2.35.1 >