Re: [net-next PATCH v5 01/10] octeontx2-pf: Refactoring RVU driver
From: Markus Elfring
Date: Sat Jun 15 2024 - 07:16:28 EST
…
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
…
> +void otx2_disable_napi(struct otx2_nic *pf)
> {
…
> - cancel_work_sync(&cq_poll->dim.work);
> + work = &cq_poll->dim.work;
> + if (work->func)
> + cancel_work_sync(&cq_poll->dim.work);
…
I suggest to use the shown local variable once more.
+ cancel_work_sync(work);
…
> +int otx2_init_rsrc(struct pci_dev *pdev, struct otx2_nic *pf)
> +{
…
> + return 0;
> +
> +err_detach_rsrc:
> + if (pf->hw.lmt_info)
> + free_percpu(pf->hw.lmt_info);
> + if (test_bit(CN10K_LMTST, &pf->hw.cap_flag))
> + qmem_free(pf->dev, pf->dync_lmt);
> + otx2_detach_resources(&pf->mbox);
> +err_disable_mbox_intr:
> + otx2_disable_mbox_intr(pf);
> +err_mbox_destroy:
> + otx2_pfaf_mbox_destroy(pf);
> +err_free_irq_vectors:
> + pci_free_irq_vectors(hw->pdev);
> +
> + return err;
> +}
…
Would you become interested to convert any usages of goto chains
into applications of scope-based resource management?
https://elixir.bootlin.com/linux/v6.10-rc3/source/include/linux/cleanup.h#L8
Regards,
Markus