From: Stefan Weil <sw@weilnetz.de>
To: qemu-trivial@nongnu.org
Cc: Stefan Weil <sw@weilnetz.de>, Laszlo Ersek <lersek@redhat.com>,
qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 1/2] bswap: Modify prototype of stb_p (avoid type conversions)
Date: Wed, 19 Feb 2014 06:11:44 +0100 [thread overview]
Message-ID: <1392786705-9730-2-git-send-email-sw@weilnetz.de> (raw)
In-Reply-To: <1392786705-9730-1-git-send-email-sw@weilnetz.de>
The function uses an uint8_t value, so show this in the function
prototype. Non-optimizing compilers will avoid unnecessary type
conversions from (u)int8_t to int and back to uint8_t when generating
calls of this inline function.
stw_p, stl_p and stq_p already use similar prototypes.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
include/qemu/bswap.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index 437b8e0..0cc11a5 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -228,7 +228,7 @@ static inline int ldsb_p(const void *ptr)
return *(int8_t *)ptr;
}
-static inline void stb_p(void *ptr, int v)
+static inline void stb_p(void *ptr, uint8_t v)
{
*(uint8_t *)ptr = v;
}
--
1.7.10.4
next prev parent reply other threads:[~2014-02-19 5:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-19 5:11 [Qemu-devel] [PATCH 0/2] bswap: Clean prototypes of st* functions Stefan Weil
2014-02-19 5:11 ` Stefan Weil [this message]
2014-02-19 5:11 ` [Qemu-devel] [PATCH 2/2] bswap: Modify prototypes of st[wl]_{le, be}_p (avoid type conversions) Stefan Weil
2014-02-19 5:19 ` Stefan Weil
2014-02-19 10:16 ` [Qemu-devel] [PATCH 0/2] bswap: Clean prototypes of st* functions Laszlo Ersek
2014-02-22 12:06 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
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=1392786705-9730-2-git-send-email-sw@weilnetz.de \
--to=sw@weilnetz.de \
--cc=lersek@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.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;
as well as URLs for NNTP newsgroup(s).