summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2005-06-22 14:32:51 -0700
committerDavid S. Miller <davem@davemloft.net>2005-06-22 14:32:51 -0700
commitf31f5f051269746179b01017fc5e3dcf6b37c67e (patch)
tree9153d74203a18cd7239340e8d4b97d31a98f2ae0 /net
parent6a17944ca12229036a6d8d48be1b5eb51204fcf8 (diff)
[NET]: dont use strlen() but the result from a prior sprintf()
Small patch to save an unecessary call to strlen() : sprintf() gave us the length, just trust it. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/socket.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/socket.c b/net/socket.c
index 38729af09461..6f2a17881972 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -383,9 +383,8 @@ int sock_map_fd(struct socket *sock)
goto out;
}
- sprintf(name, "[%lu]", SOCK_INODE(sock)->i_ino);
+ this.len = sprintf(name, "[%lu]", SOCK_INODE(sock)->i_ino);
this.name = name;
- this.len = strlen(name);
this.hash = SOCK_INODE(sock)->i_ino;
file->f_dentry = d_alloc(sock_mnt->mnt_sb->s_root, &this);