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

netfilter: Remove return values for print_conntrack callbacks

The seq_printf() and friends are having their return values removed.
The print_conntrack() returns the result of seq_printf(), which is
meaningless when seq_printf() returns void. Might as well remove the
return values of print_conntrack() as well.

Link: http://lkml.kernel.org/r/20141029220107.465008329@goodmis.org
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: netfilter-devel@vger.kernel.org
Cc: coreteam@netfilter.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

+17 -14
+1 -1
include/net/netfilter/nf_conntrack_l4proto.h
··· 60 60 const struct nf_conntrack_tuple *); 61 61 62 62 /* Print out the private part of the conntrack. */ 63 - int (*print_conntrack)(struct seq_file *s, struct nf_conn *); 63 + void (*print_conntrack)(struct seq_file *s, struct nf_conn *); 64 64 65 65 /* Return the array of timeouts for this protocol. */ 66 66 unsigned int *(*get_timeouts)(struct net *net);
+4 -1
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
··· 147 147 ? (long)(ct->timeout.expires - jiffies)/HZ : 0) != 0) 148 148 goto release; 149 149 150 - if (l4proto->print_conntrack && l4proto->print_conntrack(s, ct)) 150 + if (l4proto->print_conntrack) 151 + l4proto->print_conntrack(s, ct); 152 + 153 + if (seq_has_overflowed(s)) 151 154 goto release; 152 155 153 156 if (print_tuple(s, &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple,
+2 -2
net/netfilter/nf_conntrack_proto_dccp.c
··· 626 626 ntohs(tuple->dst.u.dccp.port)); 627 627 } 628 628 629 - static int dccp_print_conntrack(struct seq_file *s, struct nf_conn *ct) 629 + static void dccp_print_conntrack(struct seq_file *s, struct nf_conn *ct) 630 630 { 631 - return seq_printf(s, "%s ", dccp_state_names[ct->proto.dccp.state]); 631 + seq_printf(s, "%s ", dccp_state_names[ct->proto.dccp.state]); 632 632 } 633 633 634 634 #if IS_ENABLED(CONFIG_NF_CT_NETLINK)
+4 -4
net/netfilter/nf_conntrack_proto_gre.c
··· 235 235 } 236 236 237 237 /* print private data for conntrack */ 238 - static int gre_print_conntrack(struct seq_file *s, struct nf_conn *ct) 238 + static void gre_print_conntrack(struct seq_file *s, struct nf_conn *ct) 239 239 { 240 - return seq_printf(s, "timeout=%u, stream_timeout=%u ", 241 - (ct->proto.gre.timeout / HZ), 242 - (ct->proto.gre.stream_timeout / HZ)); 240 + seq_printf(s, "timeout=%u, stream_timeout=%u ", 241 + (ct->proto.gre.timeout / HZ), 242 + (ct->proto.gre.stream_timeout / HZ)); 243 243 } 244 244 245 245 static unsigned int *gre_get_timeouts(struct net *net)
+2 -2
net/netfilter/nf_conntrack_proto_sctp.c
··· 175 175 } 176 176 177 177 /* Print out the private part of the conntrack. */ 178 - static int sctp_print_conntrack(struct seq_file *s, struct nf_conn *ct) 178 + static void sctp_print_conntrack(struct seq_file *s, struct nf_conn *ct) 179 179 { 180 180 enum sctp_conntrack state; 181 181 ··· 183 183 state = ct->proto.sctp.state; 184 184 spin_unlock_bh(&ct->lock); 185 185 186 - return seq_printf(s, "%s ", sctp_conntrack_names[state]); 186 + seq_printf(s, "%s ", sctp_conntrack_names[state]); 187 187 } 188 188 189 189 #define for_each_sctp_chunk(skb, sch, _sch, offset, dataoff, count) \
+2 -2
net/netfilter/nf_conntrack_proto_tcp.c
··· 311 311 } 312 312 313 313 /* Print out the private part of the conntrack. */ 314 - static int tcp_print_conntrack(struct seq_file *s, struct nf_conn *ct) 314 + static void tcp_print_conntrack(struct seq_file *s, struct nf_conn *ct) 315 315 { 316 316 enum tcp_conntrack state; 317 317 ··· 319 319 state = ct->proto.tcp.state; 320 320 spin_unlock_bh(&ct->lock); 321 321 322 - return seq_printf(s, "%s ", tcp_conntrack_names[state]); 322 + seq_printf(s, "%s ", tcp_conntrack_names[state]); 323 323 } 324 324 325 325 static unsigned int get_conntrack_index(const struct tcphdr *tcph)
+2 -2
net/netfilter/nf_conntrack_standalone.c
··· 199 199 ? (long)(ct->timeout.expires - jiffies)/HZ : 0) != 0) 200 200 goto release; 201 201 202 - if (l4proto->print_conntrack && l4proto->print_conntrack(s, ct)) 203 - goto release; 202 + if (l4proto->print_conntrack) 203 + l4proto->print_conntrack(s, ct); 204 204 205 205 if (print_tuple(s, &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple, 206 206 l3proto, l4proto))