summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2005-06-22 23:32:51 +0200
committerDavid S. Miller <davem@davemloft.net>2005-06-22 23:32:51 +0200
commitf31f5f051269746179b01017fc5e3dcf6b37c67e (patch)
tree9153d74203a18cd7239340e8d4b97d31a98f2ae0 /net
parent[CRYPTO]: Use CPU cycle counters in tcrypt (diff)
downloadlinux-f31f5f051269746179b01017fc5e3dcf6b37c67e.tar.xz
linux-f31f5f051269746179b01017fc5e3dcf6b37c67e.zip
[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);