Message ID | 20231121123428.20907-2-ilpo.jarvinen@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp585661vqb; Tue, 21 Nov 2023 04:35:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IENDJyxHa1D4YRbrNjxdeSLMmNgTp2/MamfeJ9H7+vBkHG/06Tg7HxBxO8bp99V4dYULUH5 X-Received: by 2002:a05:6808:1185:b0:3ae:554b:6c57 with SMTP id j5-20020a056808118500b003ae554b6c57mr12253950oil.11.1700570102136; Tue, 21 Nov 2023 04:35:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700570102; cv=none; d=google.com; s=arc-20160816; b=oFpSdLUon79I1jgW6VTax4V2l+4LF4vuHJBq16wd/yWSRZ7zYT2Cn3WfMWPEg1JNwY MPYELTouUWVjiRXOiLWPXbH2plpPzAr1M6pPD/5iY5yPP+3wpPegVvSenuGTLj9IBWKj ZPYmIHhLXnb44BW6eDj9tV2pR/TXKfwUedOSymfdhzhLxtv6IxnEkzQXCD1I63Dyqoxd 4iBwabul95O9S7azKqXhEfVPVAe7zIY2aNSttfBi0EpxRfOqpLBctMdbPpCTo3qqABca 1F2p1WPh11hGrjotAPuDLFxFGjGZ08pn2SIIsGGlC043rS0W7gXGqap8RSJX05c/rrD2 /Vpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yEuadT3J77AROzwqn5ZlD/G3jIuuHLd1Hj7O5oEpAHU=; fh=7oDCV+PgZeDh2ftCDaD0KapxBZeZQ/COfAiPb0KaTTc=; b=chnLnSS7v1f1nAd0L6p+TD1t6IsU+en/h/PVggk7ruyHypQlqvuHeTZfbBGGSjNyhY Quy2K9AytbLFMUOlCajg0NhLASoxyXsELbaGwjC+4MZKCrSZw/Rz/5ls47T2ypc2IZ6j P/VmlQBv86ebc/aThCM1zGnDV5rxOhWpYbpcCnFQCTHo1qkWVtQhvF7zq45IHlpKjFNK 2d3xqJALAX8gV9hSkgt4/9wWOmhH/y+4zKhSpspYZFGFkFOhInCgt66Shc9rsEdzV0qg fTQIvwUMyXVCckOZfTLhShNMhJpEuWZkI9IP78ugUBFU8II6kZFAZnmdZNQ4Sxb+bXtG Db9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=foBXaPCg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id r21-20020a635155000000b0058974d3c296si10594902pgl.815.2023.11.21.04.34.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 04:35:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=foBXaPCg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 36D3381121C6; Tue, 21 Nov 2023 04:34:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234755AbjKUMe7 (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Tue, 21 Nov 2023 07:34:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234751AbjKUMe6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 21 Nov 2023 07:34:58 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E6281BB; Tue, 21 Nov 2023 04:34:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700570094; x=1732106094; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zQpj7OaTDonluY2E3OGQf5kVh3FqltWnatkxOc0duHk=; b=foBXaPCgyskUKZVugWfEhtAg6wv9tvOnNXr/q/YjPP41K3AnvgVYq7JF aceOQ4ZqHkw08XbBkCrNREgxHODCaczubNY9JVQdQS7udH9yIWTMq26Rf I2Nvw5CIuhlwZXeh4DyzOLiXjiX7X5mL7E411mvORE5OAf/Nx5kEHwEM4 HuydYME0RL0LGkTY5hlilc0wKHjldNY60nAT1nAQvQsWl0nnOrINHuK92 FICoiqbdmpGRz8cosGDCm2TvgYmATatpsHA76GZTP+u83mDXvwQx0k+AW yv0D6rvAww7tCWwdvxXh9tjszdUokKlsCXY9wWTqJNvBpDLrIl/1SN1aO w==; X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="10496056" X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="10496056" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2023 04:34:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="14496367" Received: from wpastern-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.57.17]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2023 04:34:50 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> To: "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, intel-wired-lan@lists.osuosl.org, Jakub Kicinski <kuba@kernel.org>, Jesse Brandeburg <jesse.brandeburg@intel.com>, Jonathan Cameron <Jonathan.Cameron@huawei.com>, netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>, Tony Nguyen <anthony.l.nguyen@intel.com>, linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> Subject: [PATCH v4 1/3] igb: Use FIELD_GET() to extract Link Width Date: Tue, 21 Nov 2023 14:34:26 +0200 Message-Id: <20231121123428.20907-2-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231121123428.20907-1-ilpo.jarvinen@linux.intel.com> References: <20231121123428.20907-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 21 Nov 2023 04:34:58 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783176995099296527 X-GMAIL-MSGID: 1783176995099296527 |
Series |
net/ethernet/intel: PCI cleanups
|
|
Commit Message
Ilpo Järvinen
Nov. 21, 2023, 12:34 p.m. UTC
Use FIELD_GET() to extract PCIe Negotiated Link Width field instead of custom masking and shifting. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> --- drivers/net/ethernet/intel/igb/e1000_mac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Comments
On Tue, Nov 21, 2023 at 02:34:26PM +0200, Ilpo Järvinen wrote: > Use FIELD_GET() to extract PCIe Negotiated Link Width field instead of > custom masking and shifting. > > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> > Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Thanks, nice to see FIELD_GET() used here. Reviewed-by: Simon Horman <horms@kernel.org>
> -----Original Message----- > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Ilpo Järvinen > Sent: Tuesday, November 21, 2023 6:04 PM > To: David S. Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; intel-wired-lan@lists.osuosl.org; Jakub Kicinski <kuba@kernel.org>; Brandeburg, Jesse <jesse.brandeburg@intel.com>; Jonathan Cameron <Jonathan.Cameron@huawei.com>; netdev@vger.kernel.org; Paolo Abeni <pabeni@redhat.com>; Nguyen, Anthony L <anthony.l.nguyen@intel.com>; linux-kernel@vger.kernel.org > Cc: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> > Subject: [Intel-wired-lan] [PATCH v4 1/3] igb: Use FIELD_GET() to extract Link Width > > Use FIELD_GET() to extract PCIe Negotiated Link Width field instead of > custom masking and shifting. > > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> > Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > --- > drivers/net/ethernet/intel/igb/e1000_mac.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
diff --git a/drivers/net/ethernet/intel/igb/e1000_mac.c b/drivers/net/ethernet/intel/igb/e1000_mac.c index caf91c6f52b4..5a23b9cfec6c 100644 --- a/drivers/net/ethernet/intel/igb/e1000_mac.c +++ b/drivers/net/ethernet/intel/igb/e1000_mac.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2007 - 2018 Intel Corporation. */ +#include <linux/bitfield.h> #include <linux/if_ether.h> #include <linux/delay.h> #include <linux/pci.h> @@ -50,9 +51,8 @@ s32 igb_get_bus_info_pcie(struct e1000_hw *hw) break; } - bus->width = (enum e1000_bus_width)((pcie_link_status & - PCI_EXP_LNKSTA_NLW) >> - PCI_EXP_LNKSTA_NLW_SHIFT); + bus->width = (enum e1000_bus_width)FIELD_GET(PCI_EXP_LNKSTA_NLW, + pcie_link_status); } reg = rd32(E1000_STATUS);