From patchwork Thu May 9 07:53:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Wang X-Patchwork-Id: 242715 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 B921C2C00EC for ; Thu, 9 May 2013 17:54:50 +1000 (EST) Received: from localhost ([::1]:56313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaLgf-0003Sv-30 for incoming@patchwork.ozlabs.org; Thu, 09 May 2013 03:54:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaLgF-0003OT-So for qemu-devel@nongnu.org; Thu, 09 May 2013 03:54:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UaLgF-0007Ab-37 for qemu-devel@nongnu.org; Thu, 09 May 2013 03:54:23 -0400 Received: from mail-ob0-x233.google.com ([2607:f8b0:4003:c01::233]:64547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaLgA-00079s-RK; Thu, 09 May 2013 03:54:18 -0400 Received: by mail-ob0-f179.google.com with SMTP id xn12so2593013obc.24 for ; Thu, 09 May 2013 00:54:18 -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=U/S3+qUo8IGbIpiVx0sTA2LUQntD5C0ig5YfPWU8v8A=; b=Jo6Zez2Q1ks/foxyCrKI1bermXXoXWrpGI6a+pX3KTjLvEfA4Ud1AeP5K2EmIFJ4el SnAHTdAImKfvbgua4Rw71qcD3/V9iDt1RDm28aJ8wbOcGUGCli8sS+MaKw8VdaK8+f++ Tyuew4XEuOHNq2I6iGTvgBbsjbv/En8hsBwA1ZkJ93FYKg+Te676Gj92A0p7zSgu+G6x Cadzt2BJBMECqwcnutaLUSSFBseY0FugJrtH2/Jlh01l/O1+IMSx1Nqc8zBBdQWSqjq/ VqF3GT1m29+NZ5xG5mIqZ7NRAfWErRrr7EGvsGUDlWPQkxnMB0daRmebnCKepg69UrN+ pAUw== X-Received: by 10.182.226.162 with SMTP id rt2mr3654080obc.9.1368086058074; Thu, 09 May 2013 00:54:18 -0700 (PDT) Received: from localhost.localdomain ([202.108.130.138]) by mx.google.com with ESMTPSA id jz6sm2344394oeb.3.2013.05.09.00.54.12 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 May 2013 00:54:17 -0700 (PDT) From: Dong Xu Wang To: qemu-trivial@nongnu.org Date: Thu, 9 May 2013 15:53:49 +0800 Message-Id: <1368086030-3847-1-git-send-email-wdongxu@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::233 Cc: hutao@cn.fujitsu.com, mjt@tls.msk.ru, qemu-devel@nongnu.org, Dong Xu Wang Subject: [Qemu-devel] [PATCH 1/2] clean unnecessary code: don't check g_strdup arg for NULL 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 Signed-off-by: Dong Xu Wang --- 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) {