Re: [PATCH v5 3/6] PCI: endpoint: Introduce pci_epc_mem_map()/unmap()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux