public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: "Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	linux-pci@vger.kernel.org,
	"Rick Wertenbroek" <rick.wertenbroek@gmail.com>
Subject: Re: [PATCH v5 3/6] PCI: endpoint: Introduce pci_epc_mem_map()/unmap()
Date: Fri, 11 Oct 2024 14:22:54 +0200	[thread overview]
Message-ID: <ZwkYnr4VdxSNuUq1@ryzen.lan> (raw)
In-Reply-To: <ZwkU68LjTkahz_RZ@ryzen.lan>

On Fri, Oct 11, 2024 at 02:07:07PM +0200, Niklas Cassel wrote:
> On Fri, Oct 11, 2024 at 09:01:12PM +0900, Damien Le Moal wrote:

(snip)

> > +int pci_epc_mem_map(struct pci_epc *epc, u8 func_no, u8 vfunc_no,
> > +		    u64 pci_addr, size_t pci_size, struct pci_epc_map *map)
> > +{
> > +	int ret;
> > +
> > +	if (!pci_epc_function_is_valid(epc, func_no, vfunc_no))
> > +		return -EINVAL;
> > +
> > +	if (!pci_size || !map)
> > +		return -EINVAL;
> > +
> > +	ret = pci_epc_get_mem_map(epc, func_no, vfunc_no,
> > +				  pci_addr, pci_size, map);
> > +	if (ret)
> > +		return ret;
> > +
> > +	map->virt_base = pci_epc_mem_alloc_addr(epc, &map->phys_base,
> > +						map->map_size);
> > +	if (!map->virt_base)
> > +		return -ENOMEM;
> > +
> > +	map->phys_addr = map->phys_base + map->map_ofst;
> > +	map->virt_addr = map->virt_base + map->map_ofst;
> > +
> > +	ret = pci_epc_map_addr(epc, func_no, vfunc_no, map->phys_base,
> > +			       map->map_pci_addr, map->map_size);
> > +	if (ret) {
> > +		pci_epc_mem_free_addr(epc, map->phys_base, map->virt_base,
> > +				      map->map_size);
> > +		map->virt_base = 0;
> 
> As reported by the kernel test robot on both v3 and v4, this should be:
> map->virt_base = NULL;
> otherwise you introduce a new sparse warning.

With that nit fixed:
Reviewed-by: Niklas Cassel <cassel@kernel.org>

  parent reply	other threads:[~2024-10-11 12:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-11 12:01 [PATCH v5 0/6] Improve PCI memory mapping API Damien Le Moal
2024-10-11 12:01 ` [PATCH v5 1/6] PCI: endpoint: Introduce pci_epc_function_is_valid() Damien Le Moal
2024-10-11 12:01 ` [PATCH v5 2/6] PCI: endpoint: Improve pci_epc_mem_alloc_addr() Damien Le Moal
2024-10-11 12:01 ` [PATCH v5 3/6] PCI: endpoint: Introduce pci_epc_mem_map()/unmap() Damien Le Moal
2024-10-11 12:07   ` Niklas Cassel
2024-10-11 12:21     ` Damien Le Moal
2024-10-12  9:42       ` Manivannan Sadhasivam
2024-10-11 12:22     ` Niklas Cassel [this message]
2024-10-11 12:01 ` [PATCH v5 4/6] PCI: endpoint: Update documentation Damien Le Moal
2024-10-11 12:20   ` Niklas Cassel
2024-10-11 12:01 ` [PATCH v5 5/6] PCI: endpoint: test: Use pci_epc_mem_map/unmap() Damien Le Moal
2024-10-11 12:01 ` [PATCH v5 6/6] PCI: dwc: endpoint: Implement the pci_epc_ops::get_mem_map() operation Damien Le Moal
2024-10-11 12:19   ` Niklas Cassel

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=ZwkYnr4VdxSNuUq1@ryzen.lan \
    --to=cassel@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=corbet@lwn.net \
    --cc=dlemoal@kernel.org \
    --cc=jingoohan1@gmail.com \
    --cc=kishon@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=rick.wertenbroek@gmail.com \
    --cc=robh@kernel.org \
    /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