lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 22 Nov 2023 15:14:41 +0200 (EET)
From:   Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To:     Shuai Xue <xueshuai@...ux.alibaba.com>
cc:     ilkka@...amperecomputing.com, kaishen@...ux.alibaba.com,
        helgaas@...nel.org, yangyicong@...wei.com, will@...nel.org,
        Jonathan.Cameron@...wei.com, baolin.wang@...ux.alibaba.com,
        robin.murphy@....com, chengyou@...ux.alibaba.com,
        LKML <linux-kernel@...r.kernel.org>,
        linux-arm-kernel@...ts.infradead.org, linux-pci@...r.kernel.org,
        rdunlap@...radead.org, mark.rutland@....com,
        zhuo.song@...ux.alibaba.com, renyu.zj@...ux.alibaba.com
Subject: Re: [PATCH v11 3/5] PCI: Move pci_clear_and_set_dword() helper to
 PCI header

On Tue, 21 Nov 2023, Shuai Xue wrote:

> The clear and set pattern is commonly used for accessing PCI config,
> move the helper pci_clear_and_set_dword() from aspm.c into PCI header.
> In addition, rename to pci_clear_and_set_config_dword() to retain the
> "config" information and match the other accessors.
> 
> No functional change intended.
> 
> Signed-off-by: Shuai Xue <xueshuai@...ux.alibaba.com>
> Acked-by: Bjorn Helgaas <bhelgaas@...gle.com>
> Tested-by: Ilkka Koskinen <ilkka@...amperecomputing.com>
> ---
>  drivers/pci/access.c    | 12 ++++++++
>  drivers/pci/pcie/aspm.c | 65 +++++++++++++++++++----------------------
>  include/linux/pci.h     |  2 ++
>  3 files changed, 44 insertions(+), 35 deletions(-)
> 
> diff --git a/drivers/pci/access.c b/drivers/pci/access.c
> index 6554a2e89d36..6449056b57dd 100644
> --- a/drivers/pci/access.c
> +++ b/drivers/pci/access.c
> @@ -598,3 +598,15 @@ int pci_write_config_dword(const struct pci_dev *dev, int where,
>  	return pci_bus_write_config_dword(dev->bus, dev->devfn, where, val);
>  }
>  EXPORT_SYMBOL(pci_write_config_dword);
> +
> +void pci_clear_and_set_config_dword(const struct pci_dev *dev, int pos,
> +				    u32 clear, u32 set)

Just noting that annoyingly the ordering within the name is inconsistent 
between:
  pci_clear_and_set_config_dword()
and
  pcie_capability_clear_and_set_dword()

And if changed, it would be again annoyingly inconsistent with 
pci_read/write_config_*(), oh well... And renaming pci_read/write_config_* 
into the hierarchical pci_config_read/write_*() form for would touch only 
~6k lines... ;-D

> +		pci_clear_and_set_config_dword(child,
> +					       child->l1ss + PCI_L1SS_CTL1, 0,
> +					       cl1_2_enables);

Adding clear and set only variants into the header like there are for 
pcie_capability_*() would remove the need to add those 0 parameters.
IMO, it improves code readability considerably.


-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