From: Laurent Vivier <laurent@vivier.eu>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
qemu-trivial@nongnu.org, qemu-devel@nongnu.org
Cc: Laszlo Ersek <lersek@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Michael Tokarev <mjt@tls.msk.ru>,
Gerd Hoffmann <kraxel@redhat.com>,
qemu-arm@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 2/2] hw/nvram/fw_cfg: Use the ldst API
Date: Sun, 10 Mar 2019 11:56:55 +0100 [thread overview]
Message-ID: <f5c474da-1a8c-6b8d-0027-cff9c7bf974f@vivier.eu> (raw)
In-Reply-To: <20190309181920.30553-3-philmd@redhat.com>
On 09/03/2019 19:19, Philippe Mathieu-Daudé wrote:
> The load/store API eases code review.
>
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> hw/nvram/fw_cfg.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index 7fdf04adc9..3d8859e333 100644
> --- a/hw/nvram/fw_cfg.c
> +++ b/hw/nvram/fw_cfg.c
> @@ -85,7 +85,7 @@ static char *read_splashfile(char *filename, gsize *file_sizep,
> }
>
> /* check magic ID */
> - filehead = ((content[0] & 0xff) + (content[1] << 8)) & 0xffff;
> + filehead = lduw_le_p(content);
> if (filehead == 0xd8ff) {
> file_type = JPG_FILE;
> } else if (filehead == 0x4d42) {
> @@ -96,7 +96,7 @@ static char *read_splashfile(char *filename, gsize *file_sizep,
>
> /* check BMP bpp */
> if (file_type == BMP_FILE) {
> - bmp_bpp = (content[28] + (content[29] << 8)) & 0xffff;
> + bmp_bpp = lduw_le_p(&content[28]);
> if (bmp_bpp != 24) {
> goto error;
> }
>
Applied to my trivial-patches branch.
Thanks,
Laurent
prev parent reply other threads:[~2019-03-10 10:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-09 18:19 [Qemu-devel] [PATCH v3 0/2] fw_cfg: Trivial cleanups Philippe Mathieu-Daudé
2019-03-09 18:19 ` [Qemu-devel] [PATCH v3 1/2] hw/arm/virt: Remove null-check in virt_build_smbios() Philippe Mathieu-Daudé
2019-03-10 10:55 ` Laurent Vivier
2019-03-09 18:19 ` [Qemu-devel] [PATCH v3 2/2] hw/nvram/fw_cfg: Use the ldst API Philippe Mathieu-Daudé
2019-03-10 10:56 ` Laurent Vivier [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=f5c474da-1a8c-6b8d-0027-cff9c7bf974f@vivier.eu \
--to=laurent@vivier.eu \
--cc=kraxel@redhat.com \
--cc=lersek@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-arm@nongnu.org \
--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).