From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (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 3EEEC2586C6; Wed, 12 Feb 2025 17:57:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739383044; cv=none; b=dE+l8gAz5CAFo3Ey/XbvbW3SLE+ShrjsgGFbXUJUiHzUYC6ROuxcTV8dxUvUY9TsMBnEm5ZA9+EaAPYOpKpwK5oBSBdoVcGDOmILjDQ7X7mm8VbYO9dxDpBfebK1ST+VW/5pnW9q/tPV99Q2GIDixGI6ZJLIgV0dYf7U7YtEkec= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739383044; c=relaxed/simple; bh=QYKLL1qzNvw6KN1nd4cSObmkdI1Vpn9ZYQHNZMmDPEI=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=m/fNDPAMXucasVnsCl9HzmV6+6/J4/9cEID5CB8nL/5bWt5Ao76uK4K4hL4kcnMKlcoxsetLou1+CSEvrOoRli8BdjdjuSFe07/GRXQZcSdePs4jbaZ8KYJdqQfW8LJQvnvla5W2bzQDKoty7/8TwfekoG9jMY6MpCw6ZTNCpQU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4YtQtM2q3Yz6L5K2; Thu, 13 Feb 2025 01:54:19 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id 2D7C2140136; Thu, 13 Feb 2025 01:57:20 +0800 (CST) Received: from localhost (10.203.177.66) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 12 Feb 2025 18:57:19 +0100 Date: Wed, 12 Feb 2025 17:57:18 +0000 From: Jonathan Cameron To: Robert Richter CC: Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Dave Jiang , "Davidlohr Bueso" , , , Gregory Price , "Fabio M. De Francesco" , Terry Bowman Subject: Re: [PATCH v3 02/18] cxl/pci: Moving code in cxl_hdm_decode_init() Message-ID: <20250212175718.00006a53@huawei.com> In-Reply-To: <20250211095349.981096-3-rrichter@amd.com> References: <20250211095349.981096-1-rrichter@amd.com> <20250211095349.981096-3-rrichter@amd.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml100006.china.huawei.com (7.191.160.224) To frapeml500008.china.huawei.com (7.182.85.71) On Tue, 11 Feb 2025 10:53:32 +0100 Robert Richter wrote: > Commit 3f9e07531778 ("cxl/pci: simplify the check of mem_enabled in > cxl_hdm_decode_init()") changed the code flow in this function. The > root port is determined before a check to leave the function. Since > the root port is not used by the check it can be moved to run the > check first. This improves code readability and avoids unnesessary > code execution. > > Signed-off-by: Robert Richter > Reviewed-by: Gregory Price > Reviewed-by: Davidlohr Bueso > Tested-by: Gregory Price Seems reasonable. Reviewed-by: Jonathan Cameron