summaryrefslogtreecommitdiffstats
path: root/net/socket.c
diff options
context:
space:
mode:
authorEric Dumazet2005-06-22 23:32:51 +0200
committerDavid S. Miller2005-06-22 23:32:51 +0200
commitf31f5f051269746179b01017fc5e3dcf6b37c67e (patch)
tree9153d74203a18cd7239340e8d4b97d31a98f2ae0 /net/socket.c
parent[CRYPTO]: Use CPU cycle counters in tcrypt (diff)
downloadkernel-qcow2-linux-f31f5f051269746179b01017fc5e3dcf6b37c67e.tar.gz
kernel-qcow2-linux-f31f5f051269746179b01017fc5e3dcf6b37c67e.tar.xz
kernel-qcow2-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/socket.c')
-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);