[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <afc9841a-aba2-f413-2844-dd24bb0a5fde@amd.com>
Date: Wed, 27 Nov 2024 11:46:59 +0000
From: Alejandro Lucero Palau <alucerop@....com>
To: Alison Schofield <alison.schofield@...el.com>,
alejandro.lucero-palau@....com
Cc: linux-cxl@...r.kernel.org, netdev@...r.kernel.org,
dan.j.williams@...el.com, martin.habets@...inx.com, edward.cree@....com,
davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com, edumazet@...gle.com
Subject: Re: [PATCH v5 06/27] cxl: add function for type2 cxl regs setup
On 11/21/24 22:34, Alison Schofield wrote:
> On Mon, Nov 18, 2024 at 04:44:13PM +0000, alejandro.lucero-palau@....com wrote:
>> From: Alejandro Lucero <alucerop@....com>
>>
>> Create a new function for a type2 device initialising
>> cxl_dev_state struct regarding cxl regs setup and mapping.
>>
>> Signed-off-by: Alejandro Lucero <alucerop@....com>
>> ---
>> drivers/cxl/core/pci.c | 47 ++++++++++++++++++++++++++++++++++++++++++
>> include/cxl/cxl.h | 2 ++
>> 2 files changed, 49 insertions(+)
>>
>> diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c
> snip
>
>> +
>> +int cxl_pci_accel_setup_regs(struct pci_dev *pdev, struct cxl_dev_state *cxlds)
>> +{
>> + int rc;
> maybe init to 0
It is not used before the next call initialising it, so it is not needed.
>> +
>> + rc = cxl_pci_setup_memdev_regs(pdev, cxlds);
>> + if (rc)
>> + return rc;
>> +
>> + rc = cxl_pci_setup_regs(pdev, CXL_REGLOC_RBI_COMPONENT,
>> + &cxlds->reg_map, cxlds->capabilities);
>> + if (rc) {
>> + dev_warn(&pdev->dev, "No component registers (%d)\n", rc);
>> + return rc;
>> + }
>> +
>> + if (!test_bit(CXL_CM_CAP_CAP_ID_RAS, cxlds->capabilities))
>> + return rc;
> init rc to 0 or return 0 directly here
>
>> +
>> + rc = cxl_map_component_regs(&cxlds->reg_map,
>> + &cxlds->regs.component,
>> + BIT(CXL_CM_CAP_CAP_ID_RAS));
>> + if (rc)
>> + dev_dbg(&pdev->dev, "Failed to map RAS capability.\n");
>> +
>> + return rc;
> init rc to 0 or return 0 directly here
>
>
>> +}
>> +EXPORT_SYMBOL_NS_GPL(cxl_pci_accel_setup_regs, CXL);
> snip
>>
Powered by blists - more mailing lists