From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] virtio: allow inlining of trivial virtio_find_vqs function
Date: Mon, 6 Jan 2025 10:19:20 +0100 [thread overview]
Message-ID: <20250106091920.3435488-1-a.fatoum@pengutronix.de> (raw)
virtio_find_vqs is just a function pointer call, so move it into a
header, so it can be inlined.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/virtio/virtio.c | 7 -------
include/linux/virtio_config.h | 6 +++++-
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index c4854e7d11aa..a0bd147c36c4 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -159,13 +159,6 @@ int virtio_finalize_features(struct virtio_device *dev)
}
EXPORT_SYMBOL_GPL(virtio_finalize_features);
-int virtio_find_vqs(struct virtio_device *vdev, unsigned int nvqs,
- struct virtqueue *vqs[])
-{
- return vdev->config->find_vqs(vdev, nvqs, vqs);
-}
-EXPORT_SYMBOL_GPL(virtio_find_vqs);
-
static int virtio_dev_probe(struct device *_d)
{
int err, i;
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index 6bb1f768b636..6c53f4bc66a4 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -246,8 +246,12 @@ static inline int virtio_set_config(struct virtio_device *vdev, unsigned int off
* @vqs: on success, includes new virtqueues
* @return 0 if OK, -ve on error
*/
+static inline
int virtio_find_vqs(struct virtio_device *vdev, unsigned int nvqs,
- struct virtqueue *vqs[]);
+ struct virtqueue *vqs[])
+{
+ return vdev->config->find_vqs(vdev, nvqs, vqs);
+}
/**
* virtio_device_ready - enable vq use in probe function
--
2.39.5
next reply other threads:[~2025-01-06 9:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-06 9:19 Ahmad Fatoum [this message]
2025-01-06 13:25 ` Sascha Hauer
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=20250106091920.3435488-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.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