Re: [PATCH net-next v1 4/7] ptp: ocp: Apply standard pattern for cleaning up loop

From: Vadim Fedorenko

Date: Wed Nov 12 2025 - 08:36:26 EST


On 11/11/2025 16:52, Andy Shevchenko wrote:
The while (i--) is a standard pattern for the cleaning up loops.
Apply this pattern where it makes sense in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
drivers/ptp/ptp_ocp.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index 1dbbca4197bc..67a4c60cbbcd 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -4821,8 +4821,7 @@ ptp_ocp_probe(struct pci_dev *pdev, const struct pci_device_id *id)
return 0;
out_dpll:
- while (i) {
- --i;
+ while (i--) {
dpll_pin_unregister(bp->dpll, bp->sma[i].dpll_pin, &dpll_pins_ops, &bp->sma[i]);
dpll_pin_put(bp->sma[i].dpll_pin);
}

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@xxxxxxxxx>