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; }