Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f31f5f05 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

[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: default avatarEric Dumazet <dada1@cosmosbay.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6a17944c
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);