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

Commit 37246a58 authored by Steven Rostedt (Red Hat)'s avatar Steven Rostedt (Red Hat) Committed by Steven Rostedt
Browse files

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: default avatarPablo 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: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 1f33c41c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -60,7 +60,7 @@ struct nf_conntrack_l4proto {
			   const struct nf_conntrack_tuple *);
			   const struct nf_conntrack_tuple *);


	/* Print out the private part of the conntrack. */
	/* Print out the private part of the conntrack. */
	int (*print_conntrack)(struct seq_file *s, struct nf_conn *);
	void (*print_conntrack)(struct seq_file *s, struct nf_conn *);


	/* Return the array of timeouts for this protocol. */
	/* Return the array of timeouts for this protocol. */
	unsigned int *(*get_timeouts)(struct net *net);
	unsigned int *(*get_timeouts)(struct net *net);
+4 −1
Original line number Original line Diff line number Diff line
@@ -147,7 +147,10 @@ static int ct_seq_show(struct seq_file *s, void *v)
		      ? (long)(ct->timeout.expires - jiffies)/HZ : 0) != 0)
		      ? (long)(ct->timeout.expires - jiffies)/HZ : 0) != 0)
		goto release;
		goto release;


	if (l4proto->print_conntrack && l4proto->print_conntrack(s, ct))
	if (l4proto->print_conntrack)
		l4proto->print_conntrack(s, ct);

	if (seq_has_overflowed(s))
		goto release;
		goto release;


	if (print_tuple(s, &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple,
	if (print_tuple(s, &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple,
+2 −2
Original line number Original line Diff line number Diff line
@@ -626,9 +626,9 @@ static int dccp_print_tuple(struct seq_file *s,
			  ntohs(tuple->dst.u.dccp.port));
			  ntohs(tuple->dst.u.dccp.port));
}
}


static int dccp_print_conntrack(struct seq_file *s, struct nf_conn *ct)
static void dccp_print_conntrack(struct seq_file *s, struct nf_conn *ct)
{
{
	return seq_printf(s, "%s ", dccp_state_names[ct->proto.dccp.state]);
	seq_printf(s, "%s ", dccp_state_names[ct->proto.dccp.state]);
}
}


#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
#if IS_ENABLED(CONFIG_NF_CT_NETLINK)
+4 −4
Original line number Original line Diff line number Diff line
@@ -235,9 +235,9 @@ static int gre_print_tuple(struct seq_file *s,
}
}


/* print private data for conntrack */
/* print private data for conntrack */
static int gre_print_conntrack(struct seq_file *s, struct nf_conn *ct)
static void gre_print_conntrack(struct seq_file *s, struct nf_conn *ct)
{
{
	return seq_printf(s, "timeout=%u, stream_timeout=%u ",
	seq_printf(s, "timeout=%u, stream_timeout=%u ",
		   (ct->proto.gre.timeout / HZ),
		   (ct->proto.gre.timeout / HZ),
		   (ct->proto.gre.stream_timeout / HZ));
		   (ct->proto.gre.stream_timeout / HZ));
}
}
+2 −2
Original line number Original line Diff line number Diff line
@@ -175,7 +175,7 @@ static int sctp_print_tuple(struct seq_file *s,
}
}


/* Print out the private part of the conntrack. */
/* Print out the private part of the conntrack. */
static int sctp_print_conntrack(struct seq_file *s, struct nf_conn *ct)
static void sctp_print_conntrack(struct seq_file *s, struct nf_conn *ct)
{
{
	enum sctp_conntrack state;
	enum sctp_conntrack state;


@@ -183,7 +183,7 @@ static int sctp_print_conntrack(struct seq_file *s, struct nf_conn *ct)
	state = ct->proto.sctp.state;
	state = ct->proto.sctp.state;
	spin_unlock_bh(&ct->lock);
	spin_unlock_bh(&ct->lock);


	return seq_printf(s, "%s ", sctp_conntrack_names[state]);
	seq_printf(s, "%s ", sctp_conntrack_names[state]);
}
}


#define for_each_sctp_chunk(skb, sch, _sch, offset, dataoff, count)	\
#define for_each_sctp_chunk(skb, sch, _sch, offset, dataoff, count)	\
Loading