From: Eric Blake <eblake@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, qemu-trivial@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qcow2: remove useless NULL check
Date: Wed, 8 Feb 2017 07:53:14 -0600 [thread overview]
Message-ID: <3dccbc96-1ba2-5cd5-041c-4ed071fddfcb@redhat.com> (raw)
In-Reply-To: <20170208080900.4092-1-marcandre.lureau@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1085 bytes --]
On 02/08/2017 02:09 AM, Marc-André Lureau wrote:
> g_strdup() already handles the case where the argument is NULL.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> block/qcow2.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
>
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 96fb8a8f16..9114218030 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -2016,8 +2016,8 @@ static int qcow2_change_backing_file(BlockDriverState *bs,
> g_free(s->image_backing_file);
> g_free(s->image_backing_format);
>
> - s->image_backing_file = backing_file ? g_strdup(bs->backing_file) : NULL;
> - s->image_backing_format = backing_fmt ? g_strdup(bs->backing_format) : NULL;
> + s->image_backing_file = g_strdup(bs->backing_file);
> + s->image_backing_format = g_strdup(bs->backing_format);
>
> return qcow2_update_header(bs);
> }
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2017-02-08 13:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-08 8:09 [Qemu-devel] [PATCH] qcow2: remove useless NULL check Marc-André Lureau
2017-02-08 13:53 ` Eric Blake [this message]
2017-02-08 13:54 ` Max Reitz
2017-02-08 14:00 ` Marc-André Lureau
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=3dccbc96-1ba2-5cd5-041c-4ed071fddfcb@redhat.com \
--to=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=marcandre.lureau@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).