From patchwork Wed May 8 09:46:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Wang X-Patchwork-Id: 242534 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AA5D02C0118 for ; Wed, 8 May 2013 19:47:18 +1000 (EST) Received: from localhost ([::1]:57201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ua0xw-0005UI-Uo for incoming@patchwork.ozlabs.org; Wed, 08 May 2013 05:47:16 -0400 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 Received: from mail-pa0-f51.google.com ([209.85.220.51]:35400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ua0xL-0006a6-SZ; Wed, 08 May 2013 05:46:40 -0400 Received: by mail-pa0-f51.google.com with SMTP id ld10so1205971pab.10 for ; Wed, 08 May 2013 02:46:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer; bh=aiJzzy8oV0DnOMBvpkcpMD+MPMCMpMuxnDF3tuaUREs=; b=HNxJ/6WcQY+UoJ8Bx3ffLlz4SSxmnEeNu+yV/pBTEy2JrLEY2Lxh+H+Yp+Jd+j+1mz 1wRSG+rd/lk49Iso8l60QqjHWitS2jmBbheccAK0jDm8hUH0tW9b6eMZXGhbe/3ggdgi qd6nSGxiNL1e4iP+XOfYhh3NPnZ3R5xYgkOYDZ+8wHQgjvxtxboDlMzC9bxX4h/W/Nnz /xj/ruzs62Aved5bYn/BpjRdjADxX+u8jx8zSPFzkhXfofACbrHoR8XOwdzVuWhv7KAV rFBbmmD911j5+6Yf54lp4o6WE+r3M2rCDBXbTQR3bNlioEbpG1qNm5AbTeaNoGLQbp/H C82A== X-Received: by 10.66.122.8 with SMTP id lo8mr6996607pab.165.1368006398978; Wed, 08 May 2013 02:46:38 -0700 (PDT) Received: from localhost.localdomain ([202.108.130.138]) by mx.google.com with ESMTPSA id bl3sm7160741pbd.12.2013.05.08.02.46.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 May 2013 02:46:38 -0700 (PDT) From: Trival To: qemu-trivial@nongnu.org Date: Wed, 8 May 2013 17:46:19 +0800 Message-Id: <1368006380-3125-1-git-send-email-trivial@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.51 Cc: stefanha@gmail.com, qemu-devel@nongnu.org, Trival Subject: [Qemu-devel] [PATCH 1/2] clean unnecessary code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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) {