netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH 2/6] netlink: style fixes
Date: Sun, 11 Jan 2015 08:09:38 +0000	[thread overview]
Message-ID: <1420963782-21189-3-git-send-email-kaber@trash.net> (raw)
In-Reply-To: <1420963782-21189-1-git-send-email-kaber@trash.net>

We include an empty line between variable definitions and code.

Signed-off-by: Patrick McHardy <kaber@trash.net>
---
 src/netlink.c | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/src/netlink.c b/src/netlink.c
index ceb1d3f..cb22c30 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -48,10 +48,11 @@ const struct location netlink_location = {
 
 static struct mnl_socket *nfsock_open(void)
 {
-	struct mnl_socket *s = mnl_socket_open(NETLINK_NETFILTER);
+	struct mnl_socket *s;
+
+	s = mnl_socket_open(NETLINK_NETFILTER);
 	if (s == NULL)
 		netlink_open_error();
-
 	return s;
 }
 
@@ -1480,10 +1481,11 @@ struct nft_ruleset *netlink_dump_ruleset(struct netlink_ctx *ctx,
 
 static struct nft_table *netlink_table_alloc(const struct nlmsghdr *nlh)
 {
-	struct nft_table *nlt = nft_table_alloc();
+	struct nft_table *nlt;
+
+	nlt = nft_table_alloc();
 	if (nlt == NULL)
 		memory_allocation_error();
-
 	if (nft_table_nlmsg_parse(nlh, nlt) < 0)
 		netlink_abi_error();
 
@@ -1492,10 +1494,11 @@ static struct nft_table *netlink_table_alloc(const struct nlmsghdr *nlh)
 
 static struct nft_chain *netlink_chain_alloc(const struct nlmsghdr *nlh)
 {
-	struct nft_chain *nlc = nft_chain_alloc();
+	struct nft_chain *nlc;
+
+	nlc = nft_chain_alloc();
 	if (nlc == NULL)
 		memory_allocation_error();
-
 	if (nft_chain_nlmsg_parse(nlh, nlc) < 0)
 		netlink_abi_error();
 
@@ -1504,10 +1507,11 @@ static struct nft_chain *netlink_chain_alloc(const struct nlmsghdr *nlh)
 
 static struct nft_set *netlink_set_alloc(const struct nlmsghdr *nlh)
 {
-	struct nft_set *nls = nft_set_alloc();
+	struct nft_set *nls;
+
+	nls = nft_set_alloc();
 	if (nls == NULL)
 		memory_allocation_error();
-
 	if (nft_set_nlmsg_parse(nlh, nls) < 0)
 		netlink_abi_error();
 
@@ -1516,10 +1520,11 @@ static struct nft_set *netlink_set_alloc(const struct nlmsghdr *nlh)
 
 static struct nft_set *netlink_setelem_alloc(const struct nlmsghdr *nlh)
 {
-	struct nft_set *nls = nft_set_alloc();
+	struct nft_set *nls;
+
+	nls = nft_set_alloc();
 	if (nls == NULL)
 		memory_allocation_error();
-
 	if (nft_set_elems_nlmsg_parse(nlh, nls) < 0)
 		netlink_abi_error();
 
@@ -1528,10 +1533,11 @@ static struct nft_set *netlink_setelem_alloc(const struct nlmsghdr *nlh)
 
 static struct nft_rule *netlink_rule_alloc(const struct nlmsghdr *nlh)
 {
-	struct nft_rule *nlr = nft_rule_alloc();
+	struct nft_rule *nlr;
+
+	nlr = nft_rule_alloc();
 	if (nlr == NULL)
 		memory_allocation_error();
-
 	if (nft_rule_nlmsg_parse(nlh, nlr) < 0)
 		netlink_abi_error();
 
-- 
2.1.0


  parent reply	other threads:[~2015-01-11  8:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-11  8:09 [PATCH 0/6] netlink: style and readability fixes Patrick McHardy
2015-01-11  8:09 ` [PATCH 1/6] netlink: remove unnecessary temporary variable Patrick McHardy
2015-01-11  8:09 ` Patrick McHardy [this message]
2015-01-11  8:09 ` [PATCH 3/6] netlink: style fixes Patrick McHardy
2015-01-11  8:09 ` [PATCH 4/6] netlink: readability fixes Patrick McHardy
2015-01-11  8:09 ` [PATCH 5/6] netlink_delinearize: rename netlink_parse_*_sreg/dreg functions Patrick McHardy
2015-01-11  8:09 ` [PATCH 6/6] netlink_delinearize: cleanup hard to read code Patrick McHardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1420963782-21189-3-git-send-email-kaber@trash.net \
    --to=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).