netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jmaloy@redhat.com
To: netdev@vger.kernel.org, davem@davemloft.net
Cc: tipc-discussion@lists.sourceforge.net,
	tung.q.nguyen@dektech.com.au, hoang.h.le@dektech.com.au,
	tuong.t.lien@dektech.com.au, jmaloy@redhat.com,
	maloy@donjonn.com, xinl@redhat.com, ying.xue@windriver.com,
	parthasarathy.bhuvaragan@gmail.com
Subject: [net-next 12/16] tipc: simplify signature of tipc_service_find_range()
Date: Tue, 16 Mar 2021 22:06:19 -0400	[thread overview]
Message-ID: <20210317020623.1258298-13-jmaloy@redhat.com> (raw)
In-Reply-To: <20210317020623.1258298-1-jmaloy@redhat.com>

From: Jon Maloy <jmaloy@redhat.com>

We simplify the signatures of the functions tipc_service_create_range()
and tipc_service_find_range().

Signed-off-by: Jon Maloy <jmaloy@redhat.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
Acked-by: Hoang Le <hoang.h.le@dektech.com.au>
Acked-by: Tung Nguyen <tung.q.nguyen@dektech.com.au>
Acked-by: Xin Long <lucien.xin@gmail.com>
---
 net/tipc/name_table.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index 1ce65cbce672..f6a1b78a807e 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -275,13 +275,13 @@ static struct tipc_service *tipc_service_create(u32 type, struct hlist_head *hd)
 /*  tipc_service_find_range - find service range matching publication parameters
  */
 static struct service_range *tipc_service_find_range(struct tipc_service *sc,
-						     u32 lower, u32 upper)
+						     struct tipc_uaddr *ua)
 {
 	struct service_range *sr;
 
-	service_range_foreach_match(sr, sc, lower, upper) {
+	service_range_foreach_match(sr, sc, ua->sr.lower, ua->sr.upper) {
 		/* Look for exact match */
-		if (sr->lower == lower && sr->upper == upper)
+		if (sr->lower == ua->sr.lower && sr->upper == ua->sr.upper)
 			return sr;
 	}
 
@@ -289,10 +289,12 @@ static struct service_range *tipc_service_find_range(struct tipc_service *sc,
 }
 
 static struct service_range *tipc_service_create_range(struct tipc_service *sc,
-						       u32 lower, u32 upper)
+						       struct publication *p)
 {
 	struct rb_node **n, *parent = NULL;
 	struct service_range *sr;
+	u32 lower = p->sr.lower;
+	u32 upper = p->sr.upper;
 
 	n = &sc->ranges.rb_node;
 	while (*n) {
@@ -332,7 +334,7 @@ static bool tipc_service_insert_publ(struct net *net,
 	bool res = false;
 
 	spin_lock_bh(&sc->lock);
-	sr = tipc_service_create_range(sc, p->sr.lower, p->sr.upper);
+	sr = tipc_service_create_range(sc, p);
 	if (!sr)
 		goto  exit;
 
@@ -513,7 +515,7 @@ struct publication *tipc_nametbl_remove_publ(struct net *net,
 		return NULL;
 
 	spin_lock_bh(&sc->lock);
-	sr = tipc_service_find_range(sc, lower, upper);
+	sr = tipc_service_find_range(sc, ua);
 	if (!sr)
 		goto exit;
 	p = tipc_service_remove_publ(sr, sk, key);
-- 
2.29.2


  parent reply	other threads:[~2021-03-17  2:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17  2:06 [net-next 00/16] tipc: cleanups and simplifications jmaloy
2021-03-17  2:06 ` [net-next 01/16] tipc: re-organize members of struct publication jmaloy
2021-03-17  2:06 ` [net-next 02/16] tipc: move creation of publication item one level up in call chain jmaloy
2021-03-17  2:06 ` [net-next 03/16] tipc: introduce new unified address type for internal use jmaloy
2021-03-17  2:06 ` [net-next 04/16] tipc: simplify signature of tipc_namtbl_publish() jmaloy
2021-03-17  2:06 ` [net-next 05/16] tipc: simplify call signatures for publication creation jmaloy
2021-03-17  2:06 ` [net-next 06/16] tipc: simplify signature of tipc_nametbl_withdraw() functions jmaloy
2021-03-17  2:06 ` [net-next 07/16] tipc: rename binding table lookup functions jmaloy
2021-03-17  2:06 ` [net-next 08/16] tipc: refactor tipc_sendmsg() and tipc_lookup_anycast() jmaloy
2021-03-17  2:06 ` [net-next 09/16] tipc: simplify signature of tipc_namtbl_lookup_mcast_sockets() jmaloy
2021-03-17  2:06 ` [net-next 10/16] tipc: simplify signature of tipc_nametbl_lookup_mcast_nodes() jmaloy
2021-03-17  2:06 ` [net-next 11/16] tipc: simplify signature of tipc_nametbl_lookup_group() jmaloy
2021-03-17  2:06 ` jmaloy [this message]
2021-03-17  2:06 ` [net-next 13/16] tipc: simplify signature of tipc_find_service() jmaloy
2021-03-17  2:06 ` [net-next 14/16] tipc: simplify api between binding table and topology server jmaloy
2021-03-17  2:06 ` [net-next 15/16] tipc: add host-endian copy of user subscription to struct tipc_subscription jmaloy
2021-03-17  2:06 ` [net-next 16/16] tipc: remove some unnecessary warnings jmaloy
2021-03-17 19:00 ` [net-next 00/16] tipc: cleanups and simplifications patchwork-bot+netdevbpf

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=20210317020623.1258298-13-jmaloy@redhat.com \
    --to=jmaloy@redhat.com \
    --cc=davem@davemloft.net \
    --cc=hoang.h.le@dektech.com.au \
    --cc=maloy@donjonn.com \
    --cc=netdev@vger.kernel.org \
    --cc=parthasarathy.bhuvaragan@gmail.com \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=tung.q.nguyen@dektech.com.au \
    --cc=tuong.t.lien@dektech.com.au \
    --cc=xinl@redhat.com \
    --cc=ying.xue@windriver.com \
    /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).