From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] coccinelle: new inplace-byteswaps.cocci to remove inplace-byteswapping calls
Date: Wed, 10 Oct 2018 07:26:16 -0700 [thread overview]
Message-ID: <03960e60-6441-ddec-c849-ed17442f1fea@linaro.org> (raw)
In-Reply-To: <20181009181612.10633-1-peter.maydell@linaro.org>
On 10/9/18 11:16 AM, Peter Maydell wrote:
> Add a new Coccinelle script which replaces uses of the inplace
> byteswapping functions *_to_cpus() and cpu_to_*s() with their
> not-in-place equivalents. This is useful for where the swapping
> is done on members of a packed struct -- taking the address
> of the member to pass it to an inplace function is undefined
> behaviour in C.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Richard asked for a coccinelle script in the scripts/coccinelle
> directory, so here's a patch to add it.
>
> scripts/coccinelle/inplace-byteswaps.cocci | 65 ++++++++++++++++++++++
> 1 file changed, 65 insertions(+)
> create mode 100644 scripts/coccinelle/inplace-byteswaps.cocci
Thanks,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
prev parent reply other threads:[~2018-10-10 14:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-09 18:16 [Qemu-devel] [PATCH] coccinelle: new inplace-byteswaps.cocci to remove inplace-byteswapping calls Peter Maydell
2018-10-09 18:23 ` Eric Blake
2018-10-09 18:35 ` Peter Maydell
2018-10-10 9:01 ` Philippe Mathieu-Daudé
2018-10-10 14:26 ` Richard Henderson [this message]
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=03960e60-6441-ddec-c849-ed17442f1fea@linaro.org \
--to=richard.henderson@linaro.org \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@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).