search for: is_virtio_dma_buf

Displaying 5 results from an estimated 5 matches for "is_virtio_dma_buf".

2020 Jun 04
2
[PATCH v4 1/3] virtio: add dma-buf support for exported objects
...+ dma_buf->ops, const struct virtio_dma_buf_ops, ops); > + > + if (ops->device_attach) { > + ret = ops->device_attach(dma_buf, attach); > + if (ret) > + return ret; > + } > + return 0; > +} > +EXPORT_SYMBOL(virtio_dma_buf_attach); > + > +/** > + * is_virtio_dma_buf - returns true if the given dma-buf is a virtio dma-buf > + * @dma_buf: buffer to query > + */ > +bool is_virtio_dma_buf(struct dma_buf *dma_buf) > +{ > + return dma_buf->ops->attach == &virtio_dma_buf_attach; > +} > +EXPORT_SYMBOL(is_virtio_dma_buf); > + > +/**...
2020 Jun 04
2
[PATCH v4 1/3] virtio: add dma-buf support for exported objects
...+ dma_buf->ops, const struct virtio_dma_buf_ops, ops); > + > + if (ops->device_attach) { > + ret = ops->device_attach(dma_buf, attach); > + if (ret) > + return ret; > + } > + return 0; > +} > +EXPORT_SYMBOL(virtio_dma_buf_attach); > + > +/** > + * is_virtio_dma_buf - returns true if the given dma-buf is a virtio dma-buf > + * @dma_buf: buffer to query > + */ > +bool is_virtio_dma_buf(struct dma_buf *dma_buf) > +{ > + return dma_buf->ops->attach == &virtio_dma_buf_attach; > +} > +EXPORT_SYMBOL(is_virtio_dma_buf); > + > +/**...
2020 Sep 10
0
[PATCH v7 1/3] virtio: add dma-buf support for exported objects
...gt;ops, > + const struct virtio_dma_buf_ops, ops); > + > + if (ops->device_attach) { > + ret = ops->device_attach(dma_buf, attach); > + if (ret) > + return ret; > + } > + return 0; > +} > +EXPORT_SYMBOL(virtio_dma_buf_attach); > + > +/** > + * is_virtio_dma_buf - returns true if the given dma-buf is a virtio dma-buf > + * @dma_buf: buffer to query > + */ > +bool is_virtio_dma_buf(struct dma_buf *dma_buf) > +{ > + return dma_buf->ops->attach == &virtio_dma_buf_attach; > +} > +EXPORT_SYMBOL(is_virtio_dma_buf); > + > +/**...
2020 Jun 19
0
[PATCH v4 1/3] virtio: add dma-buf support for exported objects
...gt; > > + if (ret) > > > > + return ret; > > > > + } > > > > + return 0; > > > > +} > > > > +EXPORT_SYMBOL(virtio_dma_buf_attach); > > > > + > > > > +/** > > > > + * is_virtio_dma_buf - returns true if the given dma-buf is a virtio dma-buf > > > > + * @dma_buf: buffer to query > > > > + */ > > > > +bool is_virtio_dma_buf(struct dma_buf *dma_buf) > > > > +{ > > > > + return dma_buf->ops->attach == &virtio_dma...
2020 Jun 08
0
[PATCH v4 1/3] virtio: add dma-buf support for exported objects
...nd they are called like this: + */ +int virtio_dma_buf_get_uuid(struct dma_buf *dma_buf, + uuid_t *uuid) +{ + const struct virtio_dma_buf_ops *ops = container_of( + dma_buf->ops, const struct virtio_dma_buf_ops, ops); + + if (!is_virtio_dma_buf(dma_buf)) + return -EINVAL; + + return ops->get_uuid(dma_buf, uuid); +} So you are doing the container_of trick anyway, the extra structure did not give us any type safety. -- MST