Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: ipv4: remove define INET_CSK_DEBUG and unnecessary EXPORT_SYMBOL

INET_CSK_DEBUG is always set and only is used for 2 pr_debug calls.

EXPORT_SYMBOL(inet_csk_timer_bug_msg) is only used by these 2
pr_debug calls and is also unnecessary as the exported string can
be used directly by these calls.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Joe Perches and committed by
David S. Miller
03bdfc00 7d0870f6

+4 -23
+4 -18
include/net/inet_connection_sock.h
··· 23 23 #include <net/inet_sock.h> 24 24 #include <net/request_sock.h> 25 25 26 - #define INET_CSK_DEBUG 1 27 - 28 26 /* Cancel timers, when they are not required. */ 29 27 #undef INET_CSK_CLEAR_TIMERS 30 28 ··· 194 196 void inet_csk_delete_keepalive_timer(struct sock *sk); 195 197 void inet_csk_reset_keepalive_timer(struct sock *sk, unsigned long timeout); 196 198 197 - #ifdef INET_CSK_DEBUG 198 - extern const char inet_csk_timer_bug_msg[]; 199 - #endif 200 - 201 199 static inline void inet_csk_clear_xmit_timer(struct sock *sk, const int what) 202 200 { 203 201 struct inet_connection_sock *icsk = inet_csk(sk); ··· 208 214 #ifdef INET_CSK_CLEAR_TIMERS 209 215 sk_stop_timer(sk, &icsk->icsk_delack_timer); 210 216 #endif 217 + } else { 218 + pr_debug("inet_csk BUG: unknown timer value\n"); 211 219 } 212 - #ifdef INET_CSK_DEBUG 213 - else { 214 - pr_debug("%s", inet_csk_timer_bug_msg); 215 - } 216 - #endif 217 220 } 218 221 219 222 /* ··· 223 232 struct inet_connection_sock *icsk = inet_csk(sk); 224 233 225 234 if (when > max_when) { 226 - #ifdef INET_CSK_DEBUG 227 235 pr_debug("reset_xmit_timer: sk=%p %d when=0x%lx, caller=%p\n", 228 236 sk, what, when, current_text_addr()); 229 - #endif 230 237 when = max_when; 231 238 } 232 239 ··· 238 249 icsk->icsk_ack.pending |= ICSK_ACK_TIMER; 239 250 icsk->icsk_ack.timeout = jiffies + when; 240 251 sk_reset_timer(sk, &icsk->icsk_delack_timer, icsk->icsk_ack.timeout); 252 + } else { 253 + pr_debug("inet_csk BUG: unknown timer value\n"); 241 254 } 242 - #ifdef INET_CSK_DEBUG 243 - else { 244 - pr_debug("%s", inet_csk_timer_bug_msg); 245 - } 246 - #endif 247 255 } 248 256 249 257 static inline unsigned long
-5
net/ipv4/inet_connection_sock.c
··· 27 27 #include <net/sock_reuseport.h> 28 28 #include <net/addrconf.h> 29 29 30 - #ifdef INET_CSK_DEBUG 31 - const char inet_csk_timer_bug_msg[] = "inet_csk BUG: unknown timer value\n"; 32 - EXPORT_SYMBOL(inet_csk_timer_bug_msg); 33 - #endif 34 - 35 30 #if IS_ENABLED(CONFIG_IPV6) 36 31 /* match_wildcard == true: IPV6_ADDR_ANY equals to any IPv6 addresses if IPv6 37 32 * only, and any IPv4 addresses if not IPv6 only