* [PATCH 0/6] bonding:fix checkpatch errors or warning.
@ 2014-02-14 9:15 Wangyufen
2014-02-14 9:15 ` [PATCH 1/6] bonding:fix checkpatch errors with foo* bar|foo * bar Wangyufen
` (6 more replies)
0 siblings, 7 replies; 11+ messages in thread
From: Wangyufen @ 2014-02-14 9:15 UTC (permalink / raw)
To: davem; +Cc: netdev
From: Wang Yufen <wangyufen@huawei.com>
Wang Yufen (6):
bonding:fix checkpatch errors with foo* bar|foo * bar
bonding:fix checkpatch errors comments and space
bonding:fix checkpatch warnings braces {}
bonding:fix checkpatch warnings braces {}
bonding:fix checkpatch warnings braces {}
bonding:fix checkpatch warnings braces {}
drivers/net/bonding/bond_alb.c | 83 +++---
1 file changed, 30 insertions(+), 53 deletions(-)
--
1.7.12
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/6] bonding:fix checkpatch errors with foo* bar|foo * bar
2014-02-14 9:15 [PATCH 0/6] bonding:fix checkpatch errors or warning Wangyufen
@ 2014-02-14 9:15 ` Wangyufen
2014-02-14 9:15 ` [PATCH 2/6] bonding:fix checkpatch errors comments and space Wangyufen
` (5 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Wangyufen @ 2014-02-14 9:15 UTC (permalink / raw)
To: davem; +Cc: netdev
From: Wang Yufen <wangyufen@huawei.com>
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
---
drivers/net/bonding/bond_alb.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index a2c4747..b3b26b0 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -329,7 +329,7 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
_lock_rx_hashtbl_bh(bond);
- hash_index = _simple_hash((u8*)&(arp->ip_src), sizeof(arp->ip_src));
+ hash_index = _simple_hash((u8 *)&(arp->ip_src), sizeof(arp->ip_src));
client_info = &(bond_info->rx_hashtbl[hash_index]);
if ((client_info->assigned) &&
@@ -923,7 +923,7 @@ static void rlb_src_link(struct bonding *bond, u32 ip_src_hash, u32 ip_dst_hash)
static void rlb_purge_src_ip(struct bonding *bond, struct arp_pkt *arp)
{
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
- u32 ip_src_hash = _simple_hash((u8*)&(arp->ip_src), sizeof(arp->ip_src));
+ u32 ip_src_hash = _simple_hash((u8 *)&(arp->ip_src), sizeof(arp->ip_src));
u32 index;
_lock_rx_hashtbl_bh(bond);
@@ -1436,7 +1436,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
break;
}
- hash_start = (char*)eth_data->h_dest;
+ hash_start = (char *)eth_data->h_dest;
hash_size = ETH_ALEN;
break;
case ETH_P_ARP:
--
1.7.12
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/6] bonding:fix checkpatch errors comments and space
2014-02-14 9:15 [PATCH 0/6] bonding:fix checkpatch errors or warning Wangyufen
2014-02-14 9:15 ` [PATCH 1/6] bonding:fix checkpatch errors with foo* bar|foo * bar Wangyufen
@ 2014-02-14 9:15 ` Wangyufen
2014-02-14 9:15 ` [PATCH 3/6] bonding:fix checkpatch warnings braces {} Wangyufen
` (4 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Wangyufen @ 2014-02-14 9:15 UTC (permalink / raw)
To: davem; +Cc: netdev
From: Wang Yufen <wangyufen@huawei.com>
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
---
drivers/net/bonding/bond_alb.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index b3b26b0..af5ea21 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -610,10 +610,10 @@ static void rlb_req_update_slave_clients(struct bonding *bond, struct slave *sla
}
}
- // update the team's flag only after the whole iteration
+ /* update the team's flag only after the whole iteration */
if (ntt) {
bond_info->rx_ntt = 1;
- //fasten the change
+ /* fasten the change */
bond_info->rlb_update_retry_counter = RLB_UPDATE_RETRY;
}
@@ -771,7 +771,7 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
*/
tx_slave = rlb_choose_channel(skb, bond);
if (tx_slave) {
- memcpy(arp->mac_src,tx_slave->dev->dev_addr, ETH_ALEN);
+ memcpy(arp->mac_src, tx_slave->dev->dev_addr, ETH_ALEN);
}
pr_debug("Server sent ARP Reply packet\n");
} else if (arp->op_code == htons(ARPOP_REQUEST)) {
--
1.7.12
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/6] bonding:fix checkpatch warnings braces {}
2014-02-14 9:15 [PATCH 0/6] bonding:fix checkpatch errors or warning Wangyufen
2014-02-14 9:15 ` [PATCH 1/6] bonding:fix checkpatch errors with foo* bar|foo * bar Wangyufen
2014-02-14 9:15 ` [PATCH 2/6] bonding:fix checkpatch errors comments and space Wangyufen
@ 2014-02-14 9:15 ` Wangyufen
2014-02-14 9:15 ` [PATCH 4/6] " Wangyufen
` (3 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Wangyufen @ 2014-02-14 9:15 UTC (permalink / raw)
To: davem; +Cc: netdev
From: Wang Yufen <wangyufen@huawei.com>
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
---
drivers/net/bonding/bond_alb.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index af5ea21..a1d4e7a 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -93,9 +93,8 @@ static inline u8 _simple_hash(const u8 *hash_start, int hash_size)
int i;
u8 hash = 0;
- for (i = 0; i < hash_size; i++) {
+ for (i = 0; i < hash_size; i++)
hash ^= hash_start[i];
- }
return hash;
}
@@ -190,9 +189,8 @@ static int tlb_initialize(struct bonding *bond)
bond_info->tx_hashtbl = new_hashtbl;
- for (i = 0; i < TLB_HASH_TABLE_SIZE; i++) {
+ for (i = 0; i < TLB_HASH_TABLE_SIZE; i++)
tlb_init_table_entry(&bond_info->tx_hashtbl[i], 0);
- }
_unlock_tx_hashtbl_bh(bond);
@@ -264,9 +262,8 @@ static struct slave *__tlb_choose_channel(struct bonding *bond, u32 hash_index,
hash_table[hash_index].next = next_index;
hash_table[hash_index].prev = TLB_NULL_INDEX;
- if (next_index != TLB_NULL_INDEX) {
+ if (next_index != TLB_NULL_INDEX)
hash_table[next_index].prev = hash_index;
- }
slave_info->head = hash_index;
slave_info->load +=
@@ -274,9 +271,8 @@ static struct slave *__tlb_choose_channel(struct bonding *bond, u32 hash_index,
}
}
- if (assigned_slave) {
+ if (assigned_slave)
hash_table[hash_index].tx_bytes += skb_len;
- }
return assigned_slave;
}
@@ -451,9 +447,8 @@ static struct slave *__rlb_next_rx_slave(struct bonding *bond)
*/
static void rlb_teach_disabled_mac_on_primary(struct bonding *bond, u8 addr[])
{
- if (!bond->curr_active_slave) {
+ if (!bond->curr_active_slave)
return;
- }
if (!bond->alb_info.primary_is_promisc) {
if (!dev_set_promiscuity(bond->curr_active_slave->dev, 1))
@@ -513,9 +508,8 @@ static void rlb_clear_slave(struct bonding *bond, struct slave *slave)
write_lock_bh(&bond->curr_slave_lock);
- if (slave != bond->curr_active_slave) {
+ if (slave != bond->curr_active_slave)
rlb_teach_disabled_mac_on_primary(bond, slave->dev->dev_addr);
- }
write_unlock_bh(&bond->curr_slave_lock);
}
--
1.7.12
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/6] bonding:fix checkpatch warnings braces {}
2014-02-14 9:15 [PATCH 0/6] bonding:fix checkpatch errors or warning Wangyufen
` (2 preceding siblings ...)
2014-02-14 9:15 ` [PATCH 3/6] bonding:fix checkpatch warnings braces {} Wangyufen
@ 2014-02-14 9:15 ` Wangyufen
2014-02-14 22:37 ` Sergei Shtylyov
2014-02-14 9:15 ` [PATCH 5/6] " Wangyufen
` (2 subsequent siblings)
6 siblings, 1 reply; 11+ messages in thread
From: Wangyufen @ 2014-02-14 9:15 UTC (permalink / raw)
To: davem; +Cc: netdev
From: Wang Yufen <wangyufen@huawei.com>
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
---
drivers/net/bonding/bond_alb.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index a1d4e7a..cde39f0 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -518,9 +518,8 @@ static void rlb_update_client(struct rlb_client_info *client_info)
{
int i;
- if (!client_info->slave) {
+ if (!client_info->slave)
return;
- }
for (i = 0; i < RLB_ARP_BURST_SIZE; i++) {
struct sk_buff *skb;
@@ -568,9 +567,8 @@ static void rlb_update_rx_clients(struct bonding *bond)
client_info = &(bond_info->rx_hashtbl[hash_index]);
if (client_info->ntt) {
rlb_update_client(client_info);
- if (bond_info->rlb_update_retry_counter == 0) {
+ if (bond_info->rlb_update_retry_counter == 0)
client_info->ntt = 0;
- }
}
}
@@ -764,9 +762,8 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
* rx channel
*/
tx_slave = rlb_choose_channel(skb, bond);
- if (tx_slave) {
+ if (tx_slave)
memcpy(arp->mac_src, tx_slave->dev->dev_addr, ETH_ALEN);
- }
pr_debug("Server sent ARP Reply packet\n");
} else if (arp->op_code == htons(ARPOP_REQUEST)) {
/* Create an entry in the rx_hashtbl for this client as a
@@ -818,9 +815,8 @@ static void rlb_rebalance(struct bonding *bond)
}
/* update the team's flag only after the whole iteration */
- if (ntt) {
+ if (ntt)
bond_info->rx_ntt = 1;
- }
_unlock_rx_hashtbl_bh(bond);
}
@@ -951,9 +947,8 @@ static int rlb_initialize(struct bonding *bond)
bond_info->rx_hashtbl_used_head = RLB_NULL_INDEX;
- for (i = 0; i < RLB_HASH_TABLE_SIZE; i++) {
+ for (i = 0; i < RLB_HASH_TABLE_SIZE; i++)
rlb_init_table_entry(bond_info->rx_hashtbl + i);
- }
_unlock_rx_hashtbl_bh(bond);
@@ -1324,9 +1319,8 @@ int bond_alb_initialize(struct bonding *bond, int rlb_enabled)
int res;
res = tlb_initialize(bond);
- if (res) {
+ if (res)
return res;
- }
if (rlb_enabled) {
bond->alb_info.rlb_enabled = 1;
--
1.7.12
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 5/6] bonding:fix checkpatch warnings braces {}
2014-02-14 9:15 [PATCH 0/6] bonding:fix checkpatch errors or warning Wangyufen
` (3 preceding siblings ...)
2014-02-14 9:15 ` [PATCH 4/6] " Wangyufen
@ 2014-02-14 9:15 ` Wangyufen
2014-02-14 22:39 ` Sergei Shtylyov
2014-02-14 9:15 ` [PATCH 6/6] " Wangyufen
2014-02-14 21:22 ` [PATCH 0/6] bonding:fix checkpatch errors or warning David Miller
6 siblings, 1 reply; 11+ messages in thread
From: Wangyufen @ 2014-02-14 9:15 UTC (permalink / raw)
To: davem; +Cc: netdev
From: Wang Yufen <wangyufen@huawei.com>
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
---
drivers/net/bonding/bond_alb.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index cde39f0..e7a4600 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -1343,9 +1343,8 @@ void bond_alb_deinitialize(struct bonding *bond)
tlb_deinitialize(bond);
- if (bond_info->rlb_enabled) {
+ if (bond_info->rlb_enabled)
rlb_deinitialize(bond);
- }
}
int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
@@ -1429,9 +1428,8 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
break;
case ETH_P_ARP:
do_tx_balance = 0;
- if (bond_info->rlb_enabled) {
+ if (bond_info->rlb_enabled)
tx_slave = rlb_arp_xmit(skb, bond);
- }
break;
default:
do_tx_balance = 0;
@@ -1565,11 +1563,10 @@ void bond_alb_monitor(struct work_struct *work)
--bond_info->rlb_update_delay_counter;
} else {
rlb_update_rx_clients(bond);
- if (bond_info->rlb_update_retry_counter) {
+ if (bond_info->rlb_update_retry_counter)
--bond_info->rlb_update_retry_counter;
- } else {
+ else
bond_info->rx_ntt = 0;
- }
}
}
}
@@ -1586,23 +1583,20 @@ int bond_alb_init_slave(struct bonding *bond, struct slave *slave)
int res;
res = alb_set_slave_mac_addr(slave, slave->perm_hwaddr);
- if (res) {
+ if (res)
return res;
- }
res = alb_handle_addr_collision_on_attach(bond, slave);
- if (res) {
+ if (res)
return res;
- }
tlb_init_slave(slave);
/* order a rebalance ASAP */
bond->alb_info.tx_rebalance_counter = BOND_TLB_REBALANCE_TICKS;
- if (bond->alb_info.rlb_enabled) {
+ if (bond->alb_info.rlb_enabled)
bond->alb_info.rlb_rebalance = 1;
- }
return 0;
}
--
1.7.12
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 6/6] bonding:fix checkpatch warnings braces {}
2014-02-14 9:15 [PATCH 0/6] bonding:fix checkpatch errors or warning Wangyufen
` (4 preceding siblings ...)
2014-02-14 9:15 ` [PATCH 5/6] " Wangyufen
@ 2014-02-14 9:15 ` Wangyufen
2014-02-14 22:40 ` Sergei Shtylyov
2014-02-14 21:22 ` [PATCH 0/6] bonding:fix checkpatch errors or warning David Miller
6 siblings, 1 reply; 11+ messages in thread
From: Wangyufen @ 2014-02-14 9:15 UTC (permalink / raw)
To: davem; +Cc: netdev
From: Wang Yufen <wangyufen@huawei.com>
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
---
drivers/net/bonding/bond_alb.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index e7a4600..a212860 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -1627,9 +1627,8 @@ void bond_alb_handle_link_change(struct bonding *bond, struct slave *slave, char
if (link == BOND_LINK_DOWN) {
tlb_clear_slave(bond, slave, 0);
- if (bond->alb_info.rlb_enabled) {
+ if (bond->alb_info.rlb_enabled)
rlb_clear_slave(bond, slave);
- }
} else if (link == BOND_LINK_UP) {
/* order a rebalance ASAP */
bond_info->tx_rebalance_counter = BOND_TLB_REBALANCE_TICKS;
@@ -1741,14 +1740,12 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
struct slave *swap_slave;
int res;
- if (!is_valid_ether_addr(sa->sa_data)) {
+ if (!is_valid_ether_addr(sa->sa_data))
return -EADDRNOTAVAIL;
- }
res = alb_set_mac_address(bond, addr);
- if (res) {
+ if (res)
return res;
- }
memcpy(bond_dev->dev_addr, sa->sa_data, bond_dev->addr_len);
@@ -1756,9 +1753,8 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
* Otherwise we'll need to pass the new address to it and handle
* duplications.
*/
- if (!bond->curr_active_slave) {
+ if (!bond->curr_active_slave)
return 0;
- }
swap_slave = bond_slave_has_mac(bond, bond_dev->dev_addr);
@@ -1782,8 +1778,7 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
void bond_alb_clear_vlan(struct bonding *bond, unsigned short vlan_id)
{
- if (bond->alb_info.rlb_enabled) {
+ if (bond->alb_info.rlb_enabled)
rlb_clear_vlan(bond, vlan_id);
- }
}
--
1.7.12
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 0/6] bonding:fix checkpatch errors or warning.
2014-02-14 9:15 [PATCH 0/6] bonding:fix checkpatch errors or warning Wangyufen
` (5 preceding siblings ...)
2014-02-14 9:15 ` [PATCH 6/6] " Wangyufen
@ 2014-02-14 21:22 ` David Miller
6 siblings, 0 replies; 11+ messages in thread
From: David Miller @ 2014-02-14 21:22 UTC (permalink / raw)
To: wangyufen; +Cc: netdev
From: Wangyufen <wangyufen@huawei.com>
Date: Fri, 14 Feb 2014 17:15:11 +0800
> From: Wang Yufen <wangyufen@huawei.com>
>
> Wang Yufen (6):
> bonding:fix checkpatch errors with foo* bar|foo * bar
> bonding:fix checkpatch errors comments and space
> bonding:fix checkpatch warnings braces {}
> bonding:fix checkpatch warnings braces {}
> bonding:fix checkpatch warnings braces {}
> bonding:fix checkpatch warnings braces {}
Series applied, thanks.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 4/6] bonding:fix checkpatch warnings braces {}
2014-02-14 9:15 ` [PATCH 4/6] " Wangyufen
@ 2014-02-14 22:37 ` Sergei Shtylyov
0 siblings, 0 replies; 11+ messages in thread
From: Sergei Shtylyov @ 2014-02-14 22:37 UTC (permalink / raw)
To: Wangyufen, davem; +Cc: netdev
Hello.
On 02/14/2014 12:15 PM, Wangyufen wrote:
> From: Wang Yufen <wangyufen@huawei.com>
> Signed-off-by: Wang Yufen <wangyufen@huawei.com>
> ---
> drivers/net/bonding/bond_alb.c | 18 ++++++------------
> 1 file changed, 6 insertions(+), 12 deletions(-)
Should be merged with patch 3/6 as it's doing the same thing.
WBR, Sergei
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 5/6] bonding:fix checkpatch warnings braces {}
2014-02-14 9:15 ` [PATCH 5/6] " Wangyufen
@ 2014-02-14 22:39 ` Sergei Shtylyov
0 siblings, 0 replies; 11+ messages in thread
From: Sergei Shtylyov @ 2014-02-14 22:39 UTC (permalink / raw)
To: Wangyufen, davem; +Cc: netdev
On 02/14/2014 12:15 PM, Wangyufen wrote:
> From: Wang Yufen <wangyufen@huawei.com>
> Signed-off-by: Wang Yufen <wangyufen@huawei.com>
Should also be merged with 3/6.
WBR, Sergei
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 6/6] bonding:fix checkpatch warnings braces {}
2014-02-14 9:15 ` [PATCH 6/6] " Wangyufen
@ 2014-02-14 22:40 ` Sergei Shtylyov
0 siblings, 0 replies; 11+ messages in thread
From: Sergei Shtylyov @ 2014-02-14 22:40 UTC (permalink / raw)
To: Wangyufen, davem; +Cc: netdev
On 02/14/2014 12:15 PM, Wangyufen wrote:
> From: Wang Yufen <wangyufen@huawei.com>
> Signed-off-by: Wang Yufen <wangyufen@huawei.com>
Should also be merged with 3/6. I wonder how Dave applied the series in
which 4 patches have the same subject...
WBR, Sergei
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2014-02-14 21:40 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-14 9:15 [PATCH 0/6] bonding:fix checkpatch errors or warning Wangyufen
2014-02-14 9:15 ` [PATCH 1/6] bonding:fix checkpatch errors with foo* bar|foo * bar Wangyufen
2014-02-14 9:15 ` [PATCH 2/6] bonding:fix checkpatch errors comments and space Wangyufen
2014-02-14 9:15 ` [PATCH 3/6] bonding:fix checkpatch warnings braces {} Wangyufen
2014-02-14 9:15 ` [PATCH 4/6] " Wangyufen
2014-02-14 22:37 ` Sergei Shtylyov
2014-02-14 9:15 ` [PATCH 5/6] " Wangyufen
2014-02-14 22:39 ` Sergei Shtylyov
2014-02-14 9:15 ` [PATCH 6/6] " Wangyufen
2014-02-14 22:40 ` Sergei Shtylyov
2014-02-14 21:22 ` [PATCH 0/6] bonding:fix checkpatch errors or warning David Miller
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).