[PATCH net-next 0/4] net: bonding: clean up some code style issues

STALE1932d

6 messages, 2 authors, 2021-05-20 · open the first message on its own page

[PATCH net-next 0/4] net: bonding: clean up some code style issues

From: Guangbin Huang <hidden>
Date: 2021-05-20 06:21:49

This patchset cleans up some code style issues.

Yufeng Mo (4):
  net: bonding: add some required blank lines
  net: bonding: fix code indent for conditional statements
  net: bonding: remove unnecessary braces
  net: bonding: use tabs instead of space for code indent

 drivers/net/bonding/bond_alb.c     | 5 ++++-
 drivers/net/bonding/bond_debugfs.c | 3 +--
 drivers/net/bonding/bond_main.c    | 5 +++--
 drivers/net/bonding/bond_netlink.c | 2 +-
 drivers/net/bonding/bond_procfs.c  | 1 +
 drivers/net/bonding/bond_sysfs.c   | 7 +++++++
 6 files changed, 17 insertions(+), 6 deletions(-)

-- 
2.8.1

[PATCH net-next 3/4] net: bonding: remove unnecessary braces

From: Guangbin Huang <hidden>
Date: 2021-05-20 06:21:39

From: Yufeng Mo <redacted>

Braces {} are not necessary for single statement blocks,
so remove these braces {}.

Signed-off-by: Yufeng Mo <redacted>
Signed-off-by: Guangbin Huang <redacted>
---
 drivers/net/bonding/bond_debugfs.c | 3 +--
 drivers/net/bonding/bond_main.c    | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bonding/bond_debugfs.c b/drivers/net/bonding/bond_debugfs.c
index f3f86ef68ae0..4f9b4a18c74c 100644
--- a/drivers/net/bonding/bond_debugfs.c
+++ b/drivers/net/bonding/bond_debugfs.c
@@ -88,9 +88,8 @@ void bond_create_debugfs(void)
 {
 	bonding_debug_root = debugfs_create_dir("bonding", NULL);
 
-	if (!bonding_debug_root) {
+	if (!bonding_debug_root)
 		pr_warn("Warning: Cannot create bonding directory in debugfs\n");
-	}
 }
 
 void bond_destroy_debugfs(void)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index e786a9c42bfd..dafeaef3cbd3 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1013,9 +1013,8 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
 			if (bond_is_lb(bond))
 				bond_alb_handle_link_change(bond, new_active, BOND_LINK_UP);
 		} else {
-			if (bond_uses_primary(bond)) {
+			if (bond_uses_primary(bond))
 				slave_info(bond->dev, new_active->dev, "making interface the new active one\n");
-			}
 		}
 	}
 
-- 
2.8.1

[PATCH net-next 1/4] net: bonding: add some required blank lines

From: Guangbin Huang <hidden>
Date: 2021-05-20 06:21:42

From: Yufeng Mo <redacted>

Add some blank lines after declarations as required.

