mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Donnellan <ajd@linux.ibm.com>
To: Jinjie Ruan <ruanjinjie@huawei.com>,
	fbarrat@linux.ibm.com, arnd@arndb.de, gregkh@linuxfoundation.org,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] cxl: Remove unused cxl_pci_to_cfg_record()
Date: Thu, 29 Aug 2024 19:07:06 +1000	[thread overview]
Message-ID: <c2b6eb9e9a1477d73ed7b5835e61d0f4eb53afd8.camel@linux.ibm.com> (raw)
In-Reply-To: <20240828103807.3683308-1-ruanjinjie@huawei.com>

On Wed, 2024-08-28 at 18:38 +0800, Jinjie Ruan wrote:
> cxl_pci_to_cfg_record() is not used anywhere, and its function can be
> replacd with PCI_DEVID(), so remove it.
> 
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>

This description is inaccurate - this removes both
cxl_pci_to_cfg_record() (which is unused), and replaces
cxl_pcie_cfg_record() with PCI_DEVID().

The patch itself looks fine.

Note that I am planning to remove this driver soon anyway.

> ---
>  drivers/misc/cxl/vphb.c | 12 +-----------
>  include/misc/cxl.h      |  4 ----
>  2 files changed, 1 insertion(+), 15 deletions(-)
> 
> diff --git a/drivers/misc/cxl/vphb.c b/drivers/misc/cxl/vphb.c
> index 6332db8044bd..1cf614bf104d 100644
> --- a/drivers/misc/cxl/vphb.c
> +++ b/drivers/misc/cxl/vphb.c
> @@ -72,11 +72,6 @@ static void cxl_pci_reset_secondary_bus(struct
> pci_dev *dev)
>  	/* Should we do an AFU reset here ? */
>  }
>  
> -static int cxl_pcie_cfg_record(u8 bus, u8 devfn)
> -{
> -	return (bus << 8) + devfn;
> -}
> -
>  static inline struct cxl_afu *pci_bus_to_afu(struct pci_bus *bus)
>  {
>  	struct pci_controller *phb = bus ? pci_bus_to_host(bus) :
> NULL;
> @@ -99,7 +94,7 @@ static inline int cxl_pcie_config_info(struct
> pci_bus *bus, unsigned int devfn,
>  {
>  	int record;
>  
> -	record = cxl_pcie_cfg_record(bus->number, devfn);
> +	record = PCI_DEVID(bus->number, devfn);
>  	if (record > afu->crs_num)
>  		return PCIBIOS_DEVICE_NOT_FOUND;
>  
> @@ -302,8 +297,3 @@ struct cxl_afu *cxl_pci_to_afu(struct pci_dev
> *dev)
>  }
>  EXPORT_SYMBOL_GPL(cxl_pci_to_afu);
>  
> -unsigned int cxl_pci_to_cfg_record(struct pci_dev *dev)
> -{
> -	return cxl_pcie_cfg_record(dev->bus->number, dev->devfn);
> -}
> -EXPORT_SYMBOL_GPL(cxl_pci_to_cfg_record);
> diff --git a/include/misc/cxl.h b/include/misc/cxl.h
> index d8044299d654..5ffa6e02bb07 100644
> --- a/include/misc/cxl.h
> +++ b/include/misc/cxl.h
> @@ -23,10 +23,6 @@
>  /* Get the AFU associated with a pci_dev */
>  struct cxl_afu *cxl_pci_to_afu(struct pci_dev *dev);
>  
> -/* Get the AFU conf record number associated with a pci_dev */
> -unsigned int cxl_pci_to_cfg_record(struct pci_dev *dev);
> -
> -
>  /*
>   * Context lifetime overview:
>   *

-- 
Andrew Donnellan    OzLabs, ADL Canberra
ajd@linux.ibm.com   IBM Australia Limited

      reply	other threads:[~2024-08-29  9:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28 10:38 Jinjie Ruan
2024-08-29  9:07 ` Andrew Donnellan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c2b6eb9e9a1477d73ed7b5835e61d0f4eb53afd8.camel@linux.ibm.com \
    --to=ajd@linux.ibm.com \
    --cc=arnd@arndb.de \
    --cc=fbarrat@linux.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=ruanjinjie@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®