qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Trival <wdongxu@linux.vnet.ibm.com>
To: qemu-trivial@nongnu.org
Cc: stefanha@gmail.com, qemu-devel@nongnu.org,
	Trival <trivial@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 1/2] clean unnecessary code
Date: Wed,  8 May 2013 17:46:19 +0800	[thread overview]
Message-ID: <1368006380-3125-1-git-send-email-trivial@linux.vnet.ibm.com> (raw)

Duplicates a string. If str is NULL it returns NULL, so
can make code simple.

Signed-off-by: Trival <trivial@linux.vnet.ibm.com>
---
 util/uri.c | 2 +-
 vl.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/util/uri.c b/util/uri.c
index 4238729..e348c17 100644
--- a/util/uri.c
+++ b/util/uri.c
@@ -2162,7 +2162,7 @@ query_params_append (struct QueryParams *ps,
     }
 
     ps->p[ps->n].name = g_strdup(name);
-    ps->p[ps->n].value = value ? g_strdup(value) : NULL;
+    ps->p[ps->n].value = g_strdup(value);
     ps->p[ps->n].ignore = 0;
     ps->n++;
 
diff --git a/vl.c b/vl.c
index 6e6225f..be0a93c 100644
--- a/vl.c
+++ b/vl.c
@@ -1215,7 +1215,7 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
 
     node = g_malloc0(sizeof(FWBootEntry));
     node->bootindex = bootindex;
-    node->suffix = suffix ? g_strdup(suffix) : NULL;
+    node->suffix = g_strdup(suffix);
     node->dev = dev;
 
     QTAILQ_FOREACH(i, &fw_boot_order, link) {
-- 
1.7.11.7

             reply	other threads:[~2013-05-08  9:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-08  9:46 Trival [this message]
2013-05-08  9:46 ` [Qemu-devel] [PATCH 2/2] remove needless semicolon Trival
2013-05-08 12:50   ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2013-05-08 13:25     ` Anthony Liguori
2013-05-09  6:23       ` Michael Tokarev
2013-05-09  7:08         ` Hu Tao
2013-05-09  7:13           ` Peter Maydell
2013-05-09  7:53           ` Dong Xu Wang
2013-05-10  8:08         ` Andreas Färber
2013-05-10 13:05           ` Anthony Liguori
2013-05-08 12:49 ` [Qemu-devel] [Qemu-trivial] [PATCH 1/2] clean unnecessary code 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=1368006380-3125-1-git-send-email-trivial@linux.vnet.ibm.com \
    --to=wdongxu@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=trivial@linux.vnet.ibm.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).