Signed-off-by: Yufeng Mo <redacted>
Signed-off-by: Guangbin Huang <redacted>
---
 drivers/net/bonding/bond_alb.c    | 3 +++
 drivers/net/bonding/bond_main.c   | 2 ++
 drivers/net/bonding/bond_procfs.c | 1 +
 drivers/net/bonding/bond_sysfs.c  | 7 +++++++
 4 files changed, 13 insertions(+)
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 3455f2cc13f2..c63e0d1faa63 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -104,6 +104,7 @@ static void __tlb_clear_slave(struct bonding *bond, struct slave *slave,
 		index = SLAVE_TLB_INFO(slave).head;
 		while (index != TLB_NULL_INDEX) {
 			u32 next_index = tx_hash_table[index].next;
+
 			tlb_init_table_entry(&tx_hash_table[index], save_load);
 			index = next_index;
 		}
@@ -628,6 +629,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb,
 
 		if (!client_info->assigned) {
 			u32 prev_tbl_head = bond_info->rx_hashtbl_used_head;
+
 			bond_info->rx_hashtbl_used_head = hash_index;
 			client_info->used_next = prev_tbl_head;
 			if (prev_tbl_head != RLB_NULL_INDEX) {
@@ -830,6 +832,7 @@ static void rlb_purge_src_ip(struct bonding *bond, struct arp_pkt *arp)
 	while (index != RLB_NULL_INDEX) {
 		struct rlb_client_info *entry = &(bond_info->rx_hashtbl[index]);
 		u32 next_index = entry->src_next;
+
 		if (entry->ip_src == arp->ip_src &&
 		    !ether_addr_equal_64bits(arp->mac_src, entry->mac_src))
 				rlb_delete_table_entry(bond, index);
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 20bbda1b36e1..e786a9c42bfd 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2272,6 +2272,7 @@ static int bond_release_and_destroy(struct net_device *bond_dev,
 static void bond_info_query(struct net_device *bond_dev, struct ifbond *info)
 {
 	struct bonding *bond = netdev_priv(bond_dev);
+
 	bond_fill_ifbond(bond, info);
 }
 
@@ -4849,6 +4850,7 @@ static const struct device_type bond_type = {
 static void bond_destructor(struct net_device *bond_dev)
 {
 	struct bonding *bond = netdev_priv(bond_dev);
+
 	if (bond->wq)
 		destroy_workqueue(bond->wq);
 }
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index 56d34be5e797..0fb1da361bb1 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -112,6 +112,7 @@ static void bond_info_show_master(struct seq_file *seq)
 	/* ARP information */
 	if (bond->params.arp_interval > 0) {
 		int printed = 0;
+
 		seq_printf(seq, "ARP Polling Interval (ms): %d\n",
 				bond->params.arp_interval);
 
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 2d615a93685e..5f9e9a240226 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -385,6 +385,7 @@ static ssize_t bonding_show_num_peer_notif(struct device *d,
 					   char *buf)
 {
 	struct bonding *bond = to_bond(d);
+
 	return sprintf(buf, "%d\n", bond->params.num_peer_notif);
 }
 static DEVICE_ATTR(num_grat_arp, 0644,
@@ -496,6 +497,7 @@ static ssize_t bonding_show_ad_aggregator(struct device *d,
 
 	if (BOND_MODE(bond) == BOND_MODE_8023AD) {
 		struct ad_info ad_info;
+
 		count = sprintf(buf, "%d\n",
 				bond_3ad_get_active_agg_info(bond, &ad_info)
 				?  0 : ad_info.aggregator_id);
@@ -516,6 +518,7 @@ static ssize_t bonding_show_ad_num_ports(struct device *d,
 
 	if (BOND_MODE(bond) == BOND_MODE_8023AD) {
 		struct ad_info ad_info;
+
 		count = sprintf(buf, "%d\n",
 				bond_3ad_get_active_agg_info(bond, &ad_info)
 				?  0 : ad_info.ports);
@@ -536,6 +539,7 @@ static ssize_t bonding_show_ad_actor_key(struct device *d,
 
 	if (BOND_MODE(bond) == BOND_MODE_8023AD && capable(CAP_NET_ADMIN)) {
 		struct ad_info ad_info;
+
 		count = sprintf(buf, "%d\n",
 				bond_3ad_get_active_agg_info(bond, &ad_info)
 				?  0 : ad_info.actor_key);
@@ -556,6 +560,7 @@ static ssize_t bonding_show_ad_partner_key(struct device *d,
 
 	if (BOND_MODE(bond) == BOND_MODE_8023AD && capable(CAP_NET_ADMIN)) {
 		struct ad_info ad_info;
+
 		count = sprintf(buf, "%d\n",
 				bond_3ad_get_active_agg_info(bond, &ad_info)
 				?  0 : ad_info.partner_key);
@@ -576,6 +581,7 @@ static ssize_t bonding_show_ad_partner_mac(struct device *d,
 
 	if (BOND_MODE(bond) == BOND_MODE_8023AD && capable(CAP_NET_ADMIN)) {
 		struct ad_info ad_info;
+
 		if (!bond_3ad_get_active_agg_info(bond, &ad_info))
 			count = sprintf(buf, "%pM\n", ad_info.partner_system);
 	}
@@ -660,6 +666,7 @@ static ssize_t bonding_show_tlb_dynamic_lb(struct device *d,
 					   char *buf)
 {
 	struct bonding *bond = to_bond(d);
+
 	return sprintf(buf, "%d\n", bond->params.tlb_dynamic_lb);
 }
 static DEVICE_ATTR(tlb_dynamic_lb, 0644,
-- 
2.8.1

[PATCH net-next 2/4] net: bonding: fix code indent for conditional statements

From: Guangbin Huang <hidden>
Date: 2021-05-20 06:21:44

From: Yufeng Mo <redacted>

Fix incorrect code indent for conditional statements.

Signed-off-by: Yufeng Mo <redacted>
Signed-off-by: Guangbin Huang <redacted>
---
 drivers/net/bonding/bond_alb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index c63e0d1faa63..269dad176df4 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -835,7 +835,7 @@ static void rlb_purge_src_ip(struct bonding *bond, struct arp_pkt *arp)
 
 		if (entry->ip_src == arp->ip_src &&
 		    !ether_addr_equal_64bits(arp->mac_src, entry->mac_src))
-				rlb_delete_table_entry(bond, index);
+			rlb_delete_table_entry(bond, index);
 		index = next_index;
 	}
 	spin_unlock_bh(&bond->mode_lock);
-- 
2.8.1

[PATCH net-next 4/4] net: bonding: use tabs instead of space for code indent

From: Guangbin Huang <hidden>
Date: 2021-05-20 06:21:46

From: Yufeng Mo <redacted>

Code indent should use tabs where possible, so
use tabs instead of space for code indent.

Signed-off-by: Yufeng Mo <redacted>
Signed-off-by: Guangbin Huang <redacted>
---
 drivers/net/bonding/bond_netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c
index f0f9138e967f..0561ece1ba45 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -598,7 +598,7 @@ static int bond_fill_info(struct sk_buff *skb,
 		goto nla_put_failure;
 
 	if (nla_put_u32(skb, IFLA_BOND_RESEND_IGMP,
-		        bond->params.resend_igmp))
+			bond->params.resend_igmp))
 		goto nla_put_failure;
 
 	if (nla_put_u8(skb, IFLA_BOND_NUM_PEER_NOTIF,
-- 
2.8.1

Re: [PATCH net-next 0/4] net: bonding: clean up some code style issues

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-05-20 22:50:14

Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

On Thu, 20 May 2021 14:18:31 +0800 you wrote:
This patchset cleans up some code style issues.

Yufeng Mo (4):
  net: bonding: add some required blank lines
  net: bonding: fix code indent for conditional statements
  net: bonding: remove unnecessary braces
  net: bonding: use tabs instead of space for code indent

[...]
Here is the summary with links:
  - [net-next,1/4] net: bonding: add some required blank lines
    https://git.kernel.org/netdev/net-next/c/86a5ad0a4608
  - [net-next,2/4] net: bonding: fix code indent for conditional statements
    https://git.kernel.org/netdev/net-next/c/8ce390bb9859
  - [net-next,3/4] net: bonding: remove unnecessary braces
    https://git.kernel.org/netdev/net-next/c/52333512701b
  - [net-next,4/4] net: bonding: use tabs instead of space for code indent
    https://git.kernel.org/netdev/net-next/c/97a1111d9ca6

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help