From nobody Sun Feb 8 04:38:34 2026 Received: from SA9PR02CU001.outbound.protection.outlook.com (mail-southcentralusazon11013057.outbound.protection.outlook.com [40.93.196.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE5D32D1911; Wed, 12 Nov 2025 20:51:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.196.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762980693; cv=fail; b=gCQKlQORAgFBAIDg6XXCx56pSQL8dx8yy4pKwIN1YqucvxRG+B3ZbYfMmwy9uHQZByAVZ8VO57IBxYGBEy5CF5FwrFWi5GCF2OGcnHR+CHlvCiOAvbuGMnDctdab1mmxPUMOpYHkjUL9OHuaKyVhlq28Dpfhy2LlByFEFrA1UME= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762980693; c=relaxed/simple; bh=8fEuaUJq6hnppPcJgE76MlplmW/P2brzXo1BFCCJvj8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TWOw9DOqPkl14T6pnT6Tk0sXy4DMnE4u8lBeAPoQRCAfXrLDEvRmZowMSNFf9X1Q/un3h37ZN+kf9nbf3m86/J2lNx4aX753I/6WhtyqLXM7DvIT8Yh++c3ncRkM0sGxN+UoIuscu6RjTThaBKSIvCcJjZjsDBWC0RKsG1aSk3w= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=FYSsp93O; arc=fail smtp.client-ip=40.93.196.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="FYSsp93O" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=chQV3CZXLRCeARWy37bxe2Z3ccmyjaTv0CBrQRh3C86ux7OcuC35VhxVWYTM7TiJnw8nRw/jFVDgJevfhTp+USEYqtU4rXUnMkB8R5nPXvotcbSWIuVi7ShXGu2u5MfQwQEordcjPfSz8bbdK9UNBTrUZGyBTTgte/poXiOJwnq2c8xFc45cQGn+h+1AkqzpFIqc89FhpbSsD9W38MjVviqnSyiUJlneZ2KL4g8IS6aBFdLtApfQP89U5FCnM4drf/N5gcB2EsnwWhkXSut4PyT2QS45WW9s0oAohLnaw3kwzHL8nGwf46HdPp61H3yU6H1W0zzsSSXqNrcqhN7lIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=3v7jgDbos57NmVjFsBB0NnJdEk8rmOjeUDghDshnTRM=; b=qExN99gnh1U3YQLsQCORTXFeHzo8cK+NY6TpxFt13Z/EpW4evjGBprsNEmGmYcWhyJbFx7OeDTVO3oUauY0L5k54rHnf5HXkvUVC1UfnfbBuurk7HwS7DEnCGS2dpzeuN2Pc91nilvJS4fjwOYjKyLQtR2kXyfLAs02DZ/QzlDfoJf1hh699mgyGhIIdyRFchBa1ozRFtJHyg0xTM979+/+AlkatE06JfgLEOBso0SggdKOzlZml3sDuFiqAlk5siEqSrC2rXD+BdMaaS2kLJHQyztk0IIeacIUATmfMUolQYj7ifHKdhpYM3Ks5PgECfvtgh56C5fUKVCJsuwNbPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3v7jgDbos57NmVjFsBB0NnJdEk8rmOjeUDghDshnTRM=; b=FYSsp93OsAa3UbNBEYmhasXDbv63ZTQfIRS4h7lDqpxwp8V4d+Ay/XcqGgQF4vrfLFdFvUz/jvms8BqBX8eGtMhAooKzRLncPet0Pd+TMWNatEHigQ8P5QJyzePz3IMEReuaQu7J4Wz8mdYQLfe6IkIm8QrzkI2uJCDGkQQq6LI= Received: from SN7PR04CA0192.namprd04.prod.outlook.com (2603:10b6:806:126::17) by DS2PR12MB9567.namprd12.prod.outlook.com (2603:10b6:8:27c::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.16; Wed, 12 Nov 2025 20:51:29 +0000 Received: from SN1PEPF0002BA4E.namprd03.prod.outlook.com (2603:10b6:806:126:cafe::fa) by SN7PR04CA0192.outlook.office365.com (2603:10b6:806:126::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9320.17 via Frontend Transport; Wed, 12 Nov 2025 20:51:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF0002BA4E.mail.protection.outlook.com (10.167.242.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.13 via Frontend Transport; Wed, 12 Nov 2025 20:51:29 +0000 Received: from rric.localdomain (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 12 Nov 2025 12:51:25 -0800 From: Robert Richter To: Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Jonathan Cameron , Dave Jiang , Davidlohr Bueso CC: , , Gregory Price , "Fabio M. De Francesco" , Terry Bowman , Joshua Hahn , Robert Richter Subject: [PATCH 1/3] cxl: Simplify cxl_rd_ops allocation and handling Date: Wed, 12 Nov 2025 21:51:02 +0100 Message-ID: <20251112205105.1271726-2-rrichter@amd.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251112205105.1271726-1-rrichter@amd.com> References: <20251112205105.1271726-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA4E:EE_|DS2PR12MB9567:EE_ X-MS-Office365-Filtering-Correlation-Id: c34ab8e9-b809-4953-f7b8-08de222d4106 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|376014|7416014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?m0GYajwfDOSBOmIw2923SbKPzQH3S9io5liq7qgkMx8Mg0+Jb/eAuBWLalNa?= =?us-ascii?Q?HwdI7sOcPQtLtHFFIOO9jK3o8kvbo6yPiVdfsLleKKH8cLMhhjW7e67/Ozgo?= =?us-ascii?Q?4/2Al2FPr8kA1+iMA1C2Bv0xuDe7E6X5AizUXIrD0xS2Xe7hWcFr96D5PcoP?= =?us-ascii?Q?NeYhgvEmw4hsuv8pZLsJ7Ae2KeGwePJLG0AoeXMM/00CprTPxW4VGG2hWbHo?= =?us-ascii?Q?b4WD/DY+bNRftF44rGS/FfiencjsZxBMHjm/LH9JyEAkHoGTzj0u4wTai4UP?= =?us-ascii?Q?n2EAecfE0pFqk9v0lURsevriSpsA9rowWRkKrFMtST5q8wpn4ZKnf88ZO7ZT?= =?us-ascii?Q?PrXdpyRYLApQ5JA15HJ8IxuAmsVlWyJU/8dVbE8Ut9wgKMNXdP3HbqNF2V40?= =?us-ascii?Q?7ZRhVZtO4iRzaQApZFL9GuUjJTmd3PTz0bVXNKrM2ELqnCNYKx0bGFVAbOtt?= =?us-ascii?Q?uBUB6DpTmn1hB3l9Wp2IcdhhvxO8LY8EJB6a5Wjz0VbaMp3ZEjhxgG1zbil6?= =?us-ascii?Q?6bNTXzMUv+ytwRwCFeTg6KuixqHq2UKuK/jvj7UvQt8GBmSvCe07nTGljs9Q?= =?us-ascii?Q?C/8QXHZu6ZQGGTFyZ7GDTCDRZFvdKzuKEb+575L1asqtA42vFJiyuW95DFA8?= =?us-ascii?Q?Ohxv/WX1FOBn2uzO7MVu0YP6N49I736eks6sMECw5ZYMvebAyOYg6ZcuTCRs?= =?us-ascii?Q?HBsliwOBborD3pBTgbR7cBhF63+o5dWOPeSd8HVkZoTC+4DtltYxdpx546hb?= =?us-ascii?Q?QVahGEL55c7llOXmCm4XOQql+H4IljjBjbXDYUbjojllqb0TNcpT9y9kr6FU?= =?us-ascii?Q?8G9eRwrHbVAT24voWOFhb6rPCKVu9Vtw1kki4IZWoEVpjZx+W2prjq0z5Q5E?= =?us-ascii?Q?vINyxJ0/J9nJWNGnk9hkrRJgdGtWM+l1BiO9zyeHsIy4U2UHyxm/Qrl3IGU0?= =?us-ascii?Q?/m60XzhvUZJBvWyX3RZ9Z+KQ4ZKID4jHCYub7QXMYFMW8qZkFTg5coUDD2Dn?= =?us-ascii?Q?rsiU2mREP62OS3eYvbWvGaOe4JsGRj9QFDynu+RRB1LQaD8JBP4vxEOWvKU/?= =?us-ascii?Q?YJk5/ou6GdbQ7+WMSAemb0Qb0TN/S93VXIvsofJz6Ac5imOk5xOcMBHDGp0z?= =?us-ascii?Q?YQjgIyF6ASlUFt1IxVRysu+YTyt14YucSn/4kSLhdrt2VY4j+PXaMhwH2yUk?= =?us-ascii?Q?3yxypJlicEQM2eEEUWiHO5Xwcoq8/Gu88+aTQnmYUEu/fYeVpLsZkQEIsEVb?= =?us-ascii?Q?6XhTBOfoXDgV7An3IndybpP+jCeNh8gB5xaBvLsoQlA+cITKqVnZOf+fwf57?= =?us-ascii?Q?Vk3VwzKTEgJdX9V1HmaZLDgCV0yn7J5/UzRzTW/tyPQH0vpq2atMPp5sNwJl?= =?us-ascii?Q?MjnXpVrpyKKIldf+9HRKfJ/Ea5kjPNTFd+lv+oVQfu0fm8bYxxfDWlE8TpjH?= =?us-ascii?Q?UGUMKSJCYhGI9VhBkBFNqHU8yKN3nDJb5Z9Qu4LAYtn2OJ4X30did6FYeL0U?= =?us-ascii?Q?alotCDkWDj4KDrGVxGw5jPxsmlulzK/PnGhcVXxNzb9Ed9rHD3NHO9YSooNm?= =?us-ascii?Q?WPkWasV0yKyY8fVxdik=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(7416014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2025 20:51:29.2384 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c34ab8e9-b809-4953-f7b8-08de222d4106 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA4E.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS2PR12MB9567 Content-Type: text/plain; charset="utf-8" A root decoder's callback handlers are collected in struct cxl_rd_ops. The structure is dynamically allocated, though it contains only a few pointers in it. This also requires to check two pointes to check for the existance of a callback. Simplify the allocation, release and handler check by embedding the ops statically in struct cxl_root_decoder. Implementation is equivalent to how struct cxl_root_ops handles the callbacks. Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Signed-off-by: Robert Richter Reviewed-by: Gregory Price --- drivers/cxl/acpi.c | 8 ++------ drivers/cxl/core/region.c | 20 +++++--------------- drivers/cxl/cxl.h | 2 +- 3 files changed, 8 insertions(+), 22 deletions(-) diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c index d5119de7f5a9..fab736aa77dc 100644 --- a/drivers/cxl/acpi.c +++ b/drivers/cxl/acpi.c @@ -487,12 +487,8 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *c= fmws, cxlrd->qos_class =3D cfmws->qtg_id; =20 if (cfmws->interleave_arithmetic =3D=3D ACPI_CEDT_CFMWS_ARITHMETIC_XOR) { - cxlrd->ops =3D kzalloc(sizeof(*cxlrd->ops), GFP_KERNEL); - if (!cxlrd->ops) - return -ENOMEM; - - cxlrd->ops->hpa_to_spa =3D cxl_apply_xor_maps; - cxlrd->ops->spa_to_hpa =3D cxl_apply_xor_maps; + cxlrd->ops.hpa_to_spa =3D cxl_apply_xor_maps; + cxlrd->ops.spa_to_hpa =3D cxl_apply_xor_maps; } =20 rc =3D cxl_decoder_add(cxld); diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index 451e5492911c..2b5ae5d9a4b6 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -2958,16 +2958,6 @@ static bool cxl_is_hpa_in_chunk(u64 hpa, struct cxl_= region *cxlr, int pos) return false; } =20 -static bool has_hpa_to_spa(struct cxl_root_decoder *cxlrd) -{ - return cxlrd->ops && cxlrd->ops->hpa_to_spa; -} - -static bool has_spa_to_hpa(struct cxl_root_decoder *cxlrd) -{ - return cxlrd->ops && cxlrd->ops->spa_to_hpa; -} - #define CXL_POS_ZERO 0 /** * cxl_validate_translation_params @@ -3141,8 +3131,8 @@ u64 cxl_dpa_to_hpa(struct cxl_region *cxlr, const str= uct cxl_memdev *cxlmd, hpa =3D hpa_offset + p->res->start + p->cache_size; =20 /* Root decoder translation overrides typical modulo decode */ - if (has_hpa_to_spa(cxlrd)) - hpa =3D cxlrd->ops->hpa_to_spa(cxlrd, hpa); + if (cxlrd->ops.hpa_to_spa) + hpa =3D cxlrd->ops.hpa_to_spa(cxlrd, hpa); =20 if (!cxl_resource_contains_addr(p->res, hpa)) { dev_dbg(&cxlr->dev, @@ -3151,7 +3141,7 @@ u64 cxl_dpa_to_hpa(struct cxl_region *cxlr, const str= uct cxl_memdev *cxlmd, } =20 /* Simple chunk check, by pos & gran, only applies to modulo decodes */ - if (!has_hpa_to_spa(cxlrd) && (!cxl_is_hpa_in_chunk(hpa, cxlr, pos))) + if (!cxlrd->ops.hpa_to_spa && !cxl_is_hpa_in_chunk(hpa, cxlr, pos)) return ULLONG_MAX; =20 return hpa; @@ -3184,8 +3174,8 @@ static int region_offset_to_dpa_result(struct cxl_reg= ion *cxlr, u64 offset, * If the root decoder has SPA to CXL HPA callback, use it. Otherwise * CXL HPA is assumed to equal SPA. */ - if (has_spa_to_hpa(cxlrd)) { - hpa =3D cxlrd->ops->spa_to_hpa(cxlrd, p->res->start + offset); + if (cxlrd->ops.spa_to_hpa) { + hpa =3D cxlrd->ops.spa_to_hpa(cxlrd, p->res->start + offset); hpa_offset =3D hpa - p->res->start; } else { hpa_offset =3D offset; diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h index 0481679eb109..91ff47382111 100644 --- a/drivers/cxl/cxl.h +++ b/drivers/cxl/cxl.h @@ -451,7 +451,7 @@ struct cxl_root_decoder { void *platform_data; struct mutex range_lock; int qos_class; - struct cxl_rd_ops *ops; + struct cxl_rd_ops ops; struct cxl_switch_decoder cxlsd; }; =20 --=20 2.47.3 From nobody Sun Feb 8 04:38:34 2026 Received: from BL0PR03CU003.outbound.protection.outlook.com (mail-eastusazon11012010.outbound.protection.outlook.com [52.101.53.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EBEB2D7DFB; Wed, 12 Nov 2025 20:51:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.53.10 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762980700; cv=fail; b=fB7IE0RFYw6Ug+hJO91FC9pq/WffVYL115Js3cpIzSuXqdpJAaqvfOX2Cs7UtZ7MISUJLqEKEIMLBBNf56PEOagdOe+TI0wV5dcUsYiSToqwBSht5ANLfWB+8scq8B7sMIXrVCdaxuZM3ncdifYzqQyHZKb/15Lhio8g8FTRF/s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762980700; c=relaxed/simple; bh=0VHIY4g5AbPH1stjO+DqQ4jJnFV6otBjq74BhLKSDO0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Tel44xBxBRG0Sfp3ZwiNYqlT8YLVpHfa/8vchV6s3CD7mVJoCY3Ro1SkGLaoHwe1p5XsRSYOKsLAO/EiH5pw7zrfHlSND5pCYS/Io4KX1iMU5m5yfvLDXDI0u9xzd0xX/up8x03Xx+yiGH6uOPCAQHpNcHrcjiOK5xfSTm3OmEg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=XlvZnCiQ; arc=fail smtp.client-ip=52.101.53.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="XlvZnCiQ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MmsLvCa1kfKXqlhv1tal5PVarT05MCMEo2TChzSZpTlfLVuFybBF18ilJOZ75ksaQSdUGk5KimVQHAaqjimOAQijz1SpobU1zf+31lWQ4xjoS2AjIPszAL15WrKfkLt5VXUFq9VXB+HtcK5wml7QWWBm1tEXzvtAWUryp/7XeUcE0gSP/aOmRCl83vpFvvxQKR/VwHL929RF54uGhl2KcUdp4M2kkDzOoGKqCtv3nMAAChGJWZyUzBwJVgesk76evIPpZhomWnsP6Ump1dEk/0V7050TC3iGK/MK4xLFVQc7u0EQkCCu6+R5Eb0SN+nF+mqJzVqFOicpilD3F/VlBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=4poZ7YVioMDsbtqQTCtChgjUhNILvmLSOYWUZXUcOt8=; b=gsQLeUH1o/LgkVYD1CyRPLzNimt4b9beUlJHXKaz+5Uywsvy0tTfJ3m6NceDF4enqXEo07ChQxIekeY5H8Wft2C3V8MOSGBHZNwteH/3A3OitgmDqP99fXTR9eoO55Tqtx4CezdvrvVF0rDoDlUuAYqzWirCGtZINsctSNTNjp6yCmyIFNBGmeNIx86BFH9UttoFm/wuaeToepVCNKA2WUDnrkw+2JBymaqituAnAOuk07MmYTSOuu4D5JxFr4hl5vm2X/75SbuSv+WYZtxrpgKLCBpLfGDFg7y02auLXzlNZIcm5SvU95yn2awNfwObQnRxEtRj/uMONvHBYyN/MQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4poZ7YVioMDsbtqQTCtChgjUhNILvmLSOYWUZXUcOt8=; b=XlvZnCiQ+L7vnVHRK70WTxtfiIBqCPlpSJ3Bq4MUx0OXl9mu28dk6/Hp6yWDwzlklQCl9rFkHN4CEyR4pksJygSn9ZfshV0de03XxJqt6CtyjpyauywL3OMgPqcudAYzFR23XnN0AuGLXzC/6ewlzQ/ysTtOs034voEXcO+a5Z4= Received: from SN6PR16CA0052.namprd16.prod.outlook.com (2603:10b6:805:ca::29) by MN2PR12MB4094.namprd12.prod.outlook.com (2603:10b6:208:15f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.15; Wed, 12 Nov 2025 20:51:32 +0000 Received: from SN1PEPF0002BA4B.namprd03.prod.outlook.com (2603:10b6:805:ca:cafe::63) by SN6PR16CA0052.outlook.office365.com (2603:10b6:805:ca::29) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9320.15 via Frontend Transport; Wed, 12 Nov 2025 20:51:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF0002BA4B.mail.protection.outlook.com (10.167.242.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.13 via Frontend Transport; Wed, 12 Nov 2025 20:51:31 +0000 Received: from rric.localdomain (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 12 Nov 2025 12:51:28 -0800 From: Robert Richter To: Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Jonathan Cameron , Dave Jiang , Davidlohr Bueso CC: , , Gregory Price , "Fabio M. De Francesco" , Terry Bowman , Joshua Hahn , Robert Richter Subject: [PATCH 2/3] cxl/acpi: Group xor arithmetric setup code in a single block Date: Wed, 12 Nov 2025 21:51:03 +0100 Message-ID: <20251112205105.1271726-3-rrichter@amd.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251112205105.1271726-1-rrichter@amd.com> References: <20251112205105.1271726-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA4B:EE_|MN2PR12MB4094:EE_ X-MS-Office365-Filtering-Correlation-Id: 73d61263-5549-4bd1-84ef-08de222d4288 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|7416014|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?yTHzWkJ+WZD253h9d+WP2DDH78zuS8EmG3ogX4nVpG45eIU1w2CubT+nH2sZ?= =?us-ascii?Q?a1mgpewGXDvK5V+f8zpH0LUHnDciy/Z63cnLpgG8uQro531n/2DYyoRzVpJv?= =?us-ascii?Q?ptQrsFYWN/9hVFfCfNH+J58fo/f/W14y15U7WCAlCbPFAvIr+b0iAftbVCMN?= =?us-ascii?Q?MXYw8ff/qZly4loDcHszcWw3FMw/gUcDSW13bfEseB6YzEZHstVxkWUKLCGR?= =?us-ascii?Q?AV9H/LHNdBN34bF/pcWgEphqM+UuuB3KJooMJbpBzrVFpwDldc91nlkgStBK?= =?us-ascii?Q?/B3hRhrBdyKApPp0QcpuMw9f8B7dpVJtnaVX/12MnHnCxVAcrVPs/pVC1NrV?= =?us-ascii?Q?neFWyVPBZr5P1Zxpd9eDweXR5Q8RomtUFF1RuP0/aWe6gIN3zKsnjN3qO8w+?= =?us-ascii?Q?VQj4uHumF7RubcFB5/mlPTaLX3UM9eVyi/OQXZcEkhga/0uf37iX21KjYw5t?= =?us-ascii?Q?opCL6OQC0FDejkqQS8ho0lk1fd06hnSX59eHmg2csc7YYoeYFct14BwkeF4m?= =?us-ascii?Q?bi3ROfpnGUcYnkGiSEADDhLz8Vqi5cUeQoBlnzP0KArHf3hN6FEk8vUSb9UC?= =?us-ascii?Q?1JciCpgMGLobVo0BvPCObm90QUJ6PL++PFefsDTQ6pS4A47XEf/Gz+Ae2yWa?= =?us-ascii?Q?Vxydl18rxxVuPAYzRF/iK+jvAjh4rh+729SmT7Tp5HiSqk1JOeTxpzMMtG8c?= =?us-ascii?Q?WZ+iqPb99/pFN+PnWVZRItSGzH7jobwdAwhl0afbhxk0W53H01ed4CLoLaqI?= =?us-ascii?Q?Wi1Tk0flvDmD6S0TgP75u9B5k94wj5MyUa9KTAig6W0Ki4jC9PyGN9J6FLXu?= =?us-ascii?Q?UBNZ9oCWY1z/V7Y+yKBE5EIdPheLmZeJNyUs6TLM1a4O3txy2goucorO6JnF?= =?us-ascii?Q?9/E0npGkxGz7FAxev5ATEZP7RPJTzBOiDPAOcUrHKSD7HpXtI4T258qZwYtp?= =?us-ascii?Q?kVsObE9g8syybY2xv4am2OlQ5osMUjGTS6dpf1Ks4XZQKVhAo0lc9+uHQNE6?= =?us-ascii?Q?AJloVHBVQr0GJvVdypo/kP3pfh0XjgaxUo9WD4BpYuJ/+8+23bYCqzopk8Fc?= =?us-ascii?Q?7KTrT+W5ATlkB+vWVWKjnBAg5F5Bx2FdKgAlbTKP0buo/1d0+E8IbGwKreH6?= =?us-ascii?Q?DOLRznqhu1TCAjpeLy9buZt7YqgXMWstybGOQFsGqHSPItxtgRFI7TzL4z+9?= =?us-ascii?Q?OgyGqP79MbVDXB0bYqhfZ4ewi5Xik6S8Zqh0apSwM31zIoXN37haTSdCJbUG?= =?us-ascii?Q?jHLMwvUGfqrjsdBnRinPY/O/Nf5bkMjq46uVFUajdzLoXnEKwHe2DZwMeyE0?= =?us-ascii?Q?KALQc/DgdWirUllZLDCtzLQWW5/MuUYv+n6+kN0XVqVFXR6Z6HYDPZklXZb+?= =?us-ascii?Q?QC+M3TNIrTtosMnI3PoXEvitL0BSUWWmrU0sUBTNTQ3xN3+VA41oKfWKDdri?= =?us-ascii?Q?fRTGAmnaWworRgrEDDdq44D4ZuJV7ChyO1VIWjR84CvZO52HqoZAYXTbMTX3?= =?us-ascii?Q?KJOcYy4MKuKVGzC9XrQBIsPLPbxPJtdeqom5tf1zo3MbZCWcgvF7KpdIN5kt?= =?us-ascii?Q?VXXtgRp2aoGU0ZOXlX8=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(7416014)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2025 20:51:31.7661 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 73d61263-5549-4bd1-84ef-08de222d4288 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA4B.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4094 Content-Type: text/plain; charset="utf-8" Simplify the xor arithmetric setup code by grouping it in a single block. No need to split the block for QoS setup. It is safe to reorder the call of cxl_setup_extended_linear_cache() because there are no dependencies. Reviewed-by: Jonathan Cameron Signed-off-by: Robert Richter Reviewed-by: Gregory Price --- v2: spell fix in descripton (Jonathan), --- --- drivers/cxl/acpi.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c index fab736aa77dc..50c2987e0459 100644 --- a/drivers/cxl/acpi.c +++ b/drivers/cxl/acpi.c @@ -465,8 +465,6 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cf= mws, ig =3D CXL_DECODER_MIN_GRANULARITY; cxld->interleave_granularity =3D ig; =20 - cxl_setup_extended_linear_cache(cxlrd); - if (cfmws->interleave_arithmetic =3D=3D ACPI_CEDT_CFMWS_ARITHMETIC_XOR) { if (ways !=3D 1 && ways !=3D 3) { cxims_ctx =3D (struct cxl_cxims_context) { @@ -482,15 +480,14 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *= cfmws, return -EINVAL; } } - } - - cxlrd->qos_class =3D cfmws->qtg_id; - - if (cfmws->interleave_arithmetic =3D=3D ACPI_CEDT_CFMWS_ARITHMETIC_XOR) { cxlrd->ops.hpa_to_spa =3D cxl_apply_xor_maps; cxlrd->ops.spa_to_hpa =3D cxl_apply_xor_maps; } =20 + cxl_setup_extended_linear_cache(cxlrd); + + cxlrd->qos_class =3D cfmws->qtg_id; + rc =3D cxl_decoder_add(cxld); if (rc) return rc; --=20 2.47.3 From nobody Sun Feb 8 04:38:34 2026 Received: from CY3PR05CU001.outbound.protection.outlook.com (mail-westcentralusazon11013063.outbound.protection.outlook.com [40.93.201.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6CE72D1911; Wed, 12 Nov 2025 20:51:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.201.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762980706; cv=fail; b=WIPFTTeq/FW+a+f7KHXHfu/cGaHU2JrjaWXanQ+DlLNbAJEeumVVUWRtdSkn6xsJX50s0p79yPpr/UAbGhjaZFGg69Rd+RqRDvizJxEByKiJXGADkGl/IgbA81pMpy9Pd1jVDz8GCHmkTk5ujKHlsG/xT44UYvA9I4tRm+8H4Bw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762980706; c=relaxed/simple; bh=gN7x0oa+rbBshHwtvs8lsCmY52Uw1jjP/TX3GGggcLU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UtfpIBmhqLmEpesk5Qxmjq0AeQKlIR7ncOqMBdtEEIT+c4kJHYCPM1djQ7XqvV2pmmF8wcqkCXo6FO5m/m6yOkNQ5k3u+DNqvmZBMc3IZcAMvtNOgvXYbohXmTarjWrmdngklg8qyf7Y8pFM9gwmPZH5sRCPyd++5+lT49XKmdw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=b7zW/owQ; arc=fail smtp.client-ip=40.93.201.63 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="b7zW/owQ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mVnbjoCRiUK1yxV/6/pNeEHk15ddMqdMyqdgcqgctoxMKD2bLU6H3989F6UyHjiA6b4EeOe6zO6tTaQPrLGlS41GFTJI62cKSNK9wGojvg+GNku0wG33uirejHW2oLH4jCfLQGbmmuPInT01/eXpGuedP0pqTVtiQHlnA52pHmknJ7psYuITEBPBzCO1NKxctWuvfOfcSEPNfnQ+OU8VYLnw3Sc+XHw5hKKuvZk1bXPG94Y5YNG1v8umvDYDAXzl6UTU2OE9smLzD3hv8sWBt+JDGFjZht65CPuTrg9JloQlTEagmutoQrI1k+RXIQaew/rk2InUHLHEUSNCkY0mfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=KGrU34xpgctCEm9xcDMNzjwiKygTHHz8xeRzigkvAps=; b=kmQCvl1onpTHnHUPn4f8lMluoLafjUwaOvRYVpVsOnfA4y/eSH0sng9c4hvMI0E/HHVFtPQRvHdLmkJfp0b1lvyK4IGWmBrYBSGJ6wntkXBaN6CcZH5UOyJ5zjUNlYqhhNILZWUEhj7Qxp4x2jmkV7U82aXZWfVxBCmq0vHknoVv1G5se534j7LilQOcFPIapjbbjqHvO/lxA3vvNBCbPuwSUMroO6ZP8xnQ6oDb+w3C1RSoWV4QvRmB0dqkRHOaGM72obAK49kFoqw6x7iH6f+JuC0JK1PTzw2r9i2RSZf9wluYQdPukPFeKpyoyOqpVUDavV34jeLNyExJdYowzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KGrU34xpgctCEm9xcDMNzjwiKygTHHz8xeRzigkvAps=; b=b7zW/owQ/xGLMaQ7RlPu9sLCX4Cqe2/1EPoD9xIsKIUM5hWI4pxQqHj4EURCDhMhxOqHXpvBb9mQo23D/6oowNy0Cp3GvDtA53UGv5GfUv6qeytMhDhZGTzxfgh8UPp3bVWtk2w5QbFKDxCAYwMoon64uLBacKacBV3QQRAUmlQ= Received: from PH8PR02CA0033.namprd02.prod.outlook.com (2603:10b6:510:2da::6) by IA0PR12MB7577.namprd12.prod.outlook.com (2603:10b6:208:43e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.16; Wed, 12 Nov 2025 20:51:36 +0000 Received: from SN1PEPF0002BA51.namprd03.prod.outlook.com (2603:10b6:510:2da:cafe::8a) by PH8PR02CA0033.outlook.office365.com (2603:10b6:510:2da::6) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9320.15 via Frontend Transport; Wed, 12 Nov 2025 20:51:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF0002BA51.mail.protection.outlook.com (10.167.242.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.13 via Frontend Transport; Wed, 12 Nov 2025 20:51:34 +0000 Received: from rric.localdomain (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 12 Nov 2025 12:51:31 -0800 From: Robert Richter To: Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Jonathan Cameron , Dave Jiang , Davidlohr Bueso CC: , , Gregory Price , "Fabio M. De Francesco" , Terry Bowman , Joshua Hahn , Robert Richter Subject: [PATCH 3/3] cxl/region: Remove local variable @inc in cxl_port_setup_targets() Date: Wed, 12 Nov 2025 21:51:04 +0100 Message-ID: <20251112205105.1271726-4-rrichter@amd.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251112205105.1271726-1-rrichter@amd.com> References: <20251112205105.1271726-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA51:EE_|IA0PR12MB7577:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f1c5bbb-a794-4e84-d04b-08de222d4473 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|7416014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?kre4SVb4QV/+Mhh5V7eDpObdgg+fG7u6Q1qOFekhUq5fGrcrvX2tyLdJpf/S?= =?us-ascii?Q?kmwivtSp/cEE2UB/Y6qBoOdiFFCD9xevfLvEDeFKQHXq7VecblN/UOwI+9SV?= =?us-ascii?Q?82SuEM4kxXkVbWFu5JmPHONH8ypdTmzVM45twRGGpc4ly7+VlkJd0F+NXY1X?= =?us-ascii?Q?qUA5F01d47O0I1iAT3kvrm5uLB3q5wdNKQH/zUUzMpT+MYNr0vMbhKcz6vab?= =?us-ascii?Q?/SCAXn0Q6nXbUkzvamBU7JzuewfSQPirFytHjAlvZ8I549qul/tkogZNj7nn?= =?us-ascii?Q?e/TfnYLy5jk7fdHPY1Tzqc5KNeV8QoZqjlx2ejaIKg34y0oYE8qiks754ShS?= =?us-ascii?Q?rkXYdnPCSwSF1Euz8TdFMO7uZ3oIJW6gm5CybKQCWQOv2nqT8dMpaEAwJ3pz?= =?us-ascii?Q?6klAO2QenIUYEvU0ArruX2Yblb6Z1+UuMqliEzEy4FPQh0R9LDlAHRjkh1sm?= =?us-ascii?Q?TJxhWF9SyVkah+yc8d4q8sg4uJwi8kNDwcQimyQav3255W97njbO/SPyMTmr?= =?us-ascii?Q?k3KJVvySIEIym5/2FUzAq4tRi2/BIe3IIImSwac7Yx5JQWtIYrLHzb5bzzsx?= =?us-ascii?Q?/s+W36Mlr0we6TGpsnAgMLle80qWmeTtdFj1On+u0iormEAxAnkC2vnmtZ0V?= =?us-ascii?Q?yHWLZS+da5e89Jwia6auEFVX07o2cm81JY72iQ7gi+Ff4rw8We65q+6sTfQQ?= =?us-ascii?Q?8IrSEGJoFliBicf3B0dKtJ3GmWz2VQ6rnadTOfWT8lvCB4sco7NdtiChY/Lf?= =?us-ascii?Q?V5t1hXglreq9ne+L/X4vY8Fa67NPrUKwaofN5JKu2rCrneU6ItQ8wXovCFV1?= =?us-ascii?Q?nhNPeNw9A2Tw9PnWGWhd1t0IVc7UA533zx8DfZf+xxI1OEv1VNNG3qBq9UbQ?= =?us-ascii?Q?cPGyYcOp+aefKs5iMUMicQprnJYbI3RsH7PL5BAWnWBHkQG88Cznz2DNfQk0?= =?us-ascii?Q?gYr8GY/b3VLPglMpHNFNvDqt1gXoU9jy+3UrmTtexl4oqYJebFe9Zv+kAQ2K?= =?us-ascii?Q?Pk9y88sdthtXvjDhD8qKP31ASwvIuKyIo2UTzNIo8qD+n7EaCaYKjGDAFxO3?= =?us-ascii?Q?TR22reasdN3BCYuPoAO67v3zzqIPA22XSPx2DrpTnraMfc2tE9FazU4bNV4n?= =?us-ascii?Q?a4DxzYiKOiwW09/9CCEAQjd0ZnrYhsUWKAR/EDByTk/aRWkGpqRXdPws/Xw+?= =?us-ascii?Q?H7yzRBHq9tHG8EzJ6PabmixYT9fp42khZgzaEf5MfHh1fbgqdbBkkuMt7jwk?= =?us-ascii?Q?ckNl9vjXe2x2kR9rEmjkhTLAThySamlJ8nAp43g5jInA+OzbrGwl8tHd5amR?= =?us-ascii?Q?49FrO7GhamR+rBvR3fmAbOVfhHUtKJu+IvQNnIZ+5Gw2/UMvr7vQD/73mvZj?= =?us-ascii?Q?S7sZIPthmKYyOMscrDcTznZZDO9rZCJB/x1DEgR8bTVfUFSAngGDekr+imcQ?= =?us-ascii?Q?A6zV7Mr10DfDxpT9oc+embM8sSHEahL3l5XWOtdJ8uwQvMNAEQDvH/e0Esk4?= =?us-ascii?Q?o3eZHUEkw8mDyKM9TTvbZ6bRK0NDcfJQAM0NYcve4a9nlWFsMJUt/Y50qJ1t?= =?us-ascii?Q?btvReAEGtqT/3rNHEqY=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(7416014)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2025 20:51:34.9906 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f1c5bbb-a794-4e84-d04b-08de222d4473 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA51.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7577 Content-Type: text/plain; charset="utf-8" Simplify the code by removing local variable @inc. The variable is not used elsewhere, remove it and directly increment the target number. Reviewed-by: Jonathan Cameron Signed-off-by: Robert Richter Reviewed-by: Gregory Price --- drivers/cxl/core/region.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index 2b5ae5d9a4b6..e577b11bd889 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -1357,7 +1357,7 @@ static int cxl_port_setup_targets(struct cxl_port *po= rt, struct cxl_endpoint_decoder *cxled) { struct cxl_root_decoder *cxlrd =3D cxlr->cxlrd; - int parent_iw, parent_ig, ig, iw, rc, inc =3D 0, pos =3D cxled->pos; + int parent_iw, parent_ig, ig, iw, rc, pos =3D cxled->pos; struct cxl_port *parent_port =3D to_cxl_port(port->dev.parent); struct cxl_region_ref *cxl_rr =3D cxl_rr_load(port, cxlr); struct cxl_memdev *cxlmd =3D cxled_to_memdev(cxled); @@ -1549,9 +1549,8 @@ static int cxl_port_setup_targets(struct cxl_port *po= rt, cxlsd->target[cxl_rr->nr_targets_set] =3D ep->dport; cxlsd->cxld.target_map[cxl_rr->nr_targets_set] =3D ep->dport->port_id; } - inc =3D 1; + cxl_rr->nr_targets_set++; out_target_set: - cxl_rr->nr_targets_set +=3D inc; dev_dbg(&cxlr->dev, "%s:%s target[%d] =3D %s for %s:%s @ %d\n", dev_name(port->uport_dev), dev_name(&port->dev), cxl_rr->nr_targets_set - 1, dev_name(ep->dport->dport_dev), --=20 2.47.3