[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and hel
From: |
Peter Xu |
Subject: |
Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers |
Date: |
Mon, 13 Jan 2020 15:23:01 -0500 |
On Thu, Jan 09, 2020 at 03:43:11PM +0100, Eric Auger wrote:
[...]
> +VirtIOIOMMUEndpoint *virtio_iommu_get_endpoint(VirtIOIOMMU *s, uint32_t
> ep_id);
> +VirtIOIOMMUEndpoint *virtio_iommu_get_endpoint(VirtIOIOMMU *s, uint32_t
> ep_id)
Is the extra definition trying to workaround the compiler
warning/error?
I'm not sure whether it's only me who prefer this, but again I'd
really perfer we move the function into the caller patch, add "static"
as needed altogether, even if that patch can be big.
> +{
> + VirtIOIOMMUEndpoint *ep;
> +
> + ep = g_tree_lookup(s->endpoints, GUINT_TO_POINTER(ep_id));
> + if (ep) {
> + return ep;
> + }
> + if (!virtio_iommu_mr(s, ep_id)) {
Could I ask when this will trigger?
> + return NULL;
> + }
> + ep = g_malloc0(sizeof(*ep));
> + ep->id = ep_id;
> + trace_virtio_iommu_get_endpoint(ep_id);
> + g_tree_insert(s->endpoints, GUINT_TO_POINTER(ep_id), ep);
> + return ep;
> +}
Thanks,
--
Peter Xu
- [PATCH v12 02/13] virtio-iommu: Add skeleton, (continued)
- [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers, Eric Auger, 2020/01/09
- Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers,
Peter Xu <=
- Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers, Auger Eric, 2020/01/14
- Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers, Peter Xu, 2020/01/14
- Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers, Auger Eric, 2020/01/15
- Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers, Peter Xu, 2020/01/15
- Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers, Auger Eric, 2020/01/15
- Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers, Auger Eric, 2020/01/15
[PATCH v12 06/13] virtio-iommu: Implement attach/detach command, Eric Auger, 2020/01/09
[PATCH v12 07/13] virtio-iommu: Implement map/unmap, Eric Auger, 2020/01/09
[PATCH v12 08/13] virtio-iommu: Implement translate, Eric Auger, 2020/01/09