]> Gentwo Git Trees - linux/.git/commitdiff
ptp: ocp: Apply standard pattern for cleaning up loop
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 24 Nov 2025 08:45:47 +0000 (09:45 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 26 Nov 2025 03:17:21 +0000 (19:17 -0800)
The while (i--) is a standard pattern for the cleaning up loops.
Apply this pattern where it makes sense in the driver.

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20251124084816.205035-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/ptp/ptp_ocp.c

index 28243fb1d78f2392dffcbd18e9ec9e1b1b523ce1..c1d190a09c33bac2fee29b2f826cbf11067ed12c 100644 (file)
@@ -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);
        }