From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Maxime Coquelin <maxime.coquelin@redhat.com>,
Chenbo Xia <chenbox@nvidia.com>
Subject: [PATCH 4/4] vhost: remove unnecessary deref of function pointers
Date: Tue, 11 Mar 2025 08:51:32 -0700 [thread overview]
Message-ID: <20250311155300.13410-5-stephen@networkplumber.org> (raw)
In-Reply-To: <20250311155300.13410-1-stephen@networkplumber.org>
Since it is a function pointer,
the expression *dev->extern_ops.pre_msg_handle and
dev->extern_ops.pre_msg_handle are the same.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/vhost/vhost_user.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index 26dc0bde97..45f2b71e36 100644
--- a/lib/vhost/vhost_user.c
+++ b/lib/vhost/vhost_user.c
@@ -3186,7 +3186,7 @@ vhost_user_msg_handler(int vid, int fd)
handled = false;
if (dev->extern_ops.pre_msg_handle) {
RTE_BUILD_BUG_ON(offsetof(struct vhu_msg_context, msg) != 0);
- msg_result = (*dev->extern_ops.pre_msg_handle)(dev->vid, &ctx);
+ msg_result = dev->extern_ops.pre_msg_handle(dev->vid, &ctx);
switch (msg_result) {
case RTE_VHOST_MSG_RESULT_REPLY:
send_vhost_reply(dev, fd, &ctx);
@@ -3238,7 +3238,7 @@ vhost_user_msg_handler(int vid, int fd)
if (msg_result != RTE_VHOST_MSG_RESULT_ERR &&
dev->extern_ops.post_msg_handle) {
RTE_BUILD_BUG_ON(offsetof(struct vhu_msg_context, msg) != 0);
- msg_result = (*dev->extern_ops.post_msg_handle)(dev->vid, &ctx);
+ msg_result = dev->extern_ops.post_msg_handle(dev->vid, &ctx);
switch (msg_result) {
case RTE_VHOST_MSG_RESULT_REPLY:
send_vhost_reply(dev, fd, &ctx);
--
2.47.2
next prev parent reply other threads:[~2025-03-11 15:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 15:51 [PATCH 0/4] more unnecessary function pointer Stephen Hemminger
2025-03-11 15:51 ` [PATCH 1/4] raw/ifpga: remove unnecessary deref of function pointers Stephen Hemminger
2025-03-11 16:03 ` Bruce Richardson
2025-03-11 15:51 ` [PATCH 2/4] crypto/ionic: remove unnecessary deref of function pointer Stephen Hemminger
2025-03-11 15:51 ` [PATCH 3/4] regexdev: another unnecessary deref of function pointers Stephen Hemminger
2025-03-11 15:51 ` Stephen Hemminger [this message]
2025-03-11 16:04 ` [PATCH 0/4] more unnecessary function pointer Bruce Richardson
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=20250311155300.13410-5-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=chenbox@nvidia.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).