netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] ptp: ptp_ines: Use list_for_each_entry() helper
@ 2023-08-30  9:08 Jinjie Ruan
  2023-08-30  9:38 ` Michal Swiatkowski
  2023-08-31  1:29 ` Jakub Kicinski
  0 siblings, 2 replies; 3+ messages in thread
From: Jinjie Ruan @ 2023-08-30  9:08 UTC (permalink / raw)
  To: netdev, Richard Cochran; +Cc: ruanjinjie

Convert list_for_each() to list_for_each_entry() so that the this
list_head pointer and list_entry() call are no longer needed, which
can reduce a few lines of code. No functional changed.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/ptp/ptp_ines.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/ptp/ptp_ines.c b/drivers/ptp/ptp_ines.c
index ed215b458183..c74f2dbbe3a2 100644
--- a/drivers/ptp/ptp_ines.c
+++ b/drivers/ptp/ptp_ines.c
@@ -237,11 +237,9 @@ static struct ines_port *ines_find_port(struct device_node *node, u32 index)
 {
 	struct ines_port *port = NULL;
 	struct ines_clock *clock;
-	struct list_head *this;
 
 	mutex_lock(&ines_clocks_lock);
-	list_for_each(this, &ines_clocks) {
-		clock = list_entry(this, struct ines_clock, list);
+	list_for_each_entry(clock, &ines_clocks, list) {
 		if (clock->node == node) {
 			port = &clock->port[index];
 			break;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-31  1:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-30  9:08 [PATCH -next] ptp: ptp_ines: Use list_for_each_entry() helper Jinjie Ruan
2023-08-30  9:38 ` Michal Swiatkowski
2023-08-31  1:29 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).