summaryrefslogtreecommitdiffstats
path: root/net/tipc/ref.c
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2014-03-12 11:31:13 -0400
committerDavid S. Miller <davem@davemloft.net>2014-03-12 15:53:49 -0400
commit5c311421a28051036a114aec972d36c72114ed4c (patch)
treeb8210cd9a14a3fc205ca254d33de80bf185f2a0c /net/tipc/ref.c
parent58ed944241794087df1edadfa66795c966bf1604 (diff)
downloadlinux-5c311421a28051036a114aec972d36c72114ed4c.tar.gz
linux-5c311421a28051036a114aec972d36c72114ed4c.tar.bz2
linux-5c311421a28051036a114aec972d36c72114ed4c.zip
tipc: eliminate redundant lookups in registry
As an artefact from the native interface, the message sending functions in the port takes a port ref as first parameter, and then looks up in the registry to find the corresponding port pointer. This despite the fact that the only currently existing caller, tipc_sock, already knows this pointer. We change the signature of these functions to take a struct tipc_port* argument, and remove the redundant lookups. We also remove an unmotivated extra lookup in the function socket.c:auto_connect(), and, as the lookup functions tipc_port_deref() and ref_deref() now become unused, we remove these two functions. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Reviewed-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/ref.c')
-rw-r--r--net/tipc/ref.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/net/tipc/ref.c b/net/tipc/ref.c
index 67176b5e14f3..3d4ecd754eee 100644
--- a/net/tipc/ref.c
+++ b/net/tipc/ref.c
@@ -264,20 +264,3 @@ void *tipc_ref_lock(u32 ref)
}
return NULL;
}
-
-
-/**
- * tipc_ref_deref - return pointer referenced object (without locking it)
- */
-void *tipc_ref_deref(u32 ref)
-{
- if (likely(tipc_ref_table.entries)) {
- struct reference *entry;
-
- entry = &tipc_ref_table.entries[ref &
- tipc_ref_table.index_mask];
- if (likely(entry->ref == ref))
- return entry->object;
- }
- return NULL;
-}