# \[PATCH\] virtio: mark vring\_dma\_dev() static

- Subsystems: VIRTIO CORE, THE REST
- Maintainers: "Michael S. Tsirkin", Jason Wang, Eugenio Pérez, Linus Torvalds
- List: virtualization
- 1 message, 1 author
- Page: https://ratatoskr.run/virtualization/2016/09/15808613/t

## \[PATCH\] virtio: mark vring\_dma\_dev() static

- From: Baoyou Xie \<hidden\>
- Date: 2016-09-01 11:02:57 
- Message: https://ratatoskr.run/virtualization/2016/09/15808613.md

```text
We get 1 warning when building kernel with W=1:
drivers/virtio/virtio_ring.c:170:16: warning: no previous prototype for 'vring_dma_dev' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
so this patch marks this function with 'static'.

Signed-off-by: Baoyou Xie <redacted>
---
 drivers/virtio/virtio_ring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 114a0c8..13b58db 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -167,7 +167,7 @@ static bool vring_use_dma_api(struct virtio_device *vdev)
  * making all of the arch DMA ops work on the vring device itself
  * is a mess.  For now, we use the parent device for DMA ops.
  */
-struct device *vring_dma_dev(const struct vring_virtqueue *vq)
+static struct device *vring_dma_dev(const struct vring_virtqueue *vq)
 {
 	return vq->vq.vdev->dev.parent;
 }
-- 
2.7.4
```
