[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <26975dab-9631-4661-aaf4-afa213104a13@wanadoo.fr>
Date: Sun, 19 Oct 2025 16:45:00 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Anand Moon <linux.amoon@...il.com>
Cc: linux-pci@...r.kernel.org, linux-omap@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, Bjorn Helgaas <bhelgaas@...gle.com>,
Krzysztof Wilczyński <kwilczynski@...nel.org>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Manivannan Sadhasivam <mani@...nel.org>, Rob Herring <robh@...nel.org>,
Siddharth Vadapalli <s-vadapalli@...com>,
Vignesh Raghavendra <vigneshr@...com>, LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 1/3] PCI: j721e: Propagate dev_err_probe return value
Le 19/10/2025 à 12:15, Anand Moon a écrit :
> Hi Markus, Vignesh,
>
> On Sat, 18 Oct 2025 at 16:12, Markus Elfring <Markus.Elfring@....de> wrote:
>>
>>>> I propose to take another source code transformation approach better into account.
>>>> https://elixir.bootlin.com/linux/v6.17.1/source/drivers/base/core.c#L5031-L5075
>>>>
>>>> Example:
>>>> https://elixir.bootlin.com/linux/v6.17.1/source/drivers/pci/controller/cadence/pci-j721e.c#L444-L636
>>>>
>>>> ret = dev_err_probe(dev, cdns_pcie_init_phy(dev, cdns_pcie), "Failed to init phy\n");
>>>> if (ret)
>>>> goto err_get_sync;
>>>>
>>> No, the correct code ensures that dev_err_probe() is only called when
>>> an actual error
>>> has occurred, providing a clear and accurate log entry. …
>>
>> Where do you see undesirable technical differences?
>
> The primary issue I wanted to confirm was the function execution order.
> since cdns_pcie_init_phy within dev_err_probe function
>
> If other developers agree with the approach, I will modify this in a
> separate patch
This other approach is just broken.
Using:
ret = dev_err_probe(dev, cdns_pcie_init_phy(dev, cdns_pcie), "Failed to
init phy\n");
1) is hard to read and understand.
2) would log an error message even if 0 is returned. This is just wrong.
2 good reasons not to do such things.
You should ignore people that are already ignored by most people on
these lists.
CJ
>
> As Dan Carpenter pointed out - " Wait, no, this doesn't make sense.
> It's just assigning ret to itself."
Yes, Dan is right.
>
> This patch seems irrelevant to me as the return value gets propagated
> to the error path.
> Sorry for the noise. Let's drop these changes.
>
> Since I don't have this hardware for testing, I will verify it on
> another available device.
>>
>> Regards,
>> Markus
>
> Thanks
> -Anand
>
>
Powered by blists - more mailing lists