From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ua0xP-0005Ni-1g for qemu-devel@nongnu.org; Wed, 08 May 2013 05:46:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ua0xN-0006ab-Rg for qemu-devel@nongnu.org; Wed, 08 May 2013 05:46:42 -0400 Sender: Dong Xu Wang From: Trival Date: Wed, 8 May 2013 17:46:19 +0800 Message-Id: <1368006380-3125-1-git-send-email-trivial@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 1/2] clean unnecessary code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-trivial@nongnu.org Cc: stefanha@gmail.com, qemu-devel@nongnu.org, Trival Duplicates a string. If str is NULL it returns NULL, so can make code simple. Signed-off-by: Trival --- 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