Received: by 10.223.176.5 with SMTP id f5csp863622wra; Fri, 9 Feb 2018 08:24:53 -0800 (PST) X-Google-Smtp-Source: AH8x224SoDVCChcLGdyTDzqWi3IcUp6C88YGqsZXZCsFer26+vqmQxguUKKEDIl9J28tH5GsBCmP X-Received: by 2002:a17:902:48c8:: with SMTP id u8-v6mr2997197plh.272.1518193493701; Fri, 09 Feb 2018 08:24:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518193493; cv=none; d=google.com; s=arc-20160816; b=o2IGmJvmtlkTm9gH0CYER6aAN+s1GYldoCopC0qBtTtD/hEg+DYtD+ShdX0DOsXDTq n0jhAVKShdCaRbCjad6RbyD+fJpoemcLjS8kfGaEyjOI9n5fr9ZJChrhvt1m7M06SyNG Wx1S4Ih7C8VFUYL+v9oSO8faMqwgCVpEI5/5rWL0d1iB/yQZ66xH0NjYQWPEFRMVQOVP FJsVlos1Hct+5j13vy47P3ZCy/MMwaGVqF+L2cysSUxM8ZCJIuQwZb3Gu2c+mbVkSO3Y 7gOrSt2l0obEksJ29TBlB0xplMIKEKL0/7zMBbEnWHLNENSso26h3+a3g5EZ2pMDeb+v SHjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=FCsdIEA3lfFQVJwNxeIEO1UAjSRX3UWvcz/L8JC9Xws=; b=nkZaqeQYHaijRgyt8BpsCFwOY8ryhkqdrY6bMRtcP3DcMb8thsf/JrRalH0DkHQTWd iwUUd+v24JI84SNLIbZ0o4XmeHjHowecV9XTulvGoPld/QJZdUvZ0+zQE1c2XmCShEjk 3S2W4g96Cs5MPdyrHlMF5TuT3DoI/gvU05ekIUTLndsCJ1WgsDtwbIfphcxu2YjdKtjp aLl6F7qJLo9L8PyReGXFIhYuDbW9f9H5DfkPIig9LYpxIne/tbH+0+nLaBeEgYR24I7X kGA7q1MJ0+Tpz9l62CK6/Qv3f5ECSSH+S+rjy7VGXbgAZREBDjpMUfGHOLieP7/o5hD4 iXcw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c4si1909121pfg.151.2018.02.09.08.24.39; Fri, 09 Feb 2018 08:24:53 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752401AbeBIQXU (ORCPT + 99 others); Fri, 9 Feb 2018 11:23:20 -0500 Received: from bastet.se.axis.com ([195.60.68.11]:49982 "EHLO bastet.se.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752359AbeBIQXT (ORCPT ); Fri, 9 Feb 2018 11:23:19 -0500 Received: from localhost (localhost [127.0.0.1]) by bastet.se.axis.com (Postfix) with ESMTP id 1140C186A1; Fri, 9 Feb 2018 17:23:18 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at bastet.se.axis.com Received: from bastet.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bastet.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id dnlR50Fk0Ils; Fri, 9 Feb 2018 17:23:17 +0100 (CET) Received: from boulder03.se.axis.com (boulder03.se.axis.com [10.0.8.17]) by bastet.se.axis.com (Postfix) with ESMTPS id 67938188E8; Fri, 9 Feb 2018 17:23:17 +0100 (CET) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 566C81E07A; Fri, 9 Feb 2018 17:23:17 +0100 (CET) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4B11F1E078; Fri, 9 Feb 2018 17:23:17 +0100 (CET) Received: from seth.se.axis.com (unknown [10.0.2.172]) by boulder03.se.axis.com (Postfix) with ESMTP; Fri, 9 Feb 2018 17:23:17 +0100 (CET) Received: from lnxartpec1.se.axis.com (lnxartpec1.se.axis.com [10.88.4.10]) by seth.se.axis.com (Postfix) with ESMTP id 3EF1126B8; Fri, 9 Feb 2018 17:23:17 +0100 (CET) Received: by lnxartpec1.se.axis.com (Postfix, from userid 20283) id 39C90401B8; Fri, 9 Feb 2018 17:23:16 +0100 (CET) From: Niklas Cassel To: Giuseppe Cavallaro , Alexandre Torgue Cc: Niklas Cassel , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 3/3] net: stmmac: remove redundant enable of PMT irq Date: Fri, 9 Feb 2018 17:22:47 +0100 Message-Id: <20180209162247.3724-4-niklas.cassel@axis.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180209162247.3724-1-niklas.cassel@axis.com> References: <20180209162247.3724-1-niklas.cassel@axis.com> X-TM-AS-GCONF: 00 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For dwmac4, GMAC_INT_DEFAULT_ENABLE already includes GMAC_INT_PMT_EN, so it is redundant to check if hw->pmt is set, and if so, setting the bit again. For dwmac1000, GMAC_INT_DEFAULT_MASK does not include GMAC_INT_DISABLE_PMT, so it is redundant to check if hw->pmt is set, and if so, clearing an already cleared bit. Improve code readability by removing this redundant code. Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 2 -- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c index 540d21786a43..ef10baf14186 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c @@ -74,8 +74,6 @@ static void dwmac1000_core_init(struct mac_device_info *hw, /* Mask GMAC interrupts */ value = GMAC_INT_DEFAULT_MASK; - if (hw->pmt) - value &= ~GMAC_INT_DISABLE_PMT; if (hw->pcs) value &= ~GMAC_INT_DISABLE_PCS; diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index 6badc63d8e6d..63795ecafc8d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -63,8 +63,7 @@ static void dwmac4_core_init(struct mac_device_info *hw, /* Enable GMAC interrupts */ value = GMAC_INT_DEFAULT_ENABLE; - if (hw->pmt) - value |= GMAC_INT_PMT_EN; + if (hw->pcs) value |= GMAC_PCS_IRQ_DEFAULT; -- 2.14.2