diff mbox series

dp83640: reverse arguments to list_add_tail

Message ID 1588276292-19166-1-git-send-email-Julia.Lawall@inria.fr
State Accepted
Delegated to: David Miller
Headers show
Series dp83640: reverse arguments to list_add_tail | expand

Commit Message

Julia Lawall April 30, 2020, 7:51 p.m. UTC
In this code, it appears that phyter_clocks is a list head, based on
the previous list_for_each, and that clock->list is intended to be a
list element, given that it has just been initialized in
dp83640_clock_init.  Accordingly, switch the arguments to
list_add_tail, which takes the list head as the second argument.

Fixes: cb646e2b02b27 ("ptp: Added a clock driver for the National Semiconductor PHYTER.")
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

---
Not tested.

 drivers/net/phy/dp83640.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller May 1, 2020, 12:49 a.m. UTC | #1
From: Julia Lawall <Julia.Lawall@inria.fr>
Date: Thu, 30 Apr 2020 21:51:32 +0200

> In this code, it appears that phyter_clocks is a list head, based on
> the previous list_for_each, and that clock->list is intended to be a
> list element, given that it has just been initialized in
> dp83640_clock_init.  Accordingly, switch the arguments to
> list_add_tail, which takes the list head as the second argument.
> 
> Fixes: cb646e2b02b27 ("ptp: Added a clock driver for the National Semiconductor PHYTER.")
> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

This looks correct to me too.

Applied and queued up for -stable, thanks.
diff mbox series

Patch

diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index 415c27310982..ecbd5e0d685c 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -1120,7 +1120,7 @@  static struct dp83640_clock *dp83640_clock_get_bus(struct mii_bus *bus)
 		goto out;
 	}
 	dp83640_clock_init(clock, bus);
-	list_add_tail(&phyter_clocks, &clock->list);
+	list_add_tail(&clock->list, &phyter_clocks);
 out:
 	mutex_unlock(&phyter_clocks_lock);