Message ID | 20230919125648.1920-4-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:172:b0:3f2:4152:657d with SMTP id h50csp3588179vqi; Tue, 19 Sep 2023 11:15:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGsoavm3AYZJcFx7rt62mkUGeimPMBjfQtiQP/ogt/TdEE8xPcV5tfB89XWMEgIKx2TKjAm X-Received: by 2002:a05:6e02:1c89:b0:34c:ceaf:b627 with SMTP id w9-20020a056e021c8900b0034cceafb627mr620091ill.29.1695147337217; Tue, 19 Sep 2023 11:15:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695147337; cv=none; d=google.com; s=arc-20160816; b=d2KMgxB/YWJuFb780HWBwFuTqEfgq4FD+qOvfd5was6a5+25VyNJQRGweY/os5tyFb 4gXi1xMLDuM8DxdqZWE214ZOdmsOYPQXAok5vbpD28n2JtTHNXVkvjSGqf0cdhjTJA9m uhnJ/uQ8Li6V/awz+YhltWp+FKQ61TEOBmqdU4o4KPyr7chmh/L3o8NmcKNENt1wFqZ7 ujjClzNp7IEiW/P/EHDqUKJo593urEGcK/wJPmiOotK65cQE5gkBvJ9wKRobgdTHZhyH LLoTu5ssGjgEtWqY+V7ieVea6UkJ7EIn0dZnChQkXZ+FOHMIAvVmRcH6U88YGfQhRevY kbNQ== 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=ONA8hHum9TvnKkueJWXBaBifDcAyhplOrBpKTzt/hV0=; b=YJ9cXODbuURb/hUV/pQRv5Vh9E9KIsSG5SNcHDCxs+o2UaN5tDyM215nXY9o5xWWd0 njs++Xi5k41ZBKzcY9q2k+jAE0BRIMthQIIv3+I/OXP1qcCfqO3eLH+bcdYkSqb92KEj DzaVHFvVWySwV+iMcNhJhrBhxIednrHUsiOqfXT1kxh7KsU5fyLxf6VhNCUxRs9KERdR +QtzF+peqt0xR++hls+DjXi9MvrbL9eozRsdRF6S4WNlXFcFH+Jzokr8PWlEfRUDqQrY YwJW5p9iqNkU5NmGkfh1/cBcW1+a+te4oNZRkHRin15BSoBpvKiLbiohSzKv9VncnZqP PAQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ga3v3AHr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id h11-20020a65480b000000b00564b99f128dsi9999045pgs.656.2023.09.19.11.15.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 11:15:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ga3v3AHr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id B602F8055645; Tue, 19 Sep 2023 05:57:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232305AbjISM53 (ORCPT <rfc822;toshivichauhan@gmail.com> + 26 others); Tue, 19 Sep 2023 08:57:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232277AbjISM5V (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 19 Sep 2023 08:57:21 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDB63119; Tue, 19 Sep 2023 05:57:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695128235; x=1726664235; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zQpj7OaTDonluY2E3OGQf5kVh3FqltWnatkxOc0duHk=; b=Ga3v3AHrnWTbQgTYua4B+ALHhCO9p6CandAqD/iOUTsSBv/2DwM7iiKK h8pElWQYTDZgjU2d9dZ36HVxdYOxD2EU7QtYbYuI2oOyMZ9AC6FskiKGs p9YvTY0nhKBuVXKFCXZXIidmjbVrFLZCg8kNqRz8wjCj0MuK00PyJEucw v1T8cjEio0BSVJ0YxNo+92IsDyLI1I1S66S4hgT1EqaheWMSg1vUa3/vh 0WcKVPA4tRwmHFtdU//cyByIRp/bTdXpjYnF0QlMk+q/+Iqb9NaqysBhP uur3oI3Br5+qssSMsK+782B0EouVQ6uCGr5kCjsY9ifrsSR6POXTJO+J4 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="359324655" X-IronPort-AV: E=Sophos;i="6.02,159,1688454000"; d="scan'208";a="359324655" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2023 05:57:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="746228767" X-IronPort-AV: E=Sophos;i="6.02,159,1688454000"; d="scan'208";a="746228767" Received: from vdesserx-mobl1.ger.corp.intel.com (HELO localhost.localdomain) ([10.249.32.31]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2023 05:57:10 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> To: Bjorn Helgaas <bhelgaas@google.com>, linux-pci@vger.kernel.org, Jonathan Cameron <Jonathan.Cameron@huawei.com>, Jesse Brandeburg <jesse.brandeburg@intel.com>, Tony Nguyen <anthony.l.nguyen@intel.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> Subject: [PATCH v3 3/8] igb: Use FIELD_GET() to extract Link Width Date: Tue, 19 Sep 2023 15:56:43 +0300 Message-Id: <20230919125648.1920-4-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230919125648.1920-1-ilpo.jarvinen@linux.intel.com> References: <20230919125648.1920-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=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Tue, 19 Sep 2023 05:57:32 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777490813853519132 X-GMAIL-MSGID: 1777490813853519132 |
Series |
PCI/treewide: PCIe capability access cleanups
|
|
Commit Message
Ilpo Järvinen
Sept. 19, 2023, 12:56 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(-)
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);