netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geliang Tang <geliangtang-9Onoh4P/yGk@public.gmane.org>
To: Pravin Shelar <pshelar-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>,
	"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org,
	Geliang Tang <geliangtang-9Onoh4P/yGk@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 11/14] openvswitch: use list_for_each_entry
Date: Fri, 18 Dec 2015 23:33:35 +0800	[thread overview]
Message-ID: <13c7141db917b9fb45dfec05da494318bd7d0ff9.1450451516.git.geliangtang@163.com> (raw)
In-Reply-To: <ab66a344512e064000357c6d3c2a6f3d0e948ddb.1450451516.git.geliangtang-9Onoh4P/yGk@public.gmane.org>
In-Reply-To: <ab66a344512e064000357c6d3c2a6f3d0e948ddb.1450451516.git.geliangtang-9Onoh4P/yGk@public.gmane.org>

Use list_for_each_entry() instead of list_for_each() to simplify
the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 net/openvswitch/flow_table.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c
index d073fff..9b5999ba 100644
--- a/net/openvswitch/flow_table.c
+++ b/net/openvswitch/flow_table.c
@@ -651,11 +651,9 @@ static bool mask_equal(const struct sw_flow_mask *a,
 static struct sw_flow_mask *flow_mask_find(const struct flow_table *tbl,
 					   const struct sw_flow_mask *mask)
 {
-	struct list_head *ml;
+	struct sw_flow_mask *m;
 
-	list_for_each(ml, &tbl->mask_list) {
-		struct sw_flow_mask *m;
-		m = container_of(ml, struct sw_flow_mask, list);
+	list_for_each_entry(m, &tbl->mask_list, list) {
 		if (mask_equal(mask, m))
 			return m;
 	}
-- 
2.5.0


_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

  parent reply	other threads:[~2015-12-18 15:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-18 15:33 [PATCH 01/14] Bluetooth: use list_for_each_entry* Geliang Tang
2015-12-18 15:33 ` [PATCH 02/14] sctp: " Geliang Tang
2015-12-18 15:52   ` Marcelo Ricardo Leitner
2015-12-18 15:33 ` [PATCH 03/14] ipv4, ipv6: " Geliang Tang
2015-12-18 15:33 ` [PATCH 04/14] x25: " Geliang Tang
2015-12-18 15:33 ` [PATCH 05/14] atm: use list_for_each_entry Geliang Tang
2015-12-18 15:33 ` [PATCH 06/14] libceph: use list_for_each_entry_safe Geliang Tang
2016-01-11 22:06   ` Ilya Dryomov
2015-12-18 15:33 ` [PATCH 07/14] batman-adv: " Geliang Tang
2015-12-21 14:42   ` Antonio Quartulli
2015-12-21 14:42   ` Antonio Quartulli
2016-03-28 15:02   ` [B.A.T.M.A.N.] " Marek Lindner
2015-12-18 15:33 ` [PATCH 08/14] caif: " Geliang Tang
2015-12-18 15:33 ` [PATCH 09/14] net: dsa: use list_for_each_entry Geliang Tang
2015-12-18 15:33 ` [PATCH 10/14] lapb: " Geliang Tang
     [not found] ` <ab66a344512e064000357c6d3c2a6f3d0e948ddb.1450451516.git.geliangtang-9Onoh4P/yGk@public.gmane.org>
2015-12-18 15:33   ` Geliang Tang [this message]
2015-12-18 15:33 ` [PATCH 12/14] net: sched: " Geliang Tang
2015-12-18 15:33 ` [PATCH 13/14] sunrpc: use list_for_each_entry_safe Geliang Tang
2015-12-18 15:33 ` [PATCH 14/14] net: pktgen: " Geliang Tang
2015-12-20  7:13 ` [PATCH 01/14] Bluetooth: use list_for_each_entry* Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13c7141db917b9fb45dfec05da494318bd7d0ff9.1450451516.git.geliangtang@163.com \
    --to=geliangtang-9onoh4p/ygk@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pshelar-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).