Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp996017rdb; Tue, 19 Sep 2023 17:32:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkYw7pOpDHqMkRmbUIkR8XXW6EdlsApBvVWbPEzhOcEAWekJHYJusfs12SwzrBDAa0/ofV X-Received: by 2002:a05:6808:1412:b0:3ab:83e1:ef6d with SMTP id w18-20020a056808141200b003ab83e1ef6dmr1006995oiv.6.1695169934649; Tue, 19 Sep 2023 17:32:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695169934; cv=none; d=google.com; s=arc-20160816; b=sHkIEh6x8eZybiVXX3ct4/CAoYJtCRRmCoA2IgHfozdEIKUgmTU/SW2j3yXMRlI3iA ZQf+nmjZjP588KIbuRU0VR/D7K1NrTR35dP1X/MDeqfRxtX/4OBMjPOpzHDuiKzCOkKO APOX2q5Tr8T32rV4tS36R397MpfJdQ8rFSzD0niOPCmDPsb4e5RUYEEiak/IDZUTgWji jbkyGDWoXU9lmUTSAdbQC4Rdj1YOkJGqciEQryoE9y0kmaB0QPLKYZKerqV8RiipomFT uREaXB0glJp+3eZY2SwJwqNx59OKzFEKLIStVgJVtk+IKuPt7qoRAs/d+elGX27VBsvL Thcg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=XeOvgNccSpb2+mFRnPVuL/mxyFbHyr4AbGDW5ehsnGQ=; fh=WOqmXV52p94XC4OQX/BWwTRUBCMD5J2ILz3sZDDtyuw=; b=Q4iCLPPo15FUyKLUd0d3UG+zK5ZJbWv4D7xdVDGN+NxDJaASKFs2ph++lm9nIAhcDX sz7BL39y2Z1xZtWQjsJuKPXqsIOuM30cWyEA37BsyoELZwAQw8p77lEqsikJBDmHUHSd kGUcjdil1Wqw/gs0kaR1Rmy3B4dT1v6pIkzrpq5DBZzDtkcfoDiSnPqfcXufJVdxhwZ4 fcYQpbybqhaP3Tx7+zcUCTl7J0DORf32yMDgcFP7hKnXvUucGtvzkveRGK9jzreV5LV9 Kf/MWHEEV3LJz5HeZCbiHX867uaKDCbXsP27KuF1nBJFvK9DJ2+/XQReLERzrVEUXiy9 q6sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KloNKfNd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id p16-20020a056a000b5000b0068a55b8e380si10656226pfo.230.2023.09.19.17.32.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 17:32:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KloNKfNd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 088FA80A99B7; Tue, 19 Sep 2023 05:57:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232265AbjISM5K (ORCPT + 99 others); Tue, 19 Sep 2023 08:57:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231489AbjISM5I (ORCPT ); Tue, 19 Sep 2023 08:57:08 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 982F8F9; Tue, 19 Sep 2023 05:57:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695128220; x=1726664220; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ZyCbh6VtZ67nU62IXv6rMJQvPb0CAx1pQpLxDA4Wy9k=; b=KloNKfNd2+7IY/TlMzBZy5JZKU5HWMvtteGQmdzXkAOBQZP8g2YcWXIR sqs0WB84jg87qhABEwF/RjFsI/2J1EfWF9u0ObygpbaliC6JjzdFUHFAh rfIwWoefgZuqbz3VvdlEqAJoltHtZPiB0wZhCQK3QSqFceVhPL9zkm6ZL y+K76yANSEVgkGCDeoY63VlCpXajTTK/ODSO8pe62MtfNLWB0YQQoqhtv yPZIzAAEUknUkVRcLhi0zLu0zfNVebR3yzwYamiaLMc6c7MrlD23SgEeu csJGRybTCIWoR+7++tHo4aFr5VUNyziv9GUTd1u+dhAin4SVKESrC/m8n Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="359324589" X-IronPort-AV: E=Sophos;i="6.02,159,1688454000"; d="scan'208";a="359324589" 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:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="746228669" X-IronPort-AV: E=Sophos;i="6.02,159,1688454000"; d="scan'208";a="746228669" 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:56:57 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: Bjorn Helgaas , linux-pci@vger.kernel.org, Jonathan Cameron Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH v3 0/8] PCI/treewide: PCIe capability access cleanups Date: Tue, 19 Sep 2023 15:56:40 +0300 Message-Id: <20230919125648.1920-1-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 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 pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 19 Sep 2023 05:57:12 -0700 (PDT) Instead of custom code to extract the PCIe capabilities, make the code more obvious using FIELD_GET/PREP(). Also cleanup some duplicated defines in e1000e. This is just a step into the right direction, there's plenty of places still to cleanup which will have to wait for another patch series. v3: - Remove applied patches (scsi) - Use pci_pcie_cap() and tweak local variable (e1000e) - Use the correct prefix for RDMA/hfi1 v2: - Remove extract_width() and use FIELD_GET() directly (IB/hfi1) - Convert other fields beside Link Width ones - Remove useless u8 casts (scsi: esas2r) - e1000e: - Remove defines that duplicate pci_regs.h ones - Convert to pcie_capability_read_word() Ilpo Järvinen (8): RDMA/hfi1: Use FIELD_GET() to extract Link Width media: cobalt: Use FIELD_GET() to extract Link Width igb: Use FIELD_GET() to extract Link Width PCI: tegra194: Use FIELD_GET()/FIELD_PREP() with Link Width fields PCI: mvebu: Use FIELD_PREP() with Link Width PCI: Use FIELD_GET() to extract Link Width e1000e: Use PCI_EXP_LNKSTA_NLW & FIELD_GET() instead of custom defines/code e1000e: Use pcie_capability_read_word() for reading LNKSTA drivers/infiniband/hw/hfi1/pcie.c | 9 ++------- drivers/media/pci/cobalt/cobalt-driver.c | 11 ++++++----- drivers/net/ethernet/intel/e1000e/defines.h | 3 --- drivers/net/ethernet/intel/e1000e/mac.c | 18 ++++++++---------- drivers/net/ethernet/intel/igb/e1000_mac.c | 6 +++--- drivers/pci/controller/dwc/pcie-tegra194.c | 9 ++++----- drivers/pci/controller/pci-mvebu.c | 2 +- drivers/pci/pci-sysfs.c | 5 ++--- drivers/pci/pci.c | 6 +++--- 9 files changed, 29 insertions(+), 40 deletions(-) -- 2.30.2