Message ID | 20230913122748.29530-1-ilpo.jarvinen@linux.intel.com |
---|---|
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 h50csp36216vqi; Wed, 13 Sep 2023 18:05:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEgB4Q0k3MvfwCnQJjSWbMfbbFIpGgZNw6e7HszJbw6ygNjt12gsN6+VrZojyzDmg4xm7W8 X-Received: by 2002:a17:903:234f:b0:1bd:d510:78fb with SMTP id c15-20020a170903234f00b001bdd51078fbmr561312plh.3.1694653556384; Wed, 13 Sep 2023 18:05:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694653556; cv=none; d=google.com; s=arc-20160816; b=RsgqvTAIwa+vlI95EHIT1Ax6Jvy9emhzt0CbTuXBSeS5zeJB9DiTCXktMOjsdMBqH2 xQVHko8XguebxvvMnKB2bBP4+xAg+qzNPvRhxvTM94zSvS8LZWKSIvEAXWwAzsre41bz bmEzdeSmSXh4WdsJtYPuFGgkLE5giuphLxoSFAysR7WBr/GRS5qv9Yk6FbaPqtWwyr1l mIGGoSyvyHRAPgLqiHcs0KH2qH5ZsDKCwkgNRXUtEgFhDKrV5S5j6zLr3Hx6J1ssx8Vc 2i5yOGeYh1cj2od3siFIgWwM9CRyDGRN8q4VAkgHAXjwgVBfdmEDnjanM2Y2u87mz9rF LMqw== 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=xBOi/t/b/QCO9Pk60+aXKdmi+gYs0CsXCfisXRTjNqY=; fh=utxN3k8f+Kd5sJY55X1nDZlSLQP5YJ/1ix05deC1TtE=; b=CoBORbrOwUpjgvJBBriaiVqvPntTQsvmUGtovEaDa/LZ+gzQcFfbOq6VjaL3MQqzcX GLyH8+u9foMgpI3kfcXEVjjR5iGjsL6URe1h+i1UmvfuUY765zY0W7Kmj+ORtk2oj9z7 VGmTaTEUtV1F+eb1T0K6iUFxlWNyprfnLjJX9Kpo5LqcqbJ1AzAhWKCOz7KofyO+JGks cuaXVTUghWLSMxUddHGXz4iiJK4bJ/levvOt4SW2Dwetv7tvDvUOpro1JgTkyqI/R1OI 7ETyNgATOzTQvXxVYeNDczGymgbm+juk1McCJEx+olTS7tymns/ys/wnd5/3zQ8ROARw PNLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=npRJ5Lah; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id f20-20020a170903105400b001bdf69e297bsi442796plc.588.2023.09.13.18.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 18:05:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=npRJ5Lah; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 38D678239BB4; Wed, 13 Sep 2023 05:30:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240492AbjIMMaQ (ORCPT <rfc822;pwkd43@gmail.com> + 36 others); Wed, 13 Sep 2023 08:30:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240453AbjIMMaP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 13 Sep 2023 08:30:15 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77CA919AD; Wed, 13 Sep 2023 05:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694608211; x=1726144211; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=22UJiVbzD5mU4/r1HpQLPiSWS/GQq8TIka+mKP6MSTY=; b=npRJ5LahwAQpKFnCzaih6KZHgSAx0YwmQ3Ep9etasmnlw1RCCEqjfNiZ gJsnpM1VA98WaMPoUmv4pXXohBHunqm5Fqz4HlrbT+WlYeUKT2Lc34FO3 pWYB81CXnwkrB3uMSQSe69wf+zZnUHON0+S0vgdP5JeMr/WvWshGHwdUe E2qoQjvm5e2S5r53X2LCODvGxuf1SHYSAIpIAFr0ggiNq5JmN+JNkP/3q vpgxVe/59B0dUQmOIr9K3Ar91gYVPltnwZZiwMZ/Gl6ViEZBKFDUaI8dq yhw82jBb3o0KVH96BVD76iHVwZhs5DA3JRCNskXZvPAdTE9DjtRZV+5TD g==; X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="368912279" X-IronPort-AV: E=Sophos;i="6.02,143,1688454000"; d="scan'208";a="368912279" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2023 05:28:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="693836592" X-IronPort-AV: E=Sophos;i="6.02,143,1688454000"; d="scan'208";a="693836592" Received: from pakurapo-mobl3.ger.corp.intel.com (HELO ijarvine-mobl2.ger.corp.intel.com) ([10.249.45.213]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2023 05:27:58 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> To: Jonathan Cameron <Jonathan.Cameron@Huawei.com>, linux-pci@vger.kernel.org, Bjorn Helgaas <helgaas@kernel.org> Cc: linux-kernel@vger.kernel.org, =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> Subject: [PATCH v2 00/10] PCI/treewide: PCIe capability access cleanups Date: Wed, 13 Sep 2023 15:27:38 +0300 Message-Id: <20230913122748.29530-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 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]); Wed, 13 Sep 2023 05:30:24 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776973047465057077 X-GMAIL-MSGID: 1776973047465057077 |
Series |
PCI/treewide: PCIe capability access cleanups
|
|
Message
Ilpo Järvinen
Sept. 13, 2023, 12:27 p.m. UTC
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. I've only put Jonathan's Reviewed-by to patches I didn't modify significantly. 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. 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 (10): IB/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 scsi: esas2r: Use FIELD_GET() to extract PCIe capability fields scsi: qla2xxx: Use FIELD_GET() to extract PCIe capability fields 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 | 17 ++++++++--------- 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 +++--- drivers/scsi/esas2r/esas2r_ioctl.c | 16 ++++++---------- drivers/scsi/qla2xxx/qla_os.c | 5 +++-- 11 files changed, 38 insertions(+), 51 deletions(-)
Comments
On Wed, 13 Sep 2023 15:27:38 +0300, Ilpo Järvinen wrote: > 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. > > I've only put Jonathan's Reviewed-by to patches I didn't modify > significantly. > > [...] Applied to 6.7/scsi-queue, thanks! [07/10] scsi: esas2r: Use FIELD_GET() to extract PCIe capability fields https://git.kernel.org/mkp/scsi/c/5532f2495150 [08/10] scsi: qla2xxx: Use FIELD_GET() to extract PCIe capability fields https://git.kernel.org/mkp/scsi/c/dc1d7b363301