summaryrefslogtreecommitdiff
path: root/net/tipc
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2012-08-16 12:09:09 +0000
committerDavid S. Miller <davem@davemloft.net>2012-08-20 02:26:30 -0700
commit381294331ed2858f8e75223310f873d580921366 (patch)
treea30b75a464adfb5525d3a3ceb98ba54eaf6ac8cc /net/tipc
parentfc0739385ba10f59105e87a46cc93d9d9a10553c (diff)
downloadlinux-3.10-381294331ed2858f8e75223310f873d580921366.tar.gz
linux-3.10-381294331ed2858f8e75223310f873d580921366.tar.bz2
linux-3.10-381294331ed2858f8e75223310f873d580921366.zip
tipc: manually inline single use media_name_valid routine
After eliminating the mechanism which checks whether all letters in media name string are within a given character set, the media_name_valid routine becomes trivial. It is also only used once, so it is unnecessary to keep it as a separate function. Signed-off-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/bearer.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 6b2faa57a39..4ec5c80e8a7 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -49,21 +49,6 @@ struct tipc_bearer tipc_bearers[MAX_BEARERS];
static void bearer_disable(struct tipc_bearer *b_ptr);
/**
- * media_name_valid - validate media name
- *
- * Returns 1 if media name is valid, otherwise 0.
- */
-static int media_name_valid(const char *name)
-{
- u32 len;
-
- len = strlen(name);
- if ((len + 1) > TIPC_MAX_MEDIA_NAME)
- return 0;
- return 1;
-}
-
-/**
* tipc_media_find - locates specified media object by name
*/
struct tipc_media *tipc_media_find(const char *name)
@@ -102,7 +87,7 @@ int tipc_register_media(struct tipc_media *m_ptr)
write_lock_bh(&tipc_net_lock);
- if (!media_name_valid(m_ptr->name))
+ if ((strlen(m_ptr->name) + 1) > TIPC_MAX_MEDIA_NAME)
goto exit;
if ((m_ptr->bcast_addr.media_id != m_ptr->type_id) ||
!m_ptr->bcast_addr.broadcast)