diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2005-06-22 17:32:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-06-22 17:32:51 -0400 |
commit | f31f5f051269746179b01017fc5e3dcf6b37c67e (patch) | |
tree | 9153d74203a18cd7239340e8d4b97d31a98f2ae0 /net | |
parent | 6a17944ca12229036a6d8d48be1b5eb51204fcf8 (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.c | 3 |
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) | |||
383 | goto out; | 383 | goto out; |
384 | } | 384 | } |
385 | 385 | ||
386 | sprintf(name, "[%lu]", SOCK_INODE(sock)->i_ino); | 386 | this.len = sprintf(name, "[%lu]", SOCK_INODE(sock)->i_ino); |
387 | this.name = name; | 387 | this.name = name; |
388 | this.len = strlen(name); | ||
389 | this.hash = SOCK_INODE(sock)->i_ino; | 388 | this.hash = SOCK_INODE(sock)->i_ino; |
390 | 389 | ||
391 | file->f_dentry = d_alloc(sock_mnt->mnt_sb->s_root, &this); | 390 | file->f_dentry = d_alloc(sock_mnt->mnt_sb->s_root, &this); |