From nobody Tue Feb 10 06:57:48 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=1578410587; cv=none; d=zohomail.com; s=zohoarc; b=RcR5RmXpZxircGhHlMn8qhyk+hjgJADUrxYZlXJgxZJUk8jkpE0JpuMzmofbB0d1n/esO1y5sMZnXaioaEwA7ubTp8ma1krnO4WdRA3LDWCTasALqzr38paA1x3188Gla1A18mKXbeZheX5NjJjJs5jxHWKRNDKpVra2flyq9IA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578410587; 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=8VKEc8VlnQnG8/4SFTl8P15OlmXM6phP4gj0P6bqgC0=; b=eQ+xsZa4Y0avNSqDY2hGBx2kYLML45WCHTCjykMARoWUuTRItbGEiBDfC/v6V/eVjbKIrbMVkjpv86goinGVvhaAsXF+bpC3NWErqelGHoNLQLunCKc/nG56p//uG6I/LdYZImT2uIWdmhAtsrnhCkYEaD986mt2ZpikacGvnUs= 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 1578410587834728.8769293051296; Tue, 7 Jan 2020 07:23:07 -0800 (PST) Received: from localhost ([::1]:51361 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioqhF-0004HB-Tg for importer@patchew.org; Tue, 07 Jan 2020 10:23:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57448) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioqV0-0000C3-HD for qemu-devel@nongnu.org; Tue, 07 Jan 2020 10:10:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioqUy-0006TK-CV for qemu-devel@nongnu.org; Tue, 07 Jan 2020 10:10:26 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:46366 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ioqUy-0006Sx-8P for qemu-devel@nongnu.org; Tue, 07 Jan 2020 10:10:24 -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-434-rG0gYIYxOvGRX80rqUAMhw-1; Tue, 07 Jan 2020 10:10:21 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8C8C98024D1; Tue, 7 Jan 2020 15:10:20 +0000 (UTC) Received: from localhost (ovpn-112-42.ams2.redhat.com [10.36.112.42]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E1B31001925; Tue, 7 Jan 2020 15:10:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578409823; 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=8VKEc8VlnQnG8/4SFTl8P15OlmXM6phP4gj0P6bqgC0=; b=fpTsuEEu21Bxjvw+2qLWlbpOSAvuh3C7wtP/ReMjzTPmcXT7NO8Nb2kb7OmBw/Med3I4ty QQ9RPCQeVDR9bDs0c2JaMaUl8zlebsDrr9G02cfEX7p9iAu7zm33IKfZerzlMm2T2lkCPa 8KXjesFA1MoNVa6VBxU5f0vVaU+g6lA= From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Subject: [PULL 28/37] qdev: use g_strcmp0() instead of open-coding it Date: Tue, 7 Jan 2020 19:04:33 +0400 Message-Id: <20200107150442.1727958-29-marcandre.lureau@redhat.com> In-Reply-To: <20200107150442.1727958-1-marcandre.lureau@redhat.com> References: <20200107150442.1727958-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: rG0gYIYxOvGRX80rqUAMhw-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.61 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?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 501228ba08..aa3ccbf2ec 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.25.0.rc1.20.g2443f3f80d