From nobody Tue Feb 10 02:00:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576850528; cv=none; d=zohomail.com; s=zohoarc; b=hvPUo32EKvnfmYUbfdEMC8gHp1iSdeH3GWdyAxSHS7SRfjn2AnMHrYbpSRnxEBMg4jJAwkAlHV3cuMxk3RdNnBLJokFhnr519FiGgBbupKhwM3lDdyFAxDfcsRCQjgv9sUstHtuRaarYUv0V/x3bhgMUnhkoTxRnVxrU0HsWCfQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576850528; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dfuYN8YWmN5oz0foLzHhOai8L2U2g3A3C5ZN+e389jI=; b=KGockff8zPWlfC2ydpRuJoo28a9lmUN/m2aQYWhFxvW246SfnjtmJJDPx7AgkJLoHdREmBzD2S7miXU/lzGCLvQPpAopsBsgxW6InXuBqpBjlb+fPcnLD2tiLJIRne7TLggwHohHeZUQvAzexscOYYuPQIsk8Z5BkY9JYaX46uQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157685052802187.57803901713294; Fri, 20 Dec 2019 06:02:08 -0800 (PST) Received: from localhost ([::1]:56374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iiIr0-0001JG-CQ for importer@patchew.org; Fri, 20 Dec 2019 09:02:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35183) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iiIgH-0001JZ-If for qemu-devel@nongnu.org; Fri, 20 Dec 2019 08:51:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iiIgG-0002oR-F5 for qemu-devel@nongnu.org; Fri, 20 Dec 2019 08:51:01 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:20374 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iiIgG-0002m8-57 for qemu-devel@nongnu.org; Fri, 20 Dec 2019 08:51:00 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-248-nc_6oMnWNSKUdnTHjFVr8g-1; Fri, 20 Dec 2019 08:50:55 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 258C9113787B; Fri, 20 Dec 2019 13:50:54 +0000 (UTC) Received: from localhost (ovpn-112-54.ams2.redhat.com [10.36.112.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C5C16B566; Fri, 20 Dec 2019 13:50:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576849858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dfuYN8YWmN5oz0foLzHhOai8L2U2g3A3C5ZN+e389jI=; b=PYP1iREkNgLQDDEtyNZ44sZXo3PZUnkuDLOIULBsl5uGyxC8oFdnMOFhow3cWFOgJuu2aR c6M0GPQA4LDaFRDLlW1kz2DPwASuQORihXTti9QnF34/UJKY/nv4M4+0Ga0Zb1uEOEcGai AaJmUR13/S21eCxnqIrB4jvsldYxtqQ= From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Subject: [PATCH v5 28/37] qdev: use g_strcmp0() instead of open-coding it Date: Fri, 20 Dec 2019 17:45:52 +0400 Message-Id: <20191220134601.571905-29-marcandre.lureau@redhat.com> In-Reply-To: <20191220134601.571905-1-marcandre.lureau@redhat.com> References: <20191220134601.571905-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: nc_6oMnWNSKUdnTHjFVr8g-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Minor code simplification. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/core/qdev.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 82d3ee590a..98e786c50f 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -394,11 +394,8 @@ static NamedGPIOList *qdev_get_named_gpio_list(DeviceS= tate *dev, NamedGPIOList *ngl; =20 QLIST_FOREACH(ngl, &dev->gpios, node) { - /* NULL is a valid and matchable name, otherwise do a normal - * strcmp match. - */ - if ((!ngl->name && !name) || - (name && ngl->name && strcmp(name, ngl->name) =3D=3D 0)) { + /* NULL is a valid and matchable name. */ + if (g_strcmp0(name, ngl->name) =3D=3D 0) { return ngl; } } --=20 2.24.0.308.g228f53135a