Skip to content

Commit bd1fd73

Browse files
committed
net: ipv4: tcp: Get tcpi_count via file_count() not direct access
Commit 0a1544a, which implements a Qualcomm feature called Smart Wireless Interface Manager, added a tcpi_count member to struct tcp_info, and populates it using: atomic_read(&filep->f_count); This causes compiler warnings on 64-bit architectures (e.g., 64-bit ARCH_UM, used by net_test) because f_count is actually an atomic_long_t, and on 64-bit architectures atomic_long_t is a 64-bit number. The difference doesn't matter in practice because the value is cast to a __u8 anyway, but it causes build breaks because we build with -Werror. Instead of using atomic_long_t directly, use the the file_count macro which exists for this purpose. Change-Id: Ie09a0b4e7a5cf128b21eff10c1b34faf5c995356 Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
1 parent aa57899 commit bd1fd73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/tcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2523,7 +2523,7 @@ void tcp_get_info(const struct sock *sk, struct tcp_info *info)
25232523
if (sk->sk_socket) {
25242524
struct file *filep = sk->sk_socket->file;
25252525
if (filep)
2526-
info->tcpi_count = atomic_read(&filep->f_count);
2526+
info->tcpi_count = file_count(filep);
25272527
}
25282528
}
25292529
EXPORT_SYMBOL_GPL(tcp_get_info);

0 commit comments

Comments
 (0)