Re: [PATCH v9 7/9] PCI/bwctrl: Add API to set PCIe Link Speed
From: Lukas Wunner
Date: Thu Jan 02 2025 - 05:38:51 EST
On Fri, Oct 18, 2024 at 05:47:53PM +0300, Ilpo Järvinen wrote:
> @@ -142,9 +304,11 @@ static int pcie_bwnotif_probe(struct pcie_device *srv)
> if (ret)
> return ret;
>
> - scoped_guard(rwsem_write, &pcie_bwctrl_lbms_rwsem) {
> - port->link_bwctrl = no_free_ptr(data);
> - pcie_bwnotif_enable(srv);
> + scoped_guard(rwsem_write, &pcie_bwctrl_setspeed_rwsem) {
> + scoped_guard(rwsem_write, &pcie_bwctrl_lbms_rwsem) {
> + port->link_bwctrl = no_free_ptr(data);
> + pcie_bwnotif_enable(srv);
> + }
> }
The "data" pointer is allocated with devm_kzalloc().
There's no __free(kfree) anywhere.
So what's the motivation for the no_free_ptr()?
Is this a remnant of an earlier version of the patch set that can be deleted
or is there actually a purpose to it?
Thanks,
Lukas