From patchwork Fri Feb 14 09:15:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Yufen X-Patchwork-Id: 320336 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 1CD2A2C0079 for ; Fri, 14 Feb 2014 20:17:58 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752407AbaBNJRd (ORCPT ); Fri, 14 Feb 2014 04:17:33 -0500 Received: from szxga01-in.huawei.com ([119.145.14.64]:64757 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752030AbaBNJQV (ORCPT ); Fri, 14 Feb 2014 04:16:21 -0500 Received: from 172.24.2.119 (EHLO szxeml211-edg.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BRI48127; Fri, 14 Feb 2014 17:16:16 +0800 (CST) Received: from SZXEML413-HUB.china.huawei.com (10.82.67.152) by szxeml211-edg.china.huawei.com (172.24.2.182) with Microsoft SMTP Server (TLS) id 14.3.158.1; Fri, 14 Feb 2014 17:15:21 +0800 Received: from localhost (10.177.25.231) by szxeml413-hub.china.huawei.com (10.82.67.152) with Microsoft SMTP Server id 14.3.158.1; Fri, 14 Feb 2014 17:15:18 +0800 From: Wangyufen To: CC: Subject: [PATCH 3/6] bonding:fix checkpatch warnings braces {} Date: Fri, 14 Feb 2014 17:15:14 +0800 Message-ID: <1392369317-8072-4-git-send-email-wangyufen@huawei.com> X-Mailer: git-send-email 1.8.1.msysgit.1 In-Reply-To: <1392369317-8072-1-git-send-email-wangyufen@huawei.com> References: <1392369317-8072-1-git-send-email-wangyufen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.25.231] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Wang Yufen Signed-off-by: Wang Yufen --- 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); }