From patchwork Fri Apr 5 17:31:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 161883 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp706839jan; Fri, 5 Apr 2019 10:29:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQ4Yv2vXixmgcgk+Vxir/yHA8udA8tOcm+8J7AHSCv6LwZfQhDrHZwm+UudN8i+6aRFUhH X-Received: by 2002:a62:b40b:: with SMTP id h11mr13919784pfn.133.1554485356643; Fri, 05 Apr 2019 10:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554485356; cv=none; d=google.com; s=arc-20160816; b=fqhu82eeHxE5LaDn528dUmWJyC66XwQHqeGZGOqzpMKKx0Tg0Su7LbsT9wGJG9dr/9 a4IkpsI2yrl9FuyZXC4SLBZw0TQ2Zdd+au1Vg6qhsJ7DfoCmcRKNlmwKXGxYrWHrEcR8 L9oOTMROGMZlmtzo2EK8ZocHj5HfwoN+xalHS4Necl+7JQFENo5pqEAYYNTFXHG4XkGa s13xt7djN6lc/B/cribEuApSpU1Hdalz+QVazRwG1/F3d+z9OckmFUvuDkJccm0jsy93 tS2DiCx5+sIKI1RruwcmFxSEjIJHJqhtXxD/x0GuRjmDjFIOZ4SnkwyEDlWIb2bjAs19 b0og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=hbpq4wY/xSLuA290tvxugCvCOnPOH5njRJ+/cZa0mBA=; b=BhAYj9FcDj/Q22j66Fbpr7SnIW++8e+c8TGTGnPtiEXtbHkXhVOGEN7BclkyOH6tuY 0zvktMnwmieBMlRrsWDplEQ9V6HWYRlWGAzDwkKr54yD9TcuMkaTuk5OYxHSOz7Jba2k /m+5BxjQHWUDjYiGkscDtejpp/THed9HZl54b00nioeV0A/kg3utoWs0H2pMwWVCibac 5Nv21vxRnYEoIIEx0ywxy+0EUXdBjNO8J6cMi+WChsaPrnLNBEoITpbIiv3UJNGSm62a KUwZev+Arq11Xs1LEW2zIi4HxxkVsZf2D1pagpeN7cVaSt5+ZJY9OWxnQTPrGD5frJVC PQYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=OrxYMy0U; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9si19145384pff.52.2019.04.05.10.29.16; Fri, 05 Apr 2019 10:29:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=OrxYMy0U; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731779AbfDER3P (ORCPT + 31 others); Fri, 5 Apr 2019 13:29:15 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:56304 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731454AbfDER3G (ORCPT ); Fri, 5 Apr 2019 13:29:06 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x35HSuau130974; Fri, 5 Apr 2019 12:28:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1554485336; bh=hbpq4wY/xSLuA290tvxugCvCOnPOH5njRJ+/cZa0mBA=; h=From:To:Subject:Date:In-Reply-To:References; b=OrxYMy0Uoo9Sg/dq2bqY5FH8WaahwRpXu31dBvOHTql7MIT18DV9wBLx9SA/qr/Gz zXzFBaD80F6xm+PtDFsfXODiLoJAKSvktHkRB77MgP7/d9gWYg06obMQRawir+Yz54 xk8QX2xFpORALHZqpV3l944TnASP3FEdip0JMAIk= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x35HSufr096289 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 5 Apr 2019 12:28:56 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 5 Apr 2019 12:28:55 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 5 Apr 2019 12:28:55 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x35HSsuO095744; Fri, 5 Apr 2019 12:28:55 -0500 From: Murali Karicheri To: , , , , Subject: [PATCH net 01/14] net: hsr: fix lines exceeding 80 characters Date: Fri, 5 Apr 2019 13:31:23 -0400 Message-ID: <20190405173136.18050-2-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190405173136.18050-1-m-karicheri2@ti.com> References: <20190405173136.18050-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fixes lines exceeding 80 characters. This is seen when ran checkpatch.pl with -f option for files under net/hsr. Signed-off-by: Murali Karicheri --- net/hsr/hsr_forward.c | 3 ++- net/hsr/hsr_framereg.c | 8 +++++--- net/hsr/hsr_main.c | 3 ++- net/hsr/hsr_main.h | 8 ++++---- net/hsr/hsr_netlink.c | 31 ++++++++++++++++++------------- 5 files changed, 31 insertions(+), 22 deletions(-) -- 2.17.0 diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index 04b5450c5a55..5346127708ae 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c @@ -75,7 +75,8 @@ static bool is_supervision_frame(struct hsr_priv *hsr, struct sk_buff *skb) hsrSupTag = &hsrV1Hdr->hsr_sup; } else { - hsrSupTag = &((struct hsrv0_ethhdr_sp *) skb_mac_header(skb))->hsr_sup; + hsrSupTag = + &((struct hsrv0_ethhdr_sp *) skb_mac_header(skb))->hsr_sup; } if ((hsrSupTag->HSR_TLV_Type != HSR_TLV_ANNOUNCE) && diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index 9af16cb68f76..5cd74d99abe9 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c @@ -255,7 +255,8 @@ void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr, if (!node_curr->time_in_stale[i] && time_after(node_curr->time_in[i], node_real->time_in[i])) { node_real->time_in[i] = node_curr->time_in[i]; - node_real->time_in_stale[i] = node_curr->time_in_stale[i]; + node_real->time_in_stale[i] = + node_curr->time_in_stale[i]; } if (seq_nr_after(node_curr->seq_out[i], node_real->seq_out[i])) node_real->seq_out[i] = node_curr->seq_out[i]; @@ -308,7 +309,8 @@ void hsr_addr_subst_dest(struct hsr_node *node_src, struct sk_buff *skb, if (!is_unicast_ether_addr(eth_hdr(skb)->h_dest)) return; - node_dst = find_node_by_AddrA(&port->hsr->node_db, eth_hdr(skb)->h_dest); + node_dst = find_node_by_AddrA(&port->hsr->node_db, + eth_hdr(skb)->h_dest); if (!node_dst) { WARN_ONCE(1, "%s: Unknown node\n", __func__); return; @@ -419,7 +421,7 @@ void hsr_prune_nodes(struct timer_list *t) /* Prune old entries */ if (time_is_before_jiffies(timestamp + - msecs_to_jiffies(HSR_NODE_FORGET_TIME))) { + msecs_to_jiffies(HSR_NODE_FORGET_TIME))) { hsr_nl_nodedown(hsr, node->MacAddressA); list_del_rcu(&node->mac_list); /* Note that we need to free this entry later: */ diff --git a/net/hsr/hsr_main.c b/net/hsr/hsr_main.c index cd37d0011b42..b7a4cf62286b 100644 --- a/net/hsr/hsr_main.c +++ b/net/hsr/hsr_main.c @@ -63,7 +63,8 @@ static int hsr_netdev_notify(struct notifier_block *nb, unsigned long event, if (port->type == HSR_PT_SLAVE_A) { ether_addr_copy(master->dev->dev_addr, dev->dev_addr); - call_netdevice_notifiers(NETDEV_CHANGEADDR, master->dev); + call_netdevice_notifiers(NETDEV_CHANGEADDR, + master->dev); } /* Make sure we recognize frames from ourselves in hsr_rcv() */ diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h index 9b9909e89e9e..6f05dc90aa9b 100644 --- a/net/hsr/hsr_main.h +++ b/net/hsr/hsr_main.h @@ -83,8 +83,8 @@ static inline u16 get_hsr_tag_LSDU_size(struct hsr_tag *ht) static inline void set_hsr_tag_path(struct hsr_tag *ht, u16 path) { - ht->path_and_LSDU_size = htons( - (ntohs(ht->path_and_LSDU_size) & 0x0FFF) | (path << 12)); + ht->path_and_LSDU_size = + htons((ntohs(ht->path_and_LSDU_size) & 0x0FFF) | (path << 12)); } static inline void set_hsr_tag_LSDU_size(struct hsr_tag *ht, u16 LSDU_size) @@ -171,8 +171,8 @@ struct hsr_priv { struct timer_list prune_timer; int announce_count; u16 sequence_nr; - u16 sup_sequence_nr; /* For HSRv1 separate seq_nr for supervision */ - u8 protVersion; /* Indicate if HSRv0 or HSRv1. */ + u16 sup_sequence_nr; /* For HSRv1 separate seq_nr for supervision */ + u8 protVersion; /* Indicate if HSRv0 or HSRv1. */ spinlock_t seqnr_lock; /* locking for sequence_nr */ unsigned char sup_multicast_addr[ETH_ALEN]; }; diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c index b9cce0fd5696..654d22dd428d 100644 --- a/net/hsr/hsr_netlink.c +++ b/net/hsr/hsr_netlink.c @@ -47,12 +47,14 @@ static int hsr_newlink(struct net *src_net, struct net_device *dev, netdev_info(dev, "HSR: Slave1 device not specified\n"); return -EINVAL; } - link[0] = __dev_get_by_index(src_net, nla_get_u32(data[IFLA_HSR_SLAVE1])); + link[0] = __dev_get_by_index(src_net, + nla_get_u32(data[IFLA_HSR_SLAVE1])); if (!data[IFLA_HSR_SLAVE2]) { netdev_info(dev, "HSR: Slave2 device not specified\n"); return -EINVAL; } - link[1] = __dev_get_by_index(src_net, nla_get_u32(data[IFLA_HSR_SLAVE2])); + link[1] = __dev_get_by_index(src_net, + nla_get_u32(data[IFLA_HSR_SLAVE2])); if (!link[0] || !link[1]) return -ENODEV; @@ -156,7 +158,8 @@ void hsr_nl_ringerror(struct hsr_priv *hsr, unsigned char addr[ETH_ALEN], if (!skb) goto fail; - msg_head = genlmsg_put(skb, 0, 0, &hsr_genl_family, 0, HSR_C_RING_ERROR); + msg_head = genlmsg_put(skb, 0, 0, &hsr_genl_family, 0, + HSR_C_RING_ERROR); if (!msg_head) goto nla_put_failure; @@ -260,7 +263,7 @@ static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info) goto invalid; hsr_dev = __dev_get_by_index(genl_info_net(info), - nla_get_u32(info->attrs[HSR_A_IFINDEX])); + nla_get_u32(info->attrs[HSR_A_IFINDEX])); if (!hsr_dev) goto invalid; if (!is_hsr_master(hsr_dev)) @@ -289,13 +292,14 @@ static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info) hsr = netdev_priv(hsr_dev); res = hsr_get_node_data(hsr, - (unsigned char *) nla_data(info->attrs[HSR_A_NODE_ADDR]), - hsr_node_addr_b, - &addr_b_ifindex, - &hsr_node_if1_age, - &hsr_node_if1_seq, - &hsr_node_if2_age, - &hsr_node_if2_seq); + (unsigned char *) + nla_data(info->attrs[HSR_A_NODE_ADDR]), + hsr_node_addr_b, + &addr_b_ifindex, + &hsr_node_if1_age, + &hsr_node_if1_seq, + &hsr_node_if2_age, + &hsr_node_if2_seq); if (res < 0) goto nla_put_failure; @@ -306,11 +310,12 @@ static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info) if (addr_b_ifindex > -1) { res = nla_put(skb_out, HSR_A_NODE_ADDR_B, ETH_ALEN, - hsr_node_addr_b); + hsr_node_addr_b); if (res < 0) goto nla_put_failure; - res = nla_put_u32(skb_out, HSR_A_ADDR_B_IFINDEX, addr_b_ifindex); + res = nla_put_u32(skb_out, HSR_A_ADDR_B_IFINDEX, + addr_b_ifindex); if (res < 0) goto nla_put_failure; } From patchwork Fri Apr 5 17:31:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 161894 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp708862jan; Fri, 5 Apr 2019 10:31:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVMO0kpsKU+wtN0ZLuCSXyv8CKo9QIODIa/80hbJFvxNayk2JG3TVzP5TqtkH7LNLYp7gU X-Received: by 2002:a17:902:3e3:: with SMTP id d90mr14213522pld.271.1554485470974; Fri, 05 Apr 2019 10:31:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554485470; cv=none; d=google.com; s=arc-20160816; b=Dgr56raoEg8klyX1s7Ct9pL3SVOvr4m1OKKgVCKBUqEdBOiTduFfnqjjIRHul3DyAI pYaDfYKecrSyKnuxvzj4Mc3+eNQwMywScQqnPAJnwF2163HE9RcvGgeuijdo5f2FrPDH WrZKcRpB+7ydKuDqKJRJJZRh7/bdOz0ydFtHiVBQw2qKNRRduXbwp1Egqu6AdQ/4SezB 4viAxG0DfpJDjV2jbLrkZbs0bUQrPulSKyXwgEP6f4fu9vOBRBz/xFHpLyCA+5arr2Zr oKKgveAIzy9lyfMYxcRweCMmJC98FGPvrPvImWxCdwUJT88XM0lmByydr3vIHBT4T5fm Ptfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=RmJLF95n3S9mjBjc3QNZt/Dfc7HeqSQHMON4v9t/6Z4=; b=Zvgr/LmOHxxOMm0hT7WcrsRJ6bRFKZTYXkSlSxWxqzZexGKIXlt0+SIyQ/OsaBDrE6 R9l8rUHF///9K0N6SfI68P4ZDl4M/Lm1ZEkaQ+nBzg7VKTEnKZgImX3HhAZkbuwa5sac HaPmbWX3ESKTRqDwKZ0oslu4askn0/Bc5+4/WXYyiYSc3V7qwgiKnE8jyOQRXxN6hLPf PT+8ayFRxIq4M/KXAuTrGZeIbvaqLnNnuGiVoCm+0iJGCi4Tntl4TA7mg/xPbh5nnEEK LR/72Os/kUhvNYoT8OzRUxc+X3+Y6jEp9CE6goZjhvpL2Y396xpzs+xEU/JwjNJD3f6p nxsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=nwP4seM5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id be7si12868462plb.266.2019.04.05.10.31.10; Fri, 05 Apr 2019 10:31:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=nwP4seM5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731700AbfDERbJ (ORCPT + 31 others); Fri, 5 Apr 2019 13:31:09 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:48576 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730329AbfDER3B (ORCPT ); Fri, 5 Apr 2019 13:29:01 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x35HSuA6063296; Fri, 5 Apr 2019 12:28:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1554485336; bh=RmJLF95n3S9mjBjc3QNZt/Dfc7HeqSQHMON4v9t/6Z4=; h=From:To:Subject:Date:In-Reply-To:References; b=nwP4seM5ROoTaF7jMnJRFgEgLbrWBmk4CeyInlsHhImCLLxpxp3U9JfNK7oyJaPAQ XIAYjpqv67rt+WBrbmfEJCZ+bbsF/Mo5+pzJvoueEammBj7bRR0mTs83Xt5iE0xUhJ l8tsUtTBI4h2e5+iZDIL5K+y6+LxpBJgmVEseELw= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x35HSuar096319 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 5 Apr 2019 12:28:56 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 5 Apr 2019 12:28:56 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 5 Apr 2019 12:28:55 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x35HSsuP095744; Fri, 5 Apr 2019 12:28:55 -0500 From: Murali Karicheri To: , , , , Subject: [PATCH net 02/14] net: hsr: fix multiple blank lines in the code Date: Fri, 5 Apr 2019 13:31:24 -0400 Message-ID: <20190405173136.18050-3-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190405173136.18050-1-m-karicheri2@ti.com> References: <20190405173136.18050-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fixes multiple blank lines in the code. This is seen when ran checkpatch.pl -f option for files under net/hsr Signed-off-by: Murali Karicheri --- net/hsr/hsr_device.c | 10 ---------- net/hsr/hsr_forward.c | 8 -------- net/hsr/hsr_framereg.c | 12 ------------ net/hsr/hsr_main.c | 3 --- net/hsr/hsr_main.h | 7 ------- net/hsr/hsr_netlink.c | 12 ------------ net/hsr/hsr_slave.c | 3 --- 7 files changed, 55 deletions(-) -- 2.17.0 diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index a97bf326b231..34b6d6e8020f 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -23,7 +23,6 @@ #include "hsr_main.h" #include "hsr_forward.h" - static bool is_admin_up(struct net_device *dev) { return dev && (dev->flags & IFF_UP); @@ -82,7 +81,6 @@ static bool hsr_check_carrier(struct hsr_port *master) return has_carrier; } - static void hsr_check_announce(struct net_device *hsr_dev, unsigned char old_operstate) { @@ -136,7 +134,6 @@ int hsr_get_max_mtu(struct hsr_priv *hsr) return mtu_max - HSR_HLEN; } - static int hsr_dev_change_mtu(struct net_device *dev, int new_mtu) { struct hsr_priv *hsr; @@ -191,14 +188,12 @@ static int hsr_dev_open(struct net_device *dev) return 0; } - static int hsr_dev_close(struct net_device *dev) { /* Nothing to do here. */ return 0; } - static netdev_features_t hsr_features_recompute(struct hsr_priv *hsr, netdev_features_t features) { @@ -231,7 +226,6 @@ static netdev_features_t hsr_fix_features(struct net_device *dev, return hsr_features_recompute(hsr, features); } - static int hsr_dev_xmit(struct sk_buff *skb, struct net_device *dev) { struct hsr_priv *hsr = netdev_priv(dev); @@ -244,7 +238,6 @@ static int hsr_dev_xmit(struct sk_buff *skb, struct net_device *dev) return NETDEV_TX_OK; } - static const struct header_ops hsr_header_ops = { .create = eth_header, .parse = eth_header_parse, @@ -324,7 +317,6 @@ static void send_hsr_supervision_frame(struct hsr_port *master, kfree_skb(skb); } - /* Announce (supervision frame) timer function */ static void hsr_announce(struct timer_list *t) @@ -357,7 +349,6 @@ static void hsr_announce(struct timer_list *t) rcu_read_unlock(); } - /* According to comments in the declaration of struct net_device, this function * is "Called from unregister, can be used to call free_netdev". Ok then... */ @@ -423,7 +414,6 @@ void hsr_dev_setup(struct net_device *dev) dev->features |= NETIF_F_NETNS_LOCAL; } - /* Return true if dev is a HSR master; return false otherwise. */ inline bool is_hsr_master(struct net_device *dev) diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index 5346127708ae..70220e5a389a 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c @@ -17,7 +17,6 @@ #include "hsr_main.h" #include "hsr_framereg.h" - struct hsr_node; struct hsr_frame_info { @@ -32,7 +31,6 @@ struct hsr_frame_info { bool is_local_exclusive; }; - /* The uses I can see for these HSR supervision frames are: * 1) Use the frames that are sent after node initialization ("HSR_TLV.Type = * 22") to reset any sequence_nr counters belonging to that node. Useful if @@ -90,7 +88,6 @@ static bool is_supervision_frame(struct hsr_priv *hsr, struct sk_buff *skb) return true; } - static struct sk_buff *create_stripped_skb(struct sk_buff *skb_in, struct hsr_frame_info *frame) { @@ -128,7 +125,6 @@ static struct sk_buff *frame_get_stripped_skb(struct hsr_frame_info *frame, return skb_clone(frame->skb_std, GFP_ATOMIC); } - static void hsr_fill_tag(struct sk_buff *skb, struct hsr_frame_info *frame, struct hsr_port *port, u8 protoVersion) { @@ -203,7 +199,6 @@ static struct sk_buff *frame_get_tagged_skb(struct hsr_frame_info *frame, return create_tagged_skb(frame->skb_std, frame, port); } - static void hsr_deliver_master(struct sk_buff *skb, struct net_device *dev, struct hsr_node *node_src) { @@ -238,7 +233,6 @@ static int hsr_xmit(struct sk_buff *skb, struct hsr_port *port, return dev_queue_xmit(skb); } - /* Forward the frame through all devices except: * - Back through the receiving device * - If it's a HSR frame: through a device where it has passed before @@ -297,7 +291,6 @@ static void hsr_forward_do(struct hsr_frame_info *frame) } } - static void check_local_dest(struct hsr_priv *hsr, struct sk_buff *skb, struct hsr_frame_info *frame) { @@ -317,7 +310,6 @@ static void check_local_dest(struct hsr_priv *hsr, struct sk_buff *skb, } } - static int hsr_fill_frame_info(struct hsr_frame_info *frame, struct sk_buff *skb, struct hsr_port *port) { diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index 5cd74d99abe9..47dbaf2faefa 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c @@ -22,7 +22,6 @@ #include "hsr_framereg.h" #include "hsr_netlink.h" - struct hsr_node { struct list_head mac_list; unsigned char MacAddressA[ETH_ALEN]; @@ -35,10 +34,8 @@ struct hsr_node { struct rcu_head rcu_head; }; - /* TODO: use hash lists for mac addresses (linux/jhash.h)? */ - /* seq_nr_after(a, b) - return true if a is after (higher in sequence than) b, * false otherwise. */ @@ -56,7 +53,6 @@ static bool seq_nr_after(u16 a, u16 b) #define seq_nr_after_or_eq(a, b) (!seq_nr_before((a), (b))) #define seq_nr_before_or_eq(a, b) (!seq_nr_after((a), (b))) - bool hsr_addr_is_self(struct hsr_priv *hsr, unsigned char *addr) { struct hsr_node *node; @@ -91,7 +87,6 @@ static struct hsr_node *find_node_by_AddrA(struct list_head *node_db, return NULL; } - /* Helper for device init; the self_node_db is used in hsr_rcv() to recognize * frames from self that's been looped over the HSR ring. */ @@ -270,7 +265,6 @@ void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr, skb_push(skb, sizeof(struct hsrv1_ethhdr_sp)); } - /* 'skb' is a frame meant for this host, that is to be passed to upper layers. * * If the frame was sent by a node's B interface, replace the source @@ -321,7 +315,6 @@ void hsr_addr_subst_dest(struct hsr_node *node_src, struct sk_buff *skb, ether_addr_copy(eth_hdr(skb)->h_dest, node_dst->MacAddressB); } - void hsr_register_frame_in(struct hsr_node *node, struct hsr_port *port, u16 sequence_nr) { @@ -354,7 +347,6 @@ int hsr_register_frame_out(struct hsr_port *port, struct hsr_node *node, return 0; } - static struct hsr_port *get_late_port(struct hsr_priv *hsr, struct hsr_node *node) { @@ -375,7 +367,6 @@ static struct hsr_port *get_late_port(struct hsr_priv *hsr, return NULL; } - /* Remove stale sequence_nr records. Called by timer every * HSR_LIFE_CHECK_INTERVAL (two seconds or so). */ @@ -431,7 +422,6 @@ void hsr_prune_nodes(struct timer_list *t) rcu_read_unlock(); } - void *hsr_get_next_node(struct hsr_priv *hsr, void *_pos, unsigned char addr[ETH_ALEN]) { @@ -454,7 +444,6 @@ void *hsr_get_next_node(struct hsr_priv *hsr, void *_pos, return NULL; } - int hsr_get_node_data(struct hsr_priv *hsr, const unsigned char *addr, unsigned char addr_b[ETH_ALEN], @@ -468,7 +457,6 @@ int hsr_get_node_data(struct hsr_priv *hsr, struct hsr_port *port; unsigned long tdiff; - rcu_read_lock(); node = find_node_by_AddrA(&hsr->node_db, addr); if (!node) { diff --git a/net/hsr/hsr_main.c b/net/hsr/hsr_main.c index b7a4cf62286b..0d4ab8fc0aa1 100644 --- a/net/hsr/hsr_main.c +++ b/net/hsr/hsr_main.c @@ -19,7 +19,6 @@ #include "hsr_framereg.h" #include "hsr_slave.h" - static int hsr_netdev_notify(struct notifier_block *nb, unsigned long event, void *ptr) { @@ -98,7 +97,6 @@ static int hsr_netdev_notify(struct notifier_block *nb, unsigned long event, return NOTIFY_DONE; } - struct hsr_port *hsr_port_get_hsr(struct hsr_priv *hsr, enum hsr_port_type pt) { struct hsr_port *port; @@ -113,7 +111,6 @@ static struct notifier_block hsr_nb = { .notifier_call = hsr_netdev_notify, /* Slave event notifications */ }; - static int __init hsr_init(void) { int res; diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h index 6f05dc90aa9b..3504f0647942 100644 --- a/net/hsr/hsr_main.h +++ b/net/hsr/hsr_main.h @@ -15,7 +15,6 @@ #include #include - /* Time constants as specified in the HSR specification (IEC-62439-3 2010) * Table 8. * All values in milliseconds. @@ -24,7 +23,6 @@ #define HSR_NODE_FORGET_TIME 60000 /* ms */ #define HSR_ANNOUNCE_INTERVAL 100 /* ms */ - /* By how much may slave1 and slave2 timestamps of latest received frame from * each node differ before we notify of communication problem? */ @@ -32,17 +30,14 @@ #define HSR_SEQNR_START (USHRT_MAX - 1024) #define HSR_SUP_SEQNR_START (HSR_SEQNR_START / 2) - /* How often shall we check for broken ring and remove node entries older than * HSR_NODE_FORGET_TIME? */ #define PRUNE_PERIOD 3000 /* ms */ - #define HSR_TLV_ANNOUNCE 22 #define HSR_TLV_LIFE_CHECK 23 - /* HSR Tag. * As defined in IEC-62439-3:2010, the HSR tag is really { ethertype = 0x88FB, * path, LSDU_size, sequence Nr }. But we let eth_header() create { h_dest, @@ -99,7 +94,6 @@ struct hsr_ethhdr { struct hsr_tag hsr_tag; } __packed; - /* HSR Supervision Frame data types. * Field names as defined in the IEC:2010 standard for HSR. */ @@ -145,7 +139,6 @@ struct hsrv1_ethhdr_sp { struct hsr_sup_tag hsr_sup; } __packed; - enum hsr_port_type { HSR_PT_NONE = 0, /* Must be 0, used by framereg */ HSR_PT_SLAVE_A, diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c index 654d22dd428d..39768382be24 100644 --- a/net/hsr/hsr_netlink.c +++ b/net/hsr/hsr_netlink.c @@ -28,7 +28,6 @@ static const struct nla_policy hsr_policy[IFLA_HSR_MAX + 1] = { [IFLA_HSR_SEQ_NR] = { .type = NLA_U16 }, }; - /* Here, it seems a netdevice has already been allocated for us, and the * hsr_dev_setup routine has been executed. Nice! */ @@ -121,8 +120,6 @@ static struct rtnl_link_ops hsr_link_ops __read_mostly = { .fill_info = hsr_fill_info, }; - - /* attribute policy */ static const struct nla_policy hsr_genl_policy[HSR_A_MAX + 1] = { [HSR_A_NODE_ADDR] = { .len = ETH_ALEN }, @@ -140,8 +137,6 @@ static const struct genl_multicast_group hsr_mcgrps[] = { { .name = "hsr-network", }, }; - - /* This is called if for some node with MAC address addr, we only get frames * over one of the slave interfaces. This would indicate an open network ring * (i.e. a link has failed somewhere). @@ -204,7 +199,6 @@ void hsr_nl_nodedown(struct hsr_priv *hsr, unsigned char addr[ETH_ALEN]) if (!msg_head) goto nla_put_failure; - res = nla_put(skb, HSR_A_NODE_ADDR, ETH_ALEN, addr); if (res < 0) goto nla_put_failure; @@ -224,7 +218,6 @@ void hsr_nl_nodedown(struct hsr_priv *hsr, unsigned char addr[ETH_ALEN]) rcu_read_unlock(); } - /* HSR_C_GET_NODE_STATUS lets userspace query the internal HSR node table * about the status of a specific node in the network, defined by its MAC * address. @@ -269,9 +262,7 @@ static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info) if (!is_hsr_master(hsr_dev)) goto invalid; - /* Send reply */ - skb_out = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); if (!skb_out) { res = -ENOMEM; @@ -397,9 +388,7 @@ static int hsr_get_node_list(struct sk_buff *skb_in, struct genl_info *info) if (!is_hsr_master(hsr_dev)) goto invalid; - /* Send reply */ - skb_out = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); if (!skb_out) { res = -ENOMEM; @@ -449,7 +438,6 @@ static int hsr_get_node_list(struct sk_buff *skb_in, struct genl_info *info) return res; } - static const struct genl_ops hsr_ops[] = { { .cmd = HSR_C_GET_NODE_STATUS, diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c index 56080da4aa77..80151c255a1d 100644 --- a/net/hsr/hsr_slave.c +++ b/net/hsr/hsr_slave.c @@ -18,7 +18,6 @@ #include "hsr_forward.h" #include "hsr_framereg.h" - static rx_handler_result_t hsr_handle_frame(struct sk_buff **pskb) { struct sk_buff *skb = *pskb; @@ -61,7 +60,6 @@ bool hsr_port_exists(const struct net_device *dev) return rcu_access_pointer(dev->rx_handler) == hsr_handle_frame; } - static int hsr_check_dev_ok(struct net_device *dev) { /* Don't allow HSR on non-ethernet like devices */ @@ -99,7 +97,6 @@ static int hsr_check_dev_ok(struct net_device *dev) return 0; } - /* Setup device to be added to the HSR bridge. */ static int hsr_portdev_setup(struct net_device *dev, struct hsr_port *port) { From patchwork Fri Apr 5 17:31:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 161892 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp708542jan; Fri, 5 Apr 2019 10:30:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwF4VNFbjeGoGTOfTf95hDJUpr9tlZmCDYsEfeVEq6UcYnVNI8B7RAULI1tWkT4QkYWnBMj X-Received: by 2002:a17:902:2963:: with SMTP id g90mr14164370plb.182.1554485451653; Fri, 05 Apr 2019 10:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554485451; cv=none; d=google.com; s=arc-20160816; b=hMzZc4bbym0X5Yu3s320ggpjNqZ4mYWwKN/UrOXkLQKBCe846r+bQCkIaCmchSbnv7 JW8QX/Fvhd2Kylw/JPkZXCVYStddiuvut26Htah/JoAD5T65mnBEHsgsyYDhjpHru6Xp gjIedAXIu3Gw5xI+XlsXD5dlJspoz/BolejWH3rwhv1KgB4HOepNefXkdjHc5YRBfU/p tyNat0psGjNLAInADYkU0W81s/eU2D5M/nuMr+ZxZWjrNNykt0zuANSCSxXsRtps328G GJA0ddzIuVvx8M6n9dH5deWy/zPOF6iFK9zFhQybsWuX1aHyj2tFWco0RQIfyOb0o0ae ouOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=wLbTMB6JvlGhkudiqJaytzAf01DjFeR3t1p8ZD+MzoQ=; b=P+wcYj3FKDmDHNcYl8RaBfZz3UhzAe93D52CUrkKAYp4Bf9tzJW2Cw426V3Ezheu9P OEfKcbKCuZ7Aq+14Yh3OHoTiL37j+IXM1jioPrXyBBWGy3m+7gZiW2vWaVTtvqLGwDDJ CLZXBVOf9tkt+VxiPL9e6QzM3xXQ6cW0hBi3kRwAW5QLsw25UcGiBW74L2g4Pn9sw13C FVeIOHhYoYwWx01VkHHmgMozwvT+hrqfMmjroFY6rJRmG5IN5VV0qBXNWubKZUllsUkA 9TaXueX3wT8K94jHvVMfCAvwzIOoNL40CJgog/dpTf2zMeY1L0Fs+ZAFDaJSYUrHJNcV 5MTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=u7yjIHDr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v8si19260710plz.423.2019.04.05.10.30.51; Fri, 05 Apr 2019 10:30:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=u7yjIHDr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731951AbfDERau (ORCPT + 31 others); Fri, 5 Apr 2019 13:30:50 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:39402 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731195AbfDER3B (ORCPT ); Fri, 5 Apr 2019 13:29:01 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x35HSvoI084520; Fri, 5 Apr 2019 12:28:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1554485337; bh=wLbTMB6JvlGhkudiqJaytzAf01DjFeR3t1p8ZD+MzoQ=; h=From:To:Subject:Date:In-Reply-To:References; b=u7yjIHDrw/YEEiG4R01D9gyDUa2ynDzyldXYBwEe3u/q8AV8U0xEVP/SPPazsqAK3 jbdBVuhYPu/ZRj7VivP0iGxkbK3b5cQGBTX0T0OBImQpu1baTorWs7GcMY8wxMyRnm fU87ll70nnBFvbCyc4kim2X2btAD2LZzi08Q4tA8= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x35HSvOM096328 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 5 Apr 2019 12:28:57 -0500 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 5 Apr 2019 12:28:56 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 5 Apr 2019 12:28:56 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x35HSsuQ095744; Fri, 5 Apr 2019 12:28:56 -0500 From: Murali Karicheri To: , , , , Subject: [PATCH net 03/14] net: hsr: remove unnecessary paranthesis from the code Date: Fri, 5 Apr 2019 13:31:25 -0400 Message-ID: <20190405173136.18050-4-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190405173136.18050-1-m-karicheri2@ti.com> References: <20190405173136.18050-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fixes unnecessary paranthesis from the code. This is seen when ran checkpatch.pl -f option on files under net/hsr. Signed-off-by: Murali Karicheri --- net/hsr/hsr_device.c | 7 +++---- net/hsr/hsr_forward.c | 23 +++++++++++------------ net/hsr/hsr_slave.c | 4 ++-- 3 files changed, 16 insertions(+), 18 deletions(-) -- 2.17.0 diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index 34b6d6e8020f..cf5c3951d35a 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -67,7 +67,7 @@ static bool hsr_check_carrier(struct hsr_port *master) rcu_read_lock(); hsr_for_each_port(master->hsr, port) - if ((port->type != HSR_PT_MASTER) && is_slave_up(port->dev)) { + if (port->type != HSR_PT_MASTER && is_slave_up(port->dev)) { has_carrier = true; break; } @@ -88,15 +88,14 @@ static void hsr_check_announce(struct net_device *hsr_dev, hsr = netdev_priv(hsr_dev); - if ((hsr_dev->operstate == IF_OPER_UP) - && (old_operstate != IF_OPER_UP)) { + if (hsr_dev->operstate == IF_OPER_UP && old_operstate != IF_OPER_UP) { /* Went up */ hsr->announce_count = 0; mod_timer(&hsr->announce_timer, jiffies + msecs_to_jiffies(HSR_ANNOUNCE_INTERVAL)); } - if ((hsr_dev->operstate != IF_OPER_UP) && (old_operstate == IF_OPER_UP)) + if (hsr_dev->operstate != IF_OPER_UP && old_operstate == IF_OPER_UP) /* Went down */ del_timer(&hsr->announce_timer); } diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index 70220e5a389a..fdc191015208 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c @@ -77,12 +77,11 @@ static bool is_supervision_frame(struct hsr_priv *hsr, struct sk_buff *skb) &((struct hsrv0_ethhdr_sp *) skb_mac_header(skb))->hsr_sup; } - if ((hsrSupTag->HSR_TLV_Type != HSR_TLV_ANNOUNCE) && - (hsrSupTag->HSR_TLV_Type != HSR_TLV_LIFE_CHECK)) + if (hsrSupTag->HSR_TLV_Type != HSR_TLV_ANNOUNCE && + hsrSupTag->HSR_TLV_Type != HSR_TLV_LIFE_CHECK) return false; - if ((hsrSupTag->HSR_TLV_Length != 12) && - (hsrSupTag->HSR_TLV_Length != - sizeof(struct hsr_sup_payload))) + if (hsrSupTag->HSR_TLV_Length != 12 && + hsrSupTag->HSR_TLV_Length != sizeof(struct hsr_sup_payload)) return false; return true; @@ -191,7 +190,7 @@ static struct sk_buff *frame_get_tagged_skb(struct hsr_frame_info *frame, if (frame->skb_hsr) return skb_clone(frame->skb_hsr, GFP_ATOMIC); - if ((port->type != HSR_PT_SLAVE_A) && (port->type != HSR_PT_SLAVE_B)) { + if (port->type != HSR_PT_SLAVE_A && port->type != HSR_PT_SLAVE_B) { WARN_ONCE(1, "HSR: Bug: trying to create a tagged frame for a non-ring port"); return NULL; } @@ -255,11 +254,11 @@ static void hsr_forward_do(struct hsr_frame_info *frame) continue; /* Don't deliver locally unless we should */ - if ((port->type == HSR_PT_MASTER) && !frame->is_local_dest) + if (port->type == HSR_PT_MASTER && !frame->is_local_dest) continue; /* Deliver frames directly addressed to us to master only */ - if ((port->type != HSR_PT_MASTER) && frame->is_local_exclusive) + if (port->type != HSR_PT_MASTER && frame->is_local_exclusive) continue; /* Don't send frame over port where it has been sent before */ @@ -267,7 +266,7 @@ static void hsr_forward_do(struct hsr_frame_info *frame) frame->sequence_nr)) continue; - if (frame->is_supervision && (port->type == HSR_PT_MASTER)) { + if (frame->is_supervision && port->type == HSR_PT_MASTER) { hsr_handle_sup_frame(frame->skb_hsr, frame->node_src, frame->port_rcv); @@ -301,9 +300,9 @@ static void check_local_dest(struct hsr_priv *hsr, struct sk_buff *skb, frame->is_local_exclusive = false; } - if ((skb->pkt_type == PACKET_HOST) || - (skb->pkt_type == PACKET_MULTICAST) || - (skb->pkt_type == PACKET_BROADCAST)) { + if (skb->pkt_type == PACKET_HOST || + skb->pkt_type == PACKET_MULTICAST || + skb->pkt_type == PACKET_BROADCAST) { frame->is_local_dest = true; } else { frame->is_local_dest = false; diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c index 80151c255a1d..d506c694ee25 100644 --- a/net/hsr/hsr_slave.c +++ b/net/hsr/hsr_slave.c @@ -63,8 +63,8 @@ bool hsr_port_exists(const struct net_device *dev) static int hsr_check_dev_ok(struct net_device *dev) { /* Don't allow HSR on non-ethernet like devices */ - if ((dev->flags & IFF_LOOPBACK) || (dev->type != ARPHRD_ETHER) || - (dev->addr_len != ETH_ALEN)) { + if ((dev->flags & IFF_LOOPBACK) || dev->type != ARPHRD_ETHER || + dev->addr_len != ETH_ALEN) { netdev_info(dev, "Cannot use loopback or non-ethernet device as HSR slave.\n"); return -EINVAL; } From patchwork Fri Apr 5 17:31:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 161891 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp707882jan; Fri, 5 Apr 2019 10:30:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyd4pKncKliW+p0dTdLIyAoQSI21Yx64EYzsLYoJKwLXyrojOvAmiHoma6+VY1qVwXiZd1S X-Received: by 2002:a63:e045:: with SMTP id n5mr13501395pgj.230.1554485416008; Fri, 05 Apr 2019 10:30:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554485416; cv=none; d=google.com; s=arc-20160816; b=D278S7XqpReDMgZ6SeJI5z4uI+5vh5dY7W2XrNpe4SAcYSv8Vu+LzcywRMTkWB3oja zNJ0qD9q/8KnARvUPNMsBG9/mqoyke3oJpbLAKr2iLGFQzsxfRszCuYKCWZ4lpG0LU4h +8u5vfIRDi+D6MMfCN4is0p+CI45MkZ13o0gAVIX99sOLy61P5fbOBEEkImiqMrFQa+e p+wFDFlDke2YFscDTmoPMjOfaVswo3IrBW/RQxdTjjEec8gG/W+YWDj7KXUiJ9jpqaBU 7D++4eb/NtjFypa6UoppV5wUt+CfXNV2u5AgcsXG8QSKApVKep8GFAYYuKHDbkbWr1Ly DBGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=Go+RTAY3YFb+qNn6Zh50IK6AL60Gi3kZ57IgGK4r2lo=; b=pTlOkn74HOl9VGPamvTycKiiLyQ8AN2Sa7wNt+ah0CUjKT49kVjJAphYh1SIeOdJdI nA7vsLynsY5+tA2+/GMz5rT2cKfW8c5+j+dg2lrZUJ92bm0hXhb6iOOvAstgxXgjftXH sdPHcjoc0gTvKc7t/0SfuvsHMZQtiV/6ck0C4j5CxDpPnB2OBYySEZaSzgdVJP9kxgQL R1nF9zPxYh1j6xZLWsBwg0FzTWPwrYB5ptTZLxwNkaAt5UpxPLoU/v+3zZu9pXhOj+M0 dvr9z6SmI1A8+xQAPlgXc2aARDME4awFbCL23vNnMbL8lySUDShILFFU1J6RiMom5CAh 2hkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=TqBCU0y1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1si19613537pgi.330.2019.04.05.10.30.15; Fri, 05 Apr 2019 10:30:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=TqBCU0y1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731651AbfDER3B (ORCPT + 31 others); Fri, 5 Apr 2019 13:29:01 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:56302 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730565AbfDER3A (ORCPT ); Fri, 5 Apr 2019 13:29:00 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x35HSvAW130979; Fri, 5 Apr 2019 12:28:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1554485337; bh=Go+RTAY3YFb+qNn6Zh50IK6AL60Gi3kZ57IgGK4r2lo=; h=From:To:Subject:Date:In-Reply-To:References; b=TqBCU0y1WSynWbrzX5WpoZD+5lE2lSwagya3cF9fBQ0sNYDNZVX8mF/ypYjFi5zdm 6DDsoefEBZhUZaPOTydSjlxomAEqHOltUieiee1QJRWMA1UkzhLo0u/LHbXGVrI/+R dsdkKbu+X5PPDfLmnmmI80Ymwlemz1mrU7FRQCIo= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x35HSvjv096152 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 5 Apr 2019 12:28:57 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 5 Apr 2019 12:28:57 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 5 Apr 2019 12:28:57 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x35HSsuR095744; Fri, 5 Apr 2019 12:28:56 -0500 From: Murali Karicheri To: , , , , Subject: [PATCH net 04/14] net: hsr: fix alignment issues in the code for functions Date: Fri, 5 Apr 2019 13:31:26 -0400 Message-ID: <20190405173136.18050-5-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190405173136.18050-1-m-karicheri2@ti.com> References: <20190405173136.18050-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fixes alignment issues in code for functions. This is seen when ran checkpatch.pl -f option on files under net/hsr. Signed-off-by: Murali Karicheri --- net/hsr/hsr_device.c | 6 +++--- net/hsr/hsr_framereg.c | 2 +- net/hsr/hsr_netlink.c | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) -- 2.17.0 diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index cf5c3951d35a..0aea1bd09526 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -243,7 +243,7 @@ static const struct header_ops hsr_header_ops = { }; static void send_hsr_supervision_frame(struct hsr_port *master, - u8 type, u8 hsrVer) + u8 type, u8 hsrVer) { struct sk_buff *skb; int hlen, tlen; @@ -331,13 +331,13 @@ static void hsr_announce(struct timer_list *t) if (hsr->announce_count < 3 && hsr->protVersion == 0) { send_hsr_supervision_frame(master, HSR_TLV_ANNOUNCE, - hsr->protVersion); + hsr->protVersion); hsr->announce_count++; interval = msecs_to_jiffies(HSR_ANNOUNCE_INTERVAL); } else { send_hsr_supervision_frame(master, HSR_TLV_LIFE_CHECK, - hsr->protVersion); + hsr->protVersion); interval = msecs_to_jiffies(HSR_LIFE_CHECK_INTERVAL); } diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index 47dbaf2faefa..78fca38ffa9f 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c @@ -105,7 +105,7 @@ int hsr_create_self_node(struct list_head *self_node_db, rcu_read_lock(); oldnode = list_first_or_null_rcu(self_node_db, - struct hsr_node, mac_list); + struct hsr_node, mac_list); if (oldnode) { list_replace_rcu(&oldnode->mac_list, &node->mac_list); rcu_read_unlock(); diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c index 39768382be24..15d3dba229b9 100644 --- a/net/hsr/hsr_netlink.c +++ b/net/hsr/hsr_netlink.c @@ -270,8 +270,8 @@ static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info) } msg_head = genlmsg_put(skb_out, NETLINK_CB(skb_in).portid, - info->snd_seq, &hsr_genl_family, 0, - HSR_C_SET_NODE_STATUS); + info->snd_seq, &hsr_genl_family, 0, + HSR_C_SET_NODE_STATUS); if (!msg_head) { res = -ENOMEM; goto nla_put_failure; @@ -295,7 +295,7 @@ static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info) goto nla_put_failure; res = nla_put(skb_out, HSR_A_NODE_ADDR, ETH_ALEN, - nla_data(info->attrs[HSR_A_NODE_ADDR])); + nla_data(info->attrs[HSR_A_NODE_ADDR])); if (res < 0) goto nla_put_failure; @@ -396,8 +396,8 @@ static int hsr_get_node_list(struct sk_buff *skb_in, struct genl_info *info) } msg_head = genlmsg_put(skb_out, NETLINK_CB(skb_in).portid, - info->snd_seq, &hsr_genl_family, 0, - HSR_C_SET_NODE_LIST); + info->snd_seq, &hsr_genl_family, 0, + HSR_C_SET_NODE_LIST); if (!msg_head) { res = -ENOMEM; goto nla_put_failure; From patchwork Fri Apr 5 17:31:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 161887 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp707423jan; Fri, 5 Apr 2019 10:29:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuUbSxe4C9Qp7j1R/QDFozalwbytJjFub+z+A7DHcOYBzw3Q/0CSl2HldqU92aTHYzfk89 X-Received: by 2002:a17:902:9a09:: with SMTP id v9mr14161340plp.225.1554485391549; Fri, 05 Apr 2019 10:29:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554485391; cv=none; d=google.com; s=arc-20160816; b=DV+F/e+4kdlAn1daqIcXQMAGN4tsWrsjmHfVPCXEHATYj4mth9b9C7yCQq3jHcANCn YS6pM0HrwUMCGDw93FPorDn63aY1KPWpLymHs7gMnffKAgPKxlrAABp3bp1demkFMUU0 YGtxgjaV+KYE8OFHTLrHfqlEB4pEiRQx/dV/+clyXp+jt9B30dElfVkq0k9L9UGN5dDV XW6X+85LHPQR+eisAW2/l0WgbpjNsF5xj81R8EvKql2agg9HAzwjzfG/J/XwuuxHfb5v uuG6DRyUJDi7K+XflOCqgZ2Wfc94R3YLiopPxqken0uyzSto1yd1W+cUINhlrZLeYlKo BD4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=7vl9QsZBI7rn+nw2qyaZwcXLNHVDgEKsBckiOI+Th+4=; b=rstDFaAuRfJH65cJuifIoU4evDHf9Qs6UQ37mUdGBIxf1xlWmB/Uoem3BhaFDbYOa/ 40JkLsakWa8Jl7WqwMavC9OFjvZCvInmMow57oYoEjBeeScfTiT0DiKD0u06rEMzk1Ez zI2D1N6aeZzLEYA20L3m96AN3Olrl5EBgaQ8oZBAbZsrtT1HIXk7u0AbkIsoxA4xdJza iusMSDp20TlKg0gu9GjOWKVlMhqXjbedLtYyrQWttEFUmIIINX88TDOwCIeF5QOlaDvK dcjdhbsrPhaNFIwyCFCS2y618/APlsFGrgv87AJz2KDh8fMqieIdJnVO0zh7P2jZANii TW3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=j1+BcZqN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 70si20298710pfu.227.2019.04.05.10.29.51; Fri, 05 Apr 2019 10:29:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=j1+BcZqN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731676AbfDER3D (ORCPT + 31 others); Fri, 5 Apr 2019 13:29:03 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:39404 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731312AbfDER3B (ORCPT ); Fri, 5 Apr 2019 13:29:01 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x35HSw5R084537; Fri, 5 Apr 2019 12:28:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1554485338; bh=7vl9QsZBI7rn+nw2qyaZwcXLNHVDgEKsBckiOI+Th+4=; h=From:To:Subject:Date:In-Reply-To:References; b=j1+BcZqNycYi1PNy6HRGj9KASmAer+QzVP3UE/BiurnRDxhLsYxgTNy3UkZY0CQS5 Ha6hf56zWxBpYHdEDl/PYs9JX6n3zZDAeq8Sz1/KPkkk80TPGtzgMGyuyITbP/N9OE Xf8ocKOjAtvOdsMSUiUluEQyTidYukKvG0/LDBK0= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x35HSwRH095593 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 5 Apr 2019 12:28:58 -0500 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 5 Apr 2019 12:28:57 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 5 Apr 2019 12:28:57 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x35HSsuS095744; Fri, 5 Apr 2019 12:28:57 -0500 From: Murali Karicheri To: , , , , Subject: [PATCH net 05/14] net: hsr: fix lines that ends with a '(' Date: Fri, 5 Apr 2019 13:31:27 -0400 Message-ID: <20190405173136.18050-6-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190405173136.18050-1-m-karicheri2@ti.com> References: <20190405173136.18050-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fixes function calls that ends with '(' in a line. This is seen when ran checkpatch.pl -f option on files under net/hsr. Signed-off-by: Murali Karicheri --- net/hsr/hsr_device.c | 7 +++---- net/hsr/hsr_main.h | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) -- 2.17.0 diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index 0aea1bd09526..567c890f08a5 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -254,10 +254,9 @@ static void send_hsr_supervision_frame(struct hsr_port *master, hlen = LL_RESERVED_SPACE(master->dev); tlen = master->dev->needed_tailroom; - skb = dev_alloc_skb( - sizeof(struct hsr_tag) + - sizeof(struct hsr_sup_tag) + - sizeof(struct hsr_sup_payload) + hlen + tlen); + skb = dev_alloc_skb(sizeof(struct hsr_tag) + + sizeof(struct hsr_sup_tag) + + sizeof(struct hsr_sup_payload) + hlen + tlen); if (skb == NULL) return; diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h index 3504f0647942..1b640731d705 100644 --- a/net/hsr/hsr_main.h +++ b/net/hsr/hsr_main.h @@ -84,9 +84,8 @@ static inline void set_hsr_tag_path(struct hsr_tag *ht, u16 path) static inline void set_hsr_tag_LSDU_size(struct hsr_tag *ht, u16 LSDU_size) { - ht->path_and_LSDU_size = htons( - (ntohs(ht->path_and_LSDU_size) & 0xF000) | - (LSDU_size & 0x0FFF)); + ht->path_and_LSDU_size = htons((ntohs(ht->path_and_LSDU_size) & + 0xF000) | (LSDU_size & 0x0FFF)); } struct hsr_ethhdr { From patchwork Fri Apr 5 17:31:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 161880 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp706664jan; Fri, 5 Apr 2019 10:29:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxuhzNiIr0lVw18/R8gsRf2dmWXTZuz0VhM0rAri9rmaVNEUQ9mH8S94fCSga8EDlXk0znr X-Received: by 2002:a17:902:9341:: with SMTP id g1mr14485461plp.81.1554485346421; Fri, 05 Apr 2019 10:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554485346; cv=none; d=google.com; s=arc-20160816; b=aCe2CIQMHzxNT7pdwy6pAKZGgq907eIfXHnfjTf0DcvtBbnIPRKp71F+HXS89x37sz Qs6PKfaQ7jOKqLHVRMxJzvnaL3eoNaVGl/W344/vccIBbcdU/gf+l5n6anrJB/eDhKS8 nrx8hvuTL60St5pXGx66w9PO7NePgJh98e6HC3bG2+ie5xRUxjamYgAPTtdIcvx3hmpv gMz9EFSt+JgIJrychMdvHAlHMzwfzMypwnyFfPN+bQxEjU1fs/CjuwoRoy4gaujXQDe4 L0KqznofPKwcb2r2a25/7TzY74VMeiiU0WwgSHc5TOcN34VO1TEMGoCiHkCXaQO8OiXO bNEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=UnBv29Cns/xkCQo9GEbugXSGHD3faoliySYfnz5T1Bg=; b=pdCvJugV/7qZTo91eQu0DhwcCJe7IWUrr7pxUrWiQgGDUlk4O7vrOaYFboVNkO5zyz wDFJY1njMDVg1tzo/nmvQ370QNrSEEZkrsnz4cNH/lBhrI1UFc2eNCsqRF5cd08Vz1m5 pbn0XSu0mKvJocHUI9rPuFx/2CLq6HtV9Ic/etpMz97DfMZKYpO4S0iIsNiAwJl6Xffb XtTKwZzEeJq+Y9cAZGcoOejO5vclyd//nC4aTzwFLUD1H7Pq4mQVr3p9y1Nkgs5zqn9z Zt2YXOMyXWw3CfvlOogfGyyYBSC/q/RhrX94LEZLtbnREQH+4RHardVP6qkyyT519tem nO/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=jtstg2xe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u125si17176953pfb.112.2019.04.05.10.29.06; Fri, 05 Apr 2019 10:29:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=jtstg2xe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731693AbfDER3E (ORCPT + 31 others); Fri, 5 Apr 2019 13:29:04 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:56308 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731313AbfDER3B (ORCPT ); Fri, 5 Apr 2019 13:29:01 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x35HSwBk130988; Fri, 5 Apr 2019 12:28:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1554485338; bh=UnBv29Cns/xkCQo9GEbugXSGHD3faoliySYfnz5T1Bg=; h=From:To:Subject:Date:In-Reply-To:References; b=jtstg2xelLLJP1N4WdYiZLWvA3uurkhCsxKQsHBT4moJYWapgVdrsc4IEbP9GJhg4 LE6BeOgiwb3n5ZBLLRiPDvpdVUY8IGqumCG8o8bQ32tVMT1c4+ZrMkLHvka5gOUyvW NcxBgIL10TGedfiMcoYTxACfAn7yaN3YeHpD+4Es= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x35HSw1H050673 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 5 Apr 2019 12:28:58 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 5 Apr 2019 12:28:58 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 5 Apr 2019 12:28:58 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x35HSsuT095744; Fri, 5 Apr 2019 12:28:57 -0500 From: Murali Karicheri To: , , , , Subject: [PATCH net 06/14] net: hsr: fix NULL checks in the code Date: Fri, 5 Apr 2019 13:31:28 -0400 Message-ID: <20190405173136.18050-7-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190405173136.18050-1-m-karicheri2@ti.com> References: <20190405173136.18050-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch replaces all instance of NULL checks such as if (foo == NULL) with if (!foo) Also if (foo != NULL) with if (foo) This is seen when ran checkpatch.pl -f on files under net/hsr and suggestion is to replace as above. Signed-off-by: Murali Karicheri --- net/hsr/hsr_device.c | 2 +- net/hsr/hsr_forward.c | 12 ++++++------ net/hsr/hsr_framereg.c | 2 +- net/hsr/hsr_main.c | 4 ++-- net/hsr/hsr_slave.c | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) -- 2.17.0 diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index 567c890f08a5..245fc531d39f 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -258,7 +258,7 @@ static void send_hsr_supervision_frame(struct hsr_port *master, sizeof(struct hsr_sup_tag) + sizeof(struct hsr_sup_payload) + hlen + tlen); - if (skb == NULL) + if (!skb) return; skb_reserve(skb, hlen); diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index fdc191015208..68ca775d3be8 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c @@ -97,7 +97,7 @@ static struct sk_buff *create_stripped_skb(struct sk_buff *skb_in, skb_pull(skb_in, HSR_HLEN); skb = __pskb_copy(skb_in, skb_headroom(skb_in) - HSR_HLEN, GFP_ATOMIC); skb_push(skb_in, HSR_HLEN); - if (skb == NULL) + if (!skb) return NULL; skb_reset_mac_header(skb); @@ -160,7 +160,7 @@ static struct sk_buff *create_tagged_skb(struct sk_buff *skb_o, /* Create the new skb with enough headroom to fit the HSR tag */ skb = __pskb_copy(skb_o, skb_headroom(skb_o) + HSR_HLEN, GFP_ATOMIC); - if (skb == NULL) + if (!skb) return NULL; skb_reset_mac_header(skb); @@ -277,7 +277,7 @@ static void hsr_forward_do(struct hsr_frame_info *frame) skb = frame_get_tagged_skb(frame, port); else skb = frame_get_stripped_skb(frame, port); - if (skb == NULL) { + if (!skb) { /* FIXME: Record the dropped frame? */ continue; } @@ -317,7 +317,7 @@ static int hsr_fill_frame_info(struct hsr_frame_info *frame, frame->is_supervision = is_supervision_frame(port->hsr, skb); frame->node_src = hsr_get_node(port, skb, frame->is_supervision); - if (frame->node_src == NULL) + if (!frame->node_src) return -1; /* Unknown node and !is_supervision, or no mem */ ethhdr = (struct ethhdr *) skb_mac_header(skb); @@ -364,9 +364,9 @@ void hsr_forward_skb(struct sk_buff *skb, struct hsr_port *port) hsr_register_frame_in(frame.node_src, port, frame.sequence_nr); hsr_forward_do(&frame); - if (frame.skb_hsr != NULL) + if (frame.skb_hsr) kfree_skb(frame.skb_hsr); - if (frame.skb_std != NULL) + if (frame.skb_std) kfree_skb(frame.skb_std); return; diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index 78fca38ffa9f..c1b0e62af0f1 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c @@ -405,7 +405,7 @@ void hsr_prune_nodes(struct timer_list *t) msecs_to_jiffies(1.5*MAX_SLAVE_DIFF))) { rcu_read_lock(); port = get_late_port(hsr, node); - if (port != NULL) + if (port) hsr_nl_ringerror(hsr, node->MacAddressA, port); rcu_read_unlock(); } diff --git a/net/hsr/hsr_main.c b/net/hsr/hsr_main.c index 0d4ab8fc0aa1..84cacf8c1b0a 100644 --- a/net/hsr/hsr_main.c +++ b/net/hsr/hsr_main.c @@ -30,12 +30,12 @@ static int hsr_netdev_notify(struct notifier_block *nb, unsigned long event, dev = netdev_notifier_info_to_dev(ptr); port = hsr_port_get_rtnl(dev); - if (port == NULL) { + if (!port) { if (!is_hsr_master(dev)) return NOTIFY_DONE; /* Not an HSR device */ hsr = netdev_priv(dev); port = hsr_port_get_hsr(hsr, HSR_PT_MASTER); - if (port == NULL) { + if (!port) { /* Resend of notification concerning removed device? */ return NOTIFY_DONE; } diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c index d506c694ee25..07cbc2ead64d 100644 --- a/net/hsr/hsr_slave.c +++ b/net/hsr/hsr_slave.c @@ -140,11 +140,11 @@ int hsr_add_port(struct hsr_priv *hsr, struct net_device *dev, } port = hsr_port_get_hsr(hsr, type); - if (port != NULL) + if (port) return -EBUSY; /* This port already exists */ port = kzalloc(sizeof(*port), GFP_KERNEL); - if (port == NULL) + if (!port) return -ENOMEM; if (type != HSR_PT_MASTER) { @@ -181,7 +181,7 @@ void hsr_del_port(struct hsr_port *port) list_del_rcu(&port->port_list); if (port != master) { - if (master != NULL) { + if (master) { netdev_update_features(master->dev); dev_set_mtu(master->dev, hsr_get_max_mtu(hsr)); } From patchwork Fri Apr 5 17:31:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 161889 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp707650jan; Fri, 5 Apr 2019 10:30:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDjtHvCHscusjgC6iv8He1gfPZ8hnRMQjCUNM8bON2Snz3S1EV7ywnDHrzsPccUZQ67pcf X-Received: by 2002:a63:360c:: with SMTP id d12mr12665795pga.404.1554485403138; Fri, 05 Apr 2019 10:30:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554485403; cv=none; d=google.com; s=arc-20160816; b=MndU5TL+g3jcYluxJDsddrdO8XVAQkd9hpkgDMaT4AwDdST7AjdX7YDE0eB+T/8+ZW +7oAVj3DV1yE0ft1hQfy1tx4GDcNJlVE8dy/IKzXMHNhYLQdezYHMILgKs0Z51YrLd0l QNG+wT4fG4ryLDy1ldbbCKvf4T7f4oVTb1/tiEvFup59Vozdd7689o0ic6zi+A8+aYEI V+CAFpUvCIUW6VH8ZagNmpGpHTnMdrKvMXrukYFEPP4EA0GiNtCb4yH0nxSgFzFD6Cy8 awEbjIyLl7Pybg/+jbApc+E5EwdC1r/dZh60Zkgx/f0yCHk4Nhzl90U2DuxiUn7AeqXI 7BsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=CzFVshVULoR1rH4g4J+1/7WSH6F0ebNlHTIesHtRbks=; b=W4K05ebFOAh+nux3WpsWvb4zuSNW3BgoxEW/yn0oMvjHopmCjZH/NOLtdi7Jor+PMF 8D1kRGzTL88KmMZo3iURLGB71Zg+KwfHyhfEWquGAIEk4mc2Ne6wG+gZX6uaof09P2UC D4w/1tiFBUmEibzh7GWtTZ6uB4rUb39ybwLVM5LOCiEySXqRADgBknY7mQmeXbIt3Qzy XwyboUxykBNMjwUs5R6ZC8pmWL+YR0l5sRY2vA5qiBSnxmqxCx3p7WxCtWYdgKdYDAzK AclmU0XespZ8FnsJbi08iIkiIQ3SXRNaSODFcSWqUg+xR3y+S+TWHYmJ8ubftes6cqnM 6joA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=oxobgwIq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v124si18985007pgb.475.2019.04.05.10.30.02; Fri, 05 Apr 2019 10:30:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=oxobgwIq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731878AbfDERaC (ORCPT + 31 others); Fri, 5 Apr 2019 13:30:02 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:56312 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731627AbfDER3C (ORCPT ); Fri, 5 Apr 2019 13:29:02 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x35HSxQL130992; Fri, 5 Apr 2019 12:28:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1554485339; bh=CzFVshVULoR1rH4g4J+1/7WSH6F0ebNlHTIesHtRbks=; h=From:To:Subject:Date:In-Reply-To:References; b=oxobgwIqNdmbx6Tq1Cg/DviQkMPlFT8Ia0xCvp+ZRP9KSELsbLI3w0FaiP2DUC6pp V8wMXPk25jJl8SmT7De0B5Qj9ueUuV6JrBcPTJCC0CGNkyRSdFxdE3rp1VbxqooBVf FNLH+K23Jln48gTTTZMOtWHWQ/wGlyl7DLeR+VRM= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x35HSxI2050693 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 5 Apr 2019 12:28:59 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 5 Apr 2019 12:28:58 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 5 Apr 2019 12:28:58 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x35HSsuU095744; Fri, 5 Apr 2019 12:28:58 -0500 From: Murali Karicheri To: , , , , Subject: [PATCH net 07/14] net: hsr: remove unnecessary space after a cast Date: Fri, 5 Apr 2019 13:31:29 -0400 Message-ID: <20190405173136.18050-8-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190405173136.18050-1-m-karicheri2@ti.com> References: <20190405173136.18050-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch removes unnecessary space after a cast. This is seen when ran checkpatch.pl -f on files under net/hsr. Signed-off-by: Murali Karicheri --- net/hsr/hsr_forward.c | 10 +++++----- net/hsr/hsr_framereg.c | 10 +++++----- net/hsr/hsr_main.h | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) -- 2.17.0 diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index 68ca775d3be8..71ffbfd6d740 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c @@ -53,7 +53,7 @@ static bool is_supervision_frame(struct hsr_priv *hsr, struct sk_buff *skb) struct hsrv1_ethhdr_sp *hsrV1Hdr; WARN_ON_ONCE(!skb_mac_header_was_set(skb)); - ethHdr = (struct ethhdr *) skb_mac_header(skb); + ethHdr = (struct ethhdr *)skb_mac_header(skb); /* Correct addr? */ if (!ether_addr_equal(ethHdr->h_dest, @@ -67,14 +67,14 @@ static bool is_supervision_frame(struct hsr_priv *hsr, struct sk_buff *skb) /* Get the supervision header from correct location. */ if (ethHdr->h_proto == htons(ETH_P_HSR)) { /* Okay HSRv1. */ - hsrV1Hdr = (struct hsrv1_ethhdr_sp *) skb_mac_header(skb); + hsrV1Hdr = (struct hsrv1_ethhdr_sp *)skb_mac_header(skb); if (hsrV1Hdr->hsr.encap_proto != htons(ETH_P_PRP)) return false; hsrSupTag = &hsrV1Hdr->hsr_sup; } else { hsrSupTag = - &((struct hsrv0_ethhdr_sp *) skb_mac_header(skb))->hsr_sup; + &((struct hsrv0_ethhdr_sp *)skb_mac_header(skb))->hsr_sup; } if (hsrSupTag->HSR_TLV_Type != HSR_TLV_ANNOUNCE && @@ -140,7 +140,7 @@ static void hsr_fill_tag(struct sk_buff *skb, struct hsr_frame_info *frame, if (frame->is_vlan) lsdu_size -= 4; - hsr_ethhdr = (struct hsr_ethhdr *) skb_mac_header(skb); + hsr_ethhdr = (struct hsr_ethhdr *)skb_mac_header(skb); set_hsr_tag_path(&hsr_ethhdr->hsr_tag, lane_id); set_hsr_tag_LSDU_size(&hsr_ethhdr->hsr_tag, lsdu_size); @@ -320,7 +320,7 @@ static int hsr_fill_frame_info(struct hsr_frame_info *frame, if (!frame->node_src) return -1; /* Unknown node and !is_supervision, or no mem */ - ethhdr = (struct ethhdr *) skb_mac_header(skb); + ethhdr = (struct ethhdr *)skb_mac_header(skb); frame->is_vlan = false; if (ethhdr->h_proto == htons(ETH_P_8021Q)) { frame->is_vlan = true; diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index c1b0e62af0f1..1929a8dfd292 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c @@ -44,10 +44,10 @@ static bool seq_nr_after(u16 a, u16 b) /* Remove inconsistency where * seq_nr_after(a, b) == seq_nr_before(a, b) */ - if ((int) b - a == 32768) + if ((int)b - a == 32768) return false; - return (((s16) (b - a)) < 0); + return (((s16)(b - a)) < 0); } #define seq_nr_before(a, b) seq_nr_after((b), (a)) #define seq_nr_after_or_eq(a, b) (!seq_nr_before((a), (b))) @@ -176,7 +176,7 @@ struct hsr_node *hsr_get_node(struct hsr_port *port, struct sk_buff *skb, if (!skb_mac_header_was_set(skb)) return NULL; - ethhdr = (struct ethhdr *) skb_mac_header(skb); + ethhdr = (struct ethhdr *)skb_mac_header(skb); list_for_each_entry_rcu(node, node_db, mac_list) { if (ether_addr_equal(node->MacAddressA, ethhdr->h_source)) @@ -218,7 +218,7 @@ void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr, struct list_head *node_db; int i; - ethhdr = (struct ethhdr *) skb_mac_header(skb); + ethhdr = (struct ethhdr *)skb_mac_header(skb); /* Leave the ethernet header. */ skb_pull(skb, sizeof(struct ethhdr)); @@ -230,7 +230,7 @@ void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr, /* And leave the HSR sup tag. */ skb_pull(skb, sizeof(struct hsr_sup_tag)); - hsr_sp = (struct hsr_sup_payload *) skb->data; + hsr_sp = (struct hsr_sup_payload *)skb->data; /* Merge node_curr (registered on MacAddressB) into node_real */ node_db = &port_rcv->hsr->node_db; diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h index 1b640731d705..5d28a5371765 100644 --- a/net/hsr/hsr_main.h +++ b/net/hsr/hsr_main.h @@ -109,22 +109,22 @@ struct hsr_sup_payload { static inline u16 get_hsr_stag_path(struct hsr_sup_tag *hst) { - return get_hsr_tag_path((struct hsr_tag *) hst); + return get_hsr_tag_path((struct hsr_tag *)hst); } static inline u16 get_hsr_stag_HSR_ver(struct hsr_sup_tag *hst) { - return get_hsr_tag_LSDU_size((struct hsr_tag *) hst); + return get_hsr_tag_LSDU_size((struct hsr_tag *)hst); } static inline void set_hsr_stag_path(struct hsr_sup_tag *hst, u16 path) { - set_hsr_tag_path((struct hsr_tag *) hst, path); + set_hsr_tag_path((struct hsr_tag *)hst, path); } static inline void set_hsr_stag_HSR_Ver(struct hsr_sup_tag *hst, u16 HSR_Ver) { - set_hsr_tag_LSDU_size((struct hsr_tag *) hst, HSR_Ver); + set_hsr_tag_LSDU_size((struct hsr_tag *)hst, HSR_Ver); } struct hsrv0_ethhdr_sp { @@ -179,7 +179,7 @@ static inline u16 hsr_get_skb_sequence_nr(struct sk_buff *skb) { struct hsr_ethhdr *hsr_ethhdr; - hsr_ethhdr = (struct hsr_ethhdr *) skb_mac_header(skb); + hsr_ethhdr = (struct hsr_ethhdr *)skb_mac_header(skb); return ntohs(hsr_ethhdr->hsr_tag.sequence_nr); } From patchwork Fri Apr 5 17:31:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 161888 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp707498jan; Fri, 5 Apr 2019 10:29:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOvI/BqzsAVMmUbojBTxBGjGkwfyWSvTUS4a0xyiUJogT2o6q7OgVA7C8qXOjhqZckdUYv X-Received: by 2002:a17:902:7084:: with SMTP id z4mr13778094plk.305.1554485394921; Fri, 05 Apr 2019 10:29:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554485394; cv=none; d=google.com; s=arc-20160816; b=Hdq7rFh9HgGfE3HjesLx9+EAo+WzfpuCxKM1lpb9OHUH3++6z8jD/FqsBctDL0GVgE gzrAqlynlNRbEKAjzS0HWMepipWnpZMy4A+aC6TQ3TpM6DqPlEdmToTNOM02LNr2eyZ5 VXxBPzX524lMW82WPDu9Ok4A0lMFiDNg6uEng1elNJoDu1rXzVPPnZPc5U+smMI4KZR3 sMweAnAKVIoK99nOmER+BtnraNc3I4b8MTOaD5HFhGBeidkr8Kuf8jUUUTKkptkMxdXx U6YWacNHH98nmtX/T17i4z1CMxp9xjf3iFyLciMZBYnOV30nAiLHd2dukfWIUDgG+KhN bWfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=BpabQybvVs/CpIyNgUC3/B5FJsvcZRLei28kYHT6SqE=; b=R4atNYr6Hk6lCR5NDEnhPiDbOBBsBrBbqFmlkhi2AZwdnEk4GvYds8AB/SVTh5aUBQ 4Dv9dax7f42OESRgIzCU0whKghDEVNu6hQSLpSaey6/cuNqdxBN/+Oi76ue1MLXoVHva 24CLgibYhdKQtMXQB0RZlAek43VyX8Hu6ADTdI3R4e5iQ3AhFQ3uGAVHEh3YmBFymtUu luHqLcnhSEwcLxtUPB3NKzZfy1OB0En+Wv+qnDE0cGB5G1gFCz4k4iKQqjq+4/7dScs3 z7crND3NxCMQ7KvuYG5gvdkMpXVdlMu1nDYd5imxigVB/c1XWkSEv6uVp4KqtuRkAYwv exPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fBccI9sC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v124si18985007pgb.475.2019.04.05.10.29.54; Fri, 05 Apr 2019 10:29:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fBccI9sC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731841AbfDER3x (ORCPT + 31 others); Fri, 5 Apr 2019 13:29:53 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:48592 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731663AbfDER3D (ORCPT ); Fri, 5 Apr 2019 13:29:03 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x35HT00F063315; Fri, 5 Apr 2019 12:29:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1554485340; bh=BpabQybvVs/CpIyNgUC3/B5FJsvcZRLei28kYHT6SqE=; h=From:To:Subject:Date:In-Reply-To:References; b=fBccI9sCfQBLUNqybTE3BAqTNsk+cPVEV3FoTRImodnf40mUrkLpjWqZNz7f88e4R e2JvsF5jKHp2GZWEqCbIML97OulE8m+H1KjQLamPNBLMz2fXKYIcvafWkBxaDKCx79 URh4miZwHU4vtY3oXKBMntwibF9rAncbrrW1T/s0= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x35HT0Dk096269 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 5 Apr 2019 12:29:00 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 5 Apr 2019 12:28:59 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 5 Apr 2019 12:28:59 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x35HSsuW095744; Fri, 5 Apr 2019 12:28:59 -0500 From: Murali Karicheri To: , , , , Subject: [PATCH net 09/14] net: hsr: add missing space around operator in code Date: Fri, 5 Apr 2019 13:31:31 -0400 Message-ID: <20190405173136.18050-10-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190405173136.18050-1-m-karicheri2@ti.com> References: <20190405173136.18050-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch add missing space around operator in code. This is seen when ran checkpatch.pl -f on files under net/hsr. Signed-off-by: Murali Karicheri --- net/hsr/hsr_forward.c | 2 +- net/hsr/hsr_framereg.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) -- 2.17.0 diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index c4dfc2966f62..43f91651ba10 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c @@ -105,7 +105,7 @@ static struct sk_buff *create_stripped_skb(struct sk_buff *skb_in, if (skb->ip_summed == CHECKSUM_PARTIAL) skb->csum_start -= HSR_HLEN; - copylen = 2*ETH_ALEN; + copylen = 2 * ETH_ALEN; if (frame->is_vlan) copylen += VLAN_HLEN; src = skb_mac_header(skb_in); diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index 1571ac101757..e61892506c66 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c @@ -385,9 +385,9 @@ void hsr_prune_nodes(struct timer_list *t) time_b = node->time_in[HSR_PT_SLAVE_B]; /* Check for timestamps old enough to risk wrap-around */ - if (time_after(jiffies, time_a + MAX_JIFFY_OFFSET/2)) + if (time_after(jiffies, time_a + MAX_JIFFY_OFFSET / 2)) node->time_in_stale[HSR_PT_SLAVE_A] = true; - if (time_after(jiffies, time_b + MAX_JIFFY_OFFSET/2)) + if (time_after(jiffies, time_b + MAX_JIFFY_OFFSET / 2)) node->time_in_stale[HSR_PT_SLAVE_B] = true; /* Get age of newest frame from node. @@ -402,7 +402,7 @@ void hsr_prune_nodes(struct timer_list *t) /* Warn of ring error only as long as we get frames at all */ if (time_is_after_jiffies(timestamp + - msecs_to_jiffies(1.5*MAX_SLAVE_DIFF))) { + msecs_to_jiffies(1.5 * MAX_SLAVE_DIFF))) { rcu_read_lock(); port = get_late_port(hsr, node); if (port) From patchwork Fri Apr 5 17:31:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 161886 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp707172jan; Fri, 5 Apr 2019 10:29:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlkLB1ew/QYF9xPQHqgqodRJ8iD/SiB9koyMacI21gZssZVQEJBWdHrr+FIbASIhKc7447 X-Received: by 2002:a17:902:396a:: with SMTP id e39mr14225072plg.220.1554485376678; Fri, 05 Apr 2019 10:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554485376; cv=none; d=google.com; s=arc-20160816; b=S7vKjJi5MNkDbCSd0XRNdK4Ro/EXL7OPqQUOcFXPqtXwZNqgnCSIyxNsX8sjSvRMLh b/ZkLGonlAuYSpe3xD8AIfT14T17nOMLqm4DT0fNY+vFFgmfW8Emwv6MDGwcnfOMdPbt 2x7othcdAjHwjbGOC6Sx4xPO8ceb9mplnAcD9Gb0baynp6ZGthDiJP9gsaXRnEKzKCsL ZbH/8xOz2eai4zMCU2tyYDhKBKDQBM0C4SKF8oyf73fdIOZNF4GYtpItH2EqgiXw3ZLl jyudf+WZWygwwjz0t/ZxtkD6/zQ5UlFzHRC96Ln7OBYW2pCoMbPHlrQCs6bDhHjSlA2k Vmnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=4N8eqxzhFOQTeXsuqHB+hSmqOGNllSSVO6UF4aEi7SI=; b=xq/d4sLXQxzMsAaDcukh7tbWclhGUuUUIY5MUU2Kr8g39uAzZcp/q+vJrr5tTFozFR 4nYdPX/6NmwYxfklKKZqFEC0NfhWN4ECcuZVnZclaJbgyxhxJwjsKguWTJdbGgrSymvh UzGcPWVPFgvsflRCyxOHZBroZA0VMigL+Lj8UU1Rh7uuySaIv0rA4/4XGrySiax3cqzs c50iKBixvUC3QrtolVp3Ia1bVVpZIfBpLDd58ioL0xzYquBBbhjyLMd8nxC+lk7PS6Lv O0BpA95g/wNaEyvwnNNliMNlI8rD9Yvk8rkUUF3RRyipyz1whCv3zfbXYbMsiT/p5Wmx jrTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=TBNZCggI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 70si20298710pfu.227.2019.04.05.10.29.36; Fri, 05 Apr 2019 10:29:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=TBNZCggI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731823AbfDER3e (ORCPT + 31 others); Fri, 5 Apr 2019 13:29:34 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:39432 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731689AbfDER3F (ORCPT ); Fri, 5 Apr 2019 13:29:05 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x35HT1lR084563; Fri, 5 Apr 2019 12:29:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1554485341; bh=4N8eqxzhFOQTeXsuqHB+hSmqOGNllSSVO6UF4aEi7SI=; h=From:To:Subject:Date:In-Reply-To:References; b=TBNZCggISyF5HWJfpTiQO7iiHZt489/mEqdvp/Sg2sVJX+VfR+k8iqsT+pvbH9p9l mA8+zNYPXhLdlHfeCNxayDf0Xa4a10pZobOBBCf1coR2yg/7V/AuwmQCvidx8e5E02 SrW88Jl0xFuPG13r2/UhHNbEibRJFA3PoyIxA2OM= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x35HT19q096362 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 5 Apr 2019 12:29:01 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 5 Apr 2019 12:29:00 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 5 Apr 2019 12:29:00 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x35HSsuX095744; Fri, 5 Apr 2019 12:29:00 -0500 From: Murali Karicheri To: , , , , Subject: [PATCH net 10/14] net: hsr: remove camel case usage in the code Date: Fri, 5 Apr 2019 13:31:32 -0400 Message-ID: <20190405173136.18050-11-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190405173136.18050-1-m-karicheri2@ti.com> References: <20190405173136.18050-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Current driver code uses camel case in many places. This is seen when ran checkpatch.pl -f on files under net/hsr. This patch fixes the code to remove camel case usage. Signed-off-by: Murali Karicheri --- net/hsr/hsr_device.c | 29 ++++++++--------- net/hsr/hsr_forward.c | 38 +++++++++++------------ net/hsr/hsr_framereg.c | 70 +++++++++++++++++++++--------------------- net/hsr/hsr_main.h | 14 ++++----- 4 files changed, 76 insertions(+), 75 deletions(-) -- 2.17.0 diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index 245fc531d39f..99142226622c 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -243,7 +243,7 @@ static const struct header_ops hsr_header_ops = { }; static void send_hsr_supervision_frame(struct hsr_port *master, - u8 type, u8 hsrVer) + u8 type, u8 hsr_ver) { struct sk_buff *skb; int hlen, tlen; @@ -264,28 +264,28 @@ static void send_hsr_supervision_frame(struct hsr_port *master, skb_reserve(skb, hlen); skb->dev = master->dev; - skb->protocol = htons(hsrVer ? ETH_P_HSR : ETH_P_PRP); + skb->protocol = htons(hsr_ver ? ETH_P_HSR : ETH_P_PRP); skb->priority = TC_PRIO_CONTROL; - if (dev_hard_header(skb, skb->dev, (hsrVer ? ETH_P_HSR : ETH_P_PRP), + if (dev_hard_header(skb, skb->dev, (hsr_ver ? ETH_P_HSR : ETH_P_PRP), master->hsr->sup_multicast_addr, skb->dev->dev_addr, skb->len) <= 0) goto out; skb_reset_mac_header(skb); - if (hsrVer > 0) { + if (hsr_ver > 0) { hsr_tag = skb_put(skb, sizeof(struct hsr_tag)); hsr_tag->encap_proto = htons(ETH_P_PRP); set_hsr_tag_LSDU_size(hsr_tag, HSR_V1_SUP_LSDUSIZE); } hsr_stag = skb_put(skb, sizeof(struct hsr_sup_tag)); - set_hsr_stag_path(hsr_stag, (hsrVer ? 0x0 : 0xf)); - set_hsr_stag_HSR_Ver(hsr_stag, hsrVer); + set_hsr_stag_path(hsr_stag, (hsr_ver ? 0x0 : 0xf)); + set_hsr_stag_HSR_ver(hsr_stag, hsr_ver); /* From HSRv1 on we have separate supervision sequence numbers. */ spin_lock_irqsave(&master->hsr->seqnr_lock, irqflags); - if (hsrVer > 0) { + if (hsr_ver > 0) { hsr_stag->sequence_nr = htons(master->hsr->sup_sequence_nr); hsr_tag->sequence_nr = htons(master->hsr->sequence_nr); master->hsr->sup_sequence_nr++; @@ -296,13 +296,14 @@ static void send_hsr_supervision_frame(struct hsr_port *master, } spin_unlock_irqrestore(&master->hsr->seqnr_lock, irqflags); - hsr_stag->HSR_TLV_Type = type; + hsr_stag->HSR_TLV_type = type; /* TODO: Why 12 in HSRv0? */ - hsr_stag->HSR_TLV_Length = hsrVer ? sizeof(struct hsr_sup_payload) : 12; + hsr_stag->HSR_TLV_length = + hsr_ver ? sizeof(struct hsr_sup_payload) : 12; /* Payload: MacAddressA */ hsr_sp = skb_put(skb, sizeof(struct hsr_sup_payload)); - ether_addr_copy(hsr_sp->MacAddressA, master->dev->dev_addr); + ether_addr_copy(hsr_sp->macaddress_A, master->dev->dev_addr); if (skb_put_padto(skb, ETH_ZLEN + HSR_HLEN)) return; @@ -328,15 +329,15 @@ static void hsr_announce(struct timer_list *t) rcu_read_lock(); master = hsr_port_get_hsr(hsr, HSR_PT_MASTER); - if (hsr->announce_count < 3 && hsr->protVersion == 0) { + if (hsr->announce_count < 3 && hsr->prot_version == 0) { send_hsr_supervision_frame(master, HSR_TLV_ANNOUNCE, - hsr->protVersion); + hsr->prot_version); hsr->announce_count++; interval = msecs_to_jiffies(HSR_ANNOUNCE_INTERVAL); } else { send_hsr_supervision_frame(master, HSR_TLV_LIFE_CHECK, - hsr->protVersion); + hsr->prot_version); interval = msecs_to_jiffies(HSR_LIFE_CHECK_INTERVAL); } @@ -455,7 +456,7 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], ether_addr_copy(hsr->sup_multicast_addr, def_multicast_addr); hsr->sup_multicast_addr[ETH_ALEN - 1] = multicast_spec; - hsr->protVersion = protocol_version; + hsr->prot_version = protocol_version; /* FIXME: should I modify the value of these? * diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index 43f91651ba10..602029c44050 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c @@ -48,40 +48,40 @@ struct hsr_frame_info { */ static bool is_supervision_frame(struct hsr_priv *hsr, struct sk_buff *skb) { - struct ethhdr *ethHdr; - struct hsr_sup_tag *hsrSupTag; - struct hsrv1_ethhdr_sp *hsrV1Hdr; + struct ethhdr *eth_hdr; + struct hsr_sup_tag *hsr_sup_tag; + struct hsrv1_ethhdr_sp *hsr_V1_hdr; WARN_ON_ONCE(!skb_mac_header_was_set(skb)); - ethHdr = (struct ethhdr *)skb_mac_header(skb); + eth_hdr = (struct ethhdr *)skb_mac_header(skb); /* Correct addr? */ - if (!ether_addr_equal(ethHdr->h_dest, + if (!ether_addr_equal(eth_hdr->h_dest, hsr->sup_multicast_addr)) return false; /* Correct ether type?. */ - if (!(ethHdr->h_proto == htons(ETH_P_PRP) || - ethHdr->h_proto == htons(ETH_P_HSR))) + if (!(eth_hdr->h_proto == htons(ETH_P_PRP) || + eth_hdr->h_proto == htons(ETH_P_HSR))) return false; /* Get the supervision header from correct location. */ - if (ethHdr->h_proto == htons(ETH_P_HSR)) { /* Okay HSRv1. */ - hsrV1Hdr = (struct hsrv1_ethhdr_sp *)skb_mac_header(skb); - if (hsrV1Hdr->hsr.encap_proto != htons(ETH_P_PRP)) + if (eth_hdr->h_proto == htons(ETH_P_HSR)) { /* Okay HSRv1. */ + hsr_V1_hdr = (struct hsrv1_ethhdr_sp *)skb_mac_header(skb); + if (hsr_V1_hdr->hsr.encap_proto != htons(ETH_P_PRP)) return false; - hsrSupTag = &hsrV1Hdr->hsr_sup; + hsr_sup_tag = &hsr_V1_hdr->hsr_sup; } else { - hsrSupTag = + hsr_sup_tag = &((struct hsrv0_ethhdr_sp *)skb_mac_header(skb))->hsr_sup; } - if (hsrSupTag->HSR_TLV_Type != HSR_TLV_ANNOUNCE && - hsrSupTag->HSR_TLV_Type != HSR_TLV_LIFE_CHECK) + if (hsr_sup_tag->HSR_TLV_type != HSR_TLV_ANNOUNCE && + hsr_sup_tag->HSR_TLV_type != HSR_TLV_LIFE_CHECK) return false; - if (hsrSupTag->HSR_TLV_Length != 12 && - hsrSupTag->HSR_TLV_Length != sizeof(struct hsr_sup_payload)) + if (hsr_sup_tag->HSR_TLV_length != 12 && + hsr_sup_tag->HSR_TLV_length != sizeof(struct hsr_sup_payload)) return false; return true; @@ -125,7 +125,7 @@ static struct sk_buff *frame_get_stripped_skb(struct hsr_frame_info *frame, } static void hsr_fill_tag(struct sk_buff *skb, struct hsr_frame_info *frame, - struct hsr_port *port, u8 protoVersion) + struct hsr_port *port, u8 proto_version) { struct hsr_ethhdr *hsr_ethhdr; int lane_id; @@ -146,7 +146,7 @@ static void hsr_fill_tag(struct sk_buff *skb, struct hsr_frame_info *frame, set_hsr_tag_LSDU_size(&hsr_ethhdr->hsr_tag, lsdu_size); hsr_ethhdr->hsr_tag.sequence_nr = htons(frame->sequence_nr); hsr_ethhdr->hsr_tag.encap_proto = hsr_ethhdr->ethhdr.h_proto; - hsr_ethhdr->ethhdr.h_proto = htons(protoVersion ? + hsr_ethhdr->ethhdr.h_proto = htons(proto_version ? ETH_P_HSR : ETH_P_PRP); } @@ -176,7 +176,7 @@ static struct sk_buff *create_tagged_skb(struct sk_buff *skb_o, memmove(dst, src, movelen); skb_reset_mac_header(skb); - hsr_fill_tag(skb, frame, port, port->hsr->protVersion); + hsr_fill_tag(skb, frame, port, port->hsr->prot_version); return skb; } diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index e61892506c66..cba4b2486050 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c @@ -24,10 +24,10 @@ struct hsr_node { struct list_head mac_list; - unsigned char MacAddressA[ETH_ALEN]; - unsigned char MacAddressB[ETH_ALEN]; + unsigned char macaddress_A[ETH_ALEN]; + unsigned char macaddress_B[ETH_ALEN]; /* Local slave through which AddrB frames are received from this node */ - enum hsr_port_type AddrB_port; + enum hsr_port_type addr_B_port; unsigned long time_in[HSR_PT_PORTS]; bool time_in_stale[HSR_PT_PORTS]; u16 seq_out[HSR_PT_PORTS]; @@ -64,9 +64,9 @@ bool hsr_addr_is_self(struct hsr_priv *hsr, unsigned char *addr) return false; } - if (ether_addr_equal(addr, node->MacAddressA)) + if (ether_addr_equal(addr, node->macaddress_A)) return true; - if (ether_addr_equal(addr, node->MacAddressB)) + if (ether_addr_equal(addr, node->macaddress_B)) return true; return false; @@ -74,13 +74,13 @@ bool hsr_addr_is_self(struct hsr_priv *hsr, unsigned char *addr) /* Search for mac entry. Caller must hold rcu read lock. */ -static struct hsr_node *find_node_by_AddrA(struct list_head *node_db, - const unsigned char addr[ETH_ALEN]) +static struct hsr_node *find_node_by_addr_A(struct list_head *node_db, + const unsigned char addr[ETH_ALEN]) { struct hsr_node *node; list_for_each_entry_rcu(node, node_db, mac_list) { - if (ether_addr_equal(node->MacAddressA, addr)) + if (ether_addr_equal(node->macaddress_A, addr)) return node; } @@ -100,8 +100,8 @@ int hsr_create_self_node(struct list_head *self_node_db, if (!node) return -ENOMEM; - ether_addr_copy(node->MacAddressA, addr_a); - ether_addr_copy(node->MacAddressB, addr_b); + ether_addr_copy(node->macaddress_A, addr_a); + ether_addr_copy(node->macaddress_B, addr_b); rcu_read_lock(); oldnode = list_first_or_null_rcu(self_node_db, @@ -132,7 +132,7 @@ void hsr_del_node(struct list_head *self_node_db) } } -/* Allocate an hsr_node and add it to node_db. 'addr' is the node's AddressA; +/* Allocate an hsr_node and add it to node_db. 'addr' is the node's address_A; * seq_out is used to initialize filtering of outgoing duplicate frames * originating from the newly added node. */ @@ -147,7 +147,7 @@ struct hsr_node *hsr_add_node(struct list_head *node_db, unsigned char addr[], if (!node) return NULL; - ether_addr_copy(node->MacAddressA, addr); + ether_addr_copy(node->macaddress_A, addr); /* We are only interested in time diffs here, so use current jiffies * as initialization. (0 could trigger an spurious ring error warning). @@ -179,9 +179,9 @@ struct hsr_node *hsr_get_node(struct hsr_port *port, struct sk_buff *skb, ethhdr = (struct ethhdr *)skb_mac_header(skb); list_for_each_entry_rcu(node, node_db, mac_list) { - if (ether_addr_equal(node->MacAddressA, ethhdr->h_source)) + if (ether_addr_equal(node->macaddress_A, ethhdr->h_source)) return node; - if (ether_addr_equal(node->MacAddressB, ethhdr->h_source)) + if (ether_addr_equal(node->macaddress_B, ethhdr->h_source)) return node; } @@ -205,8 +205,8 @@ struct hsr_node *hsr_get_node(struct hsr_port *port, struct sk_buff *skb, return hsr_add_node(node_db, ethhdr->h_source, seq_out); } -/* Use the Supervision frame's info about an eventual MacAddressB for merging - * nodes that has previously had their MacAddressB registered as a separate +/* Use the Supervision frame's info about an eventual macaddress_B for merging + * nodes that has previously had their macaddress_B registered as a separate * node. */ void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr, @@ -232,12 +232,12 @@ void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr, hsr_sp = (struct hsr_sup_payload *)skb->data; - /* Merge node_curr (registered on MacAddressB) into node_real */ + /* Merge node_curr (registered on macaddress_B) into node_real */ node_db = &port_rcv->hsr->node_db; - node_real = find_node_by_AddrA(node_db, hsr_sp->MacAddressA); + node_real = find_node_by_addr_A(node_db, hsr_sp->macaddress_A); if (!node_real) /* No frame received from AddrA of this node yet */ - node_real = hsr_add_node(node_db, hsr_sp->MacAddressA, + node_real = hsr_add_node(node_db, hsr_sp->macaddress_A, HSR_SEQNR_START - 1); if (!node_real) goto done; /* No mem */ @@ -245,7 +245,7 @@ void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr, /* Node has already been merged */ goto done; - ether_addr_copy(node_real->MacAddressB, ethhdr->h_source); + ether_addr_copy(node_real->macaddress_B, ethhdr->h_source); for (i = 0; i < HSR_PT_PORTS; i++) { if (!node_curr->time_in_stale[i] && time_after(node_curr->time_in[i], node_real->time_in[i])) { @@ -256,7 +256,7 @@ void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr, if (seq_nr_after(node_curr->seq_out[i], node_real->seq_out[i])) node_real->seq_out[i] = node_curr->seq_out[i]; } - node_real->AddrB_port = port_rcv->type; + node_real->addr_B_port = port_rcv->type; list_del_rcu(&node_curr->mac_list); kfree_rcu(node_curr, rcu_head); @@ -268,7 +268,7 @@ void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr, /* 'skb' is a frame meant for this host, that is to be passed to upper layers. * * If the frame was sent by a node's B interface, replace the source - * address with that node's "official" address (MacAddressA) so that upper + * address with that node's "official" address (macaddress_A) so that upper * layers recognize where it came from. */ void hsr_addr_subst_source(struct hsr_node *node, struct sk_buff *skb) @@ -278,7 +278,7 @@ void hsr_addr_subst_source(struct hsr_node *node, struct sk_buff *skb) return; } - memcpy(ð_hdr(skb)->h_source, node->MacAddressA, ETH_ALEN); + memcpy(ð_hdr(skb)->h_source, node->macaddress_A, ETH_ALEN); } /* 'skb' is a frame meant for another host. @@ -303,16 +303,16 @@ void hsr_addr_subst_dest(struct hsr_node *node_src, struct sk_buff *skb, if (!is_unicast_ether_addr(eth_hdr(skb)->h_dest)) return; - node_dst = find_node_by_AddrA(&port->hsr->node_db, - eth_hdr(skb)->h_dest); + node_dst = find_node_by_addr_A(&port->hsr->node_db, + eth_hdr(skb)->h_dest); if (!node_dst) { WARN_ONCE(1, "%s: Unknown node\n", __func__); return; } - if (port->type != node_dst->AddrB_port) + if (port->type != node_dst->addr_B_port) return; - ether_addr_copy(eth_hdr(skb)->h_dest, node_dst->MacAddressB); + ether_addr_copy(eth_hdr(skb)->h_dest, node_dst->macaddress_B); } void hsr_register_frame_in(struct hsr_node *node, struct hsr_port *port, @@ -406,14 +406,14 @@ void hsr_prune_nodes(struct timer_list *t) rcu_read_lock(); port = get_late_port(hsr, node); if (port) - hsr_nl_ringerror(hsr, node->MacAddressA, port); + hsr_nl_ringerror(hsr, node->macaddress_A, port); rcu_read_unlock(); } /* Prune old entries */ if (time_is_before_jiffies(timestamp + msecs_to_jiffies(HSR_NODE_FORGET_TIME))) { - hsr_nl_nodedown(hsr, node->MacAddressA); + hsr_nl_nodedown(hsr, node->macaddress_A); list_del_rcu(&node->mac_list); /* Note that we need to free this entry later: */ kfree_rcu(node, rcu_head); @@ -431,13 +431,13 @@ void *hsr_get_next_node(struct hsr_priv *hsr, void *_pos, node = list_first_or_null_rcu(&hsr->node_db, struct hsr_node, mac_list); if (node) - ether_addr_copy(addr, node->MacAddressA); + ether_addr_copy(addr, node->macaddress_A); return node; } node = _pos; list_for_each_entry_continue_rcu(node, &hsr->node_db, mac_list) { - ether_addr_copy(addr, node->MacAddressA); + ether_addr_copy(addr, node->macaddress_A); return node; } @@ -458,13 +458,13 @@ int hsr_get_node_data(struct hsr_priv *hsr, unsigned long tdiff; rcu_read_lock(); - node = find_node_by_AddrA(&hsr->node_db, addr); + node = find_node_by_addr_A(&hsr->node_db, addr); if (!node) { rcu_read_unlock(); return -ENOENT; /* No such entry */ } - ether_addr_copy(addr_b, node->MacAddressB); + ether_addr_copy(addr_b, node->macaddress_B); tdiff = jiffies - node->time_in[HSR_PT_SLAVE_A]; if (node->time_in_stale[HSR_PT_SLAVE_A]) @@ -490,8 +490,8 @@ int hsr_get_node_data(struct hsr_priv *hsr, *if1_seq = node->seq_out[HSR_PT_SLAVE_B]; *if2_seq = node->seq_out[HSR_PT_SLAVE_A]; - if (node->AddrB_port != HSR_PT_NONE) { - port = hsr_port_get_hsr(hsr, node->AddrB_port); + if (node->addr_B_port != HSR_PT_NONE) { + port = hsr_port_get_hsr(hsr, node->addr_B_port); *addr_b_ifindex = port->dev->ifindex; } else { *addr_b_ifindex = -1; diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h index 5d28a5371765..d312e8c777ae 100644 --- a/net/hsr/hsr_main.h +++ b/net/hsr/hsr_main.h @@ -97,14 +97,14 @@ struct hsr_ethhdr { * Field names as defined in the IEC:2010 standard for HSR. */ struct hsr_sup_tag { - __be16 path_and_HSR_Ver; + __be16 path_and_HSR_ver; __be16 sequence_nr; - __u8 HSR_TLV_Type; - __u8 HSR_TLV_Length; + __u8 HSR_TLV_type; + __u8 HSR_TLV_length; } __packed; struct hsr_sup_payload { - unsigned char MacAddressA[ETH_ALEN]; + unsigned char macaddress_A[ETH_ALEN]; } __packed; static inline u16 get_hsr_stag_path(struct hsr_sup_tag *hst) @@ -122,9 +122,9 @@ static inline void set_hsr_stag_path(struct hsr_sup_tag *hst, u16 path) set_hsr_tag_path((struct hsr_tag *)hst, path); } -static inline void set_hsr_stag_HSR_Ver(struct hsr_sup_tag *hst, u16 HSR_Ver) +static inline void set_hsr_stag_HSR_ver(struct hsr_sup_tag *hst, u16 HSR_ver) { - set_hsr_tag_LSDU_size((struct hsr_tag *)hst, HSR_Ver); + set_hsr_tag_LSDU_size((struct hsr_tag *)hst, HSR_ver); } struct hsrv0_ethhdr_sp { @@ -164,7 +164,7 @@ struct hsr_priv { int announce_count; u16 sequence_nr; u16 sup_sequence_nr; /* For HSRv1 separate seq_nr for supervision */ - u8 protVersion; /* Indicate if HSRv0 or HSRv1. */ + u8 prot_version; /* Indicate if HSRv0 or HSRv1. */ spinlock_t seqnr_lock; /* locking for sequence_nr */ unsigned char sup_multicast_addr[ETH_ALEN]; }; From patchwork Fri Apr 5 17:31:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 161881 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp706722jan; Fri, 5 Apr 2019 10:29:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqcXVPC4wr32EETPbSHdY6ePghoqrIcI7Gi4ltRtdXRJu+pJ8PDqnjSscIbXeIw8zXxTsV X-Received: by 2002:a62:69c2:: with SMTP id e185mr13722321pfc.119.1554485349254; Fri, 05 Apr 2019 10:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554485349; cv=none; d=google.com; s=arc-20160816; b=asSNkUX0B3D8qebqsGXjxftm1N5mt6pOAF5MU9L7Cfe1dF4bhG1MMSTFk6N5AshQu9 WanHkEXcSrvUEdaDNy3SrKeZ0nX35V1dOwKmHVpZ2XcCWml/YKyZQhME+uiIDJerYq8H IpZGfZRhAVTHzcxdsdbxJZVC2l79TV4KeiE/4XPegDvS1hJAtqppSvs6nUmuuv83D1ek idgW6k7/1x8SIvr79UGGVwk58HyzMQL1ubqld78Suzk9/1GE1RoyQufgsFoD5U1We8nc MhZlCOfLci/DA9vePcCF8N+NkATLVBtH6aJx3xiOnLqALJ3Xtfz2nFIMnzeoavl9twcS NLDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=s4ndvrZgEDLY14jKjIVuslAI+tMO/F73zDB118TBf3E=; b=o3afDM/WlcT3oGm2YVbgy2n4htMgvyVHgC/fYCr8Ja81bSVkKvRvlWx0XbhSpnGNr9 Vpg2sQnK84wqB15KtnI79bUVChuWmoILMi/edtvDqPWyA7oc+kQZ88ukk0s6YG/EW7Yh FfXr3I/5XtH96QVqAYHZSgn0jWANrGNfUO1A9rY9w8aY9IwA9+CmOmmQXlIugNe9NTE+ KB7MrsZeqnacWp2ceFIwlFchv2PAWt8snbJzx0wgtIzlxxelBkHfWUUmKyeQHzyU4DPo lLweRRSris8kr/stUEgagTzp//Vrwx+8IghMN88cio9WI0kdSNQ6N9Trbc2KLxiCGdV9 bWyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=qVML4Xxa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9si19145384pff.52.2019.04.05.10.29.08; Fri, 05 Apr 2019 10:29:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=qVML4Xxa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731582AbfDER3H (ORCPT + 31 others); Fri, 5 Apr 2019 13:29:07 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:56324 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731690AbfDER3E (ORCPT ); Fri, 5 Apr 2019 13:29:04 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x35HT2X5131007; Fri, 5 Apr 2019 12:29:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1554485342; bh=s4ndvrZgEDLY14jKjIVuslAI+tMO/F73zDB118TBf3E=; h=From:To:Subject:Date:In-Reply-To:References; b=qVML4Xxa46nG9ippoIkfolQHRSwa9tgSHPapc1yrjvhV05buk/UETDQxRWz4kAS7P akw7xIiaSf24xzLvEfGLI34rBBT0UJu19HlUXe3GE/WBtj44gLvrIAoSgjUC1lGfcc +FMbao464DGuc3pmHiqpyzNMseIT+1pqCDlwzuLw= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x35HT10f096360 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 5 Apr 2019 12:29:02 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 5 Apr 2019 12:29:01 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 5 Apr 2019 12:29:01 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x35HSsuY095744; Fri, 5 Apr 2019 12:29:00 -0500 From: Murali Karicheri To: , , , , Subject: [PATCH net 11/14] net: hsr: add blank line after function declaration Date: Fri, 5 Apr 2019 13:31:33 -0400 Message-ID: <20190405173136.18050-12-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190405173136.18050-1-m-karicheri2@ti.com> References: <20190405173136.18050-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a blank line after function declaration as suggested by checkpatch.pl -f Signed-off-by: Murali Karicheri --- net/hsr/hsr_framereg.c | 1 + 1 file changed, 1 insertion(+) -- 2.17.0 diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index cba4b2486050..14f816149489 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c @@ -49,6 +49,7 @@ static bool seq_nr_after(u16 a, u16 b) return (((s16)(b - a)) < 0); } + #define seq_nr_before(a, b) seq_nr_after((b), (a)) #define seq_nr_after_or_eq(a, b) (!seq_nr_before((a), (b))) #define seq_nr_before_or_eq(a, b) (!seq_nr_after((a), (b))) From patchwork Fri Apr 5 17:31:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 161885 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp707136jan; Fri, 5 Apr 2019 10:29:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwN/Vn+5PwvLuhrV3WY84VKC3cdzxPLDrA3bsUoMkigKa5GCbKEaNAjK05Jo+5DJg0vhZSI X-Received: by 2002:aa7:8a92:: with SMTP id a18mr14012736pfc.218.1554485375097; Fri, 05 Apr 2019 10:29:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554485375; cv=none; d=google.com; s=arc-20160816; b=AfRw4JfUfOnH76/530cmxGKg5Kn6shfll8gNeP5+29kfLaO4LwZUnPaDSH1N1+HG8m 4jjhbYedrXEJTgEnSA3K6UNxbc5r9RQ8C/gFCcwrahtEVDosJ5peKiW6zyKTZ9Qbx1Mb 1rk2D0juGT/rVPOrzJT1xZasn07VtpWymLGd+CI71HgMk6YNrqj4Y5iCOmKWgdGrxMpV xEuyYppp1Tg1SvpwLKdC53ClFDRWiErTeRDSNgiiahxxrWQlrBEKjyIddfkg8Y6jEewV 2h/YqYqBoqrlaPrJ9EK9ywQHKoPOo3RaCXAnnpMRVEH0YZTzYtsH7sEnWPJ/2TBPYnJS +Ogw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=ctSIEeXKSrrC8w6FdzD/aTttmPpgbuAUBueVxeXVSk4=; b=pbZOu6zzWJ2SGONRppx5H4Gs0u358LGBDinXksoaPoFcf3PPQgtWiRe9rt2CuvtBdw dMF46Ok/q24TWzmygtHbsWlhm9UUfUH9tY2QItsPK1OrJxHiPr+KaD4VrQNt/tmNNcx7 0+qyauUltVYvFE9dJ7skQn5ZpPf9cg3ZkQHcahkoPVHth5n3jCePwxLBPZZX9bpdfJzF t2aMhPsbcWeAuV0MLnUr7raz5uyVwQJOjsy7KlrN4H7GBo0aiisXzpFZraUMaGGsejcc 4GeR9sdKXngyC/zSnnibLBr+Fa1iy12dR5U/JI0Cnk6IA+X6K8uDTAoHMOMztT1+xLNj 5j2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=j2WyRwkT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 78si19109244pga.566.2019.04.05.10.29.34; Fri, 05 Apr 2019 10:29:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=j2WyRwkT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731809AbfDER3e (ORCPT + 31 others); Fri, 5 Apr 2019 13:29:34 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:56328 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731694AbfDER3F (ORCPT ); Fri, 5 Apr 2019 13:29:05 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x35HT21U131011; Fri, 5 Apr 2019 12:29:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1554485342; bh=ctSIEeXKSrrC8w6FdzD/aTttmPpgbuAUBueVxeXVSk4=; h=From:To:Subject:Date:In-Reply-To:References; b=j2WyRwkTOIZ3Mpgel3BNOHZsPCRDkmD6NOZs+t+ZdbXjI6hxFehsqUjI7LL/TQh9H WFSZoqejQbNsdPPFk3VdHpbMHd2x2Rg+0jeKJL2mSSKY5qsC+PRYn3RoUC9liuV6Kp 5xSm01xqhAeTJx9LbGhbpJZD95uPz7xpnrXvpXIo= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x35HT2eU096566 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 5 Apr 2019 12:29:02 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 5 Apr 2019 12:29:02 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 5 Apr 2019 12:29:02 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x35HSsua095744; Fri, 5 Apr 2019 12:29:01 -0500 From: Murali Karicheri To: , , , , Subject: [PATCH net 13/14] net: hsr: add debugfs support for display node list Date: Fri, 5 Apr 2019 13:31:35 -0400 Message-ID: <20190405173136.18050-14-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190405173136.18050-1-m-karicheri2@ti.com> References: <20190405173136.18050-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds a debugfs interface to allow display the nodes learned by the hsr master. Signed-off-by: Murali Karicheri --- net/hsr/Makefile | 1 + net/hsr/hsr_device.c | 5 ++ net/hsr/hsr_framereg.c | 12 ---- net/hsr/hsr_framereg.h | 12 ++++ net/hsr/hsr_main.h | 17 ++++++ net/hsr/hsr_prp_debugfs.c | 120 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 155 insertions(+), 12 deletions(-) create mode 100644 net/hsr/hsr_prp_debugfs.c -- 2.17.0 diff --git a/net/hsr/Makefile b/net/hsr/Makefile index 9ae972a820f4..d74d89d013b0 100644 --- a/net/hsr/Makefile +++ b/net/hsr/Makefile @@ -6,3 +6,4 @@ obj-$(CONFIG_HSR) += hsr.o hsr-y := hsr_main.o hsr_framereg.o hsr_device.o \ hsr_netlink.o hsr_slave.o hsr_forward.o +hsr-$(CONFIG_DEBUG_FS) += hsr_prp_debugfs.o diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index bb7bf2002040..b47a621e3f4e 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -354,6 +354,8 @@ static void hsr_dev_destroy(struct net_device *hsr_dev) hsr = netdev_priv(hsr_dev); + hsr_prp_debugfs_term(hsr); + rtnl_lock(); hsr_for_each_port(hsr, port) hsr_del_port(port); @@ -483,6 +485,9 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], goto fail; mod_timer(&hsr->prune_timer, jiffies + msecs_to_jiffies(PRUNE_PERIOD)); + res = hsr_prp_debugfs_init(hsr); + if (res) + goto fail; return 0; diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index 22203562821f..a3cc30ac8a5a 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c @@ -18,18 +18,6 @@ #include "hsr_framereg.h" #include "hsr_netlink.h" -struct hsr_node { - struct list_head mac_list; - unsigned char macaddress_A[ETH_ALEN]; - unsigned char macaddress_B[ETH_ALEN]; - /* Local slave through which AddrB frames are received from this node */ - enum hsr_port_type addr_B_port; - unsigned long time_in[HSR_PT_PORTS]; - bool time_in_stale[HSR_PT_PORTS]; - u16 seq_out[HSR_PT_PORTS]; - struct rcu_head rcu_head; -}; - /* TODO: use hash lists for mac addresses (linux/jhash.h)? */ /* seq_nr_after(a, b) - return true if a is after (higher in sequence than) b, diff --git a/net/hsr/hsr_framereg.h b/net/hsr/hsr_framereg.h index 5f515d4cd088..a3bdcdab469d 100644 --- a/net/hsr/hsr_framereg.h +++ b/net/hsr/hsr_framereg.h @@ -48,4 +48,16 @@ int hsr_get_node_data(struct hsr_priv *hsr, int *if2_age, u16 *if2_seq); +struct hsr_node { + struct list_head mac_list; + unsigned char macaddress_A[ETH_ALEN]; + unsigned char macaddress_B[ETH_ALEN]; + /* Local slave through which AddrB frames are received from this node */ + enum hsr_port_type addr_B_port; + unsigned long time_in[HSR_PT_PORTS]; + bool time_in_stale[HSR_PT_PORTS]; + u16 seq_out[HSR_PT_PORTS]; + struct rcu_head rcu_head; +}; + #endif /* __HSR_FRAMEREG_H */ diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h index 1e49675ca186..778213f07fe0 100644 --- a/net/hsr/hsr_main.h +++ b/net/hsr/hsr_main.h @@ -163,6 +163,10 @@ struct hsr_priv { u8 prot_version; /* Indicate if HSRv0 or HSRv1. */ spinlock_t seqnr_lock; /* locking for sequence_nr */ unsigned char sup_multicast_addr[ETH_ALEN]; +#ifdef CONFIG_DEBUG_FS + struct dentry *node_tbl_root; + struct dentry *node_tbl_file; +#endif }; #define hsr_for_each_port(hsr, port) \ @@ -179,4 +183,17 @@ static inline u16 hsr_get_skb_sequence_nr(struct sk_buff *skb) return ntohs(hsr_ethhdr->hsr_tag.sequence_nr); } +#if IS_ENABLED(CONFIG_DEBUG_FS) +int hsr_prp_debugfs_init(struct hsr_priv *priv); +void hsr_prp_debugfs_term(struct hsr_priv *priv); +#else +static inline int hsr_prp_debugfs_init(struct hsr_priv *priv) +{ + return 0; +} + +static inline void hsr_prp_debugfs_term(struct hsr_priv *priv) +{} +#endif + #endif /* __HSR_PRIVATE_H */ diff --git a/net/hsr/hsr_prp_debugfs.c b/net/hsr/hsr_prp_debugfs.c new file mode 100644 index 000000000000..b30e98734c61 --- /dev/null +++ b/net/hsr/hsr_prp_debugfs.c @@ -0,0 +1,120 @@ +/* + * hsr_prp_debugfs code + * Copyright (C) 2017 Texas Instruments Incorporated + * + * Author(s): + * Murali Karicheri +#include +#include +#include "hsr_main.h" +#include "hsr_framereg.h" + +static void print_mac_address(struct seq_file *sfp, unsigned char *mac) +{ + seq_printf(sfp, "%02x:%02x:%02x:%02x:%02x:%02x:", + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); +} + +/* hsr_prp_node_table_show - Formats and prints node_table entries */ +static int +hsr_prp_node_table_show(struct seq_file *sfp, void *data) +{ + struct hsr_priv *priv = (struct hsr_priv *)sfp->private; + struct hsr_node *node; + + seq_puts(sfp, "Node Table entries\n"); + seq_puts(sfp, "MAC-Address-A, MAC-Address-B, time_in[A], "); + seq_puts(sfp, "time_in[B], Address-B port\n"); + rcu_read_lock(); + list_for_each_entry_rcu(node, &priv->node_db, mac_list) { + /* skip self node */ + if (hsr_addr_is_self(priv, node->macaddress_A)) + continue; + print_mac_address(sfp, &node->macaddress_A[0]); + seq_puts(sfp, " "); + print_mac_address(sfp, &node->macaddress_B[0]); + seq_printf(sfp, "0x%lx, ", node->time_in[HSR_PT_SLAVE_A]); + seq_printf(sfp, "0x%lx ", node->time_in[HSR_PT_SLAVE_B]); + seq_printf(sfp, "0x%x\n", node->addr_B_port); + } + rcu_read_unlock(); + return 0; +} + +/* hsr_prp_node_table_open - Open the node_table file + * + * Description: + * This routine opens a debugfs file node_table of specific hsr device + */ +static int +hsr_prp_node_table_open(struct inode *inode, struct file *filp) +{ + return single_open(filp, hsr_prp_node_table_show, inode->i_private); +} + +static const struct file_operations hsr_prp_fops = { + .owner = THIS_MODULE, + .open = hsr_prp_node_table_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + +/* hsr_prp_debugfs_init - create hsr-prp node_table file for dumping + * the node table + * + * Description: + * When debugfs is configured this routine sets up the node_table file per + * hsr/prp device for dumping the node_table entries + */ +int hsr_prp_debugfs_init(struct hsr_priv *priv) +{ + int rc = -1; + struct dentry *de = NULL; + + de = debugfs_create_dir("hsr", NULL); + if (!de) { + pr_err("Cannot create hsr-prp debugfs root\n"); + return rc; + } + + priv->node_tbl_root = de; + + de = debugfs_create_file("node_table", S_IFREG | 0444, + priv->node_tbl_root, priv, + &hsr_prp_fops); + if (!de) { + pr_err("Cannot create hsr-prp node_table directory\n"); + return rc; + } + priv->node_tbl_file = de; + rc = 0; + + return rc; +} + +/* hsr_prp_debugfs_term - Tear down debugfs intrastructure + * + * Description: + * When Debufs is configured this routine removes debugfs file system + * elements that are specific to hsr-prp + */ +void +hsr_prp_debugfs_term(struct hsr_priv *priv) +{ + debugfs_remove(priv->node_tbl_file); + priv->node_tbl_file = NULL; + debugfs_remove(priv->node_tbl_root); + priv->node_tbl_root = NULL; +} From patchwork Fri Apr 5 17:31:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 161884 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp706892jan; Fri, 5 Apr 2019 10:29:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqydIt2nDTgP0XplLqmCpRTCZyNluNQ78j14Cj2mVjz7s71TaEbJ+5OYZP15R0T1jhRS+C61 X-Received: by 2002:a17:902:d24:: with SMTP id 33mr14576132plu.246.1554485360480; Fri, 05 Apr 2019 10:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554485360; cv=none; d=google.com; s=arc-20160816; b=wB7mA1wtMTn9FRGhaIexHCRLphMYiYSZ7+AfS3Mhdx8ZIBUnGmt0Ub5wGaFcG7Hm2k UIhYqv5xAHlqRtwwCM3gEHPcBZUjRzsk3R3gLrYSR5gqmDpUggHCEEzVy8a30XUhk31j Uarh6Q0T0nfS2ou/Xv7Syqz3NMt24IN1Bikc+g2cf8pbbshYJOjNDNOz0DUQmRyZQjcA fnE+LKNkF/VeHIxdKqD6wKnQt/16oDE0leRs35SjM15lirdiCNJBV4DaI3uB3QzrD07C uA19I9DSsh9Glayesa9UfssHqzDpX9YzKIJ3SuLQNJW0a2snek3a+2b/h78PZlkypIie A5Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=QfKLSOWpaNEAmUiFaUOcU4SMCjMPov4tmkM4IrTqZgA=; b=Q7XBaoIrlVBSo+gkt9iSolLPQjt8FQn9pTaRcMbn5pXSrAGFgJFwcq92dLLyf81xq6 ymX8Ty2l5Jsi0KUZJPIhQC+UNdraqS6U7wadb2j2/f/qBGM8agADwT7cmC17JXF6Sc/F YDNGDcYZKJatI3SrWzwhR17n8Pm/K1XuyUS4SJ9SVei+SMIm+ndH27DXhKUcWtHMzkyA KB5tcIvjeBxRRrP3JYyH3GmsZYaQhanykcWYpRGASkyxSQbzoJXk/FIF20z9kZqMX1Ds y7OaXPfTWNrw+EuE/rsBS+kfH4wsRpVrJJYHbOtMUeb/7z2bOGjCVF27W3QurbzxIC8Y HuEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=hTfCem0b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9si19145384pff.52.2019.04.05.10.29.20; Fri, 05 Apr 2019 10:29:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=hTfCem0b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731766AbfDER3N (ORCPT + 31 others); Fri, 5 Apr 2019 13:29:13 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:56332 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731710AbfDER3G (ORCPT ); Fri, 5 Apr 2019 13:29:06 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x35HT3GV131024; Fri, 5 Apr 2019 12:29:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1554485343; bh=QfKLSOWpaNEAmUiFaUOcU4SMCjMPov4tmkM4IrTqZgA=; h=From:To:Subject:Date:In-Reply-To:References; b=hTfCem0b3sOeedFAhoLkLYnREXd/aBCpn2YHISMasVZAfl62uFSj39CK4XDlorKBE kaU/HPClBvCMo4i0fhksmBOdYQAIu6xSuOxoLLHUjkqsCnSo0ybcfuYUqb7LaU4Hqd z4kep1U9y7Fics/gexiPFHkahOsFjExLEYzt0YBU= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x35HT3pH097042 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 5 Apr 2019 12:29:03 -0500 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 5 Apr 2019 12:29:02 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 5 Apr 2019 12:29:02 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x35HSsub095744; Fri, 5 Apr 2019 12:29:02 -0500 From: Murali Karicheri To: , , , , Subject: [PATCH net 14/14] net: hsr: Fix node prune function for forget time expiry Date: Fri, 5 Apr 2019 13:31:36 -0400 Message-ID: <20190405173136.18050-15-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190405173136.18050-1-m-karicheri2@ti.com> References: <20190405173136.18050-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aaron Kramer HSR should forget nodes after configured node forget time expiry based on HSR_NODE_FORGET_TIME. As part of hsr_prune_nodes(), code checks to see if entries are to be flushed out if not heard for longer than forget time. But currently hsr_prune_nodes() is called only once during device creation. Restart the timer at the end of hsr_prune_nodes() so that hsr_prune_nodes() gets called periodically and forgotten entries are removed from node table. Signed-off-by: Aaron Kramer Signed-off-by: Murali Karicheri --- net/hsr/hsr_framereg.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.17.0 diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index a3cc30ac8a5a..9fa9abd83018 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c @@ -405,6 +405,10 @@ void hsr_prune_nodes(struct timer_list *t) } } rcu_read_unlock(); + + /* Restart timer */ + mod_timer(&hsr->prune_timer, + jiffies + msecs_to_jiffies(PRUNE_PERIOD)); } void *hsr_get_next_node(struct hsr_priv *hsr, void *_pos,