From nobody Mon Feb 9 17:37:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1565075534; cv=none; d=zoho.com; s=zohoarc; b=iTAZX+XT0ux0y0XAMs5yejgHeYclc6hDbsR4y6ysm6j9hSiDIaPnbsoLjY78zooLfe5ujGmxQ61iOtiF/ABf9j/43lI8b6pY996KwKRPSHvFY+di3Pu2sx7ZPdoQtPdmxU6P6e937R3Jacel9mXLINrLWpIfRdkhDqDOHbxTPu4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565075534; 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:ARC-Authentication-Results; bh=nzam9gYUF60MRs/2JS9aPYlPKRjnWzxCy94vlOEn3tw=; b=mdo3quNuR8wZKjkqfc+SA/IthyI6VXJxirGHdqmumlSk8xPpYgX8AHWALBqKgbCk37RQNjtEc7Ve+QisuY/QocGu8dmQzFOL8D0EZZ8nacW0/zRfsigNptFJddklBhnd+cUcYZg15tchUf+RhWWauZE1zfQkgWidpq0xC/pDu+Q= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1565075534114177.4364369466815; Tue, 6 Aug 2019 00:12:14 -0700 (PDT) Received: from localhost ([::1]:59356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hutdc-00075k-4Y for importer@patchew.org; Tue, 06 Aug 2019 03:12:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39652) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hutcl-0005sb-7v for qemu-devel@nongnu.org; Tue, 06 Aug 2019 03:11:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hutck-0002Fq-CZ for qemu-devel@nongnu.org; Tue, 06 Aug 2019 03:11:11 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:43438) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hutck-0002FD-6Z for qemu-devel@nongnu.org; Tue, 06 Aug 2019 03:11:10 -0400 Received: by mail-wr1-x442.google.com with SMTP id p13so12165798wru.10 for ; Tue, 06 Aug 2019 00:11:10 -0700 (PDT) Received: from 640k.localdomain.com ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id z6sm74944037wrw.2.2019.08.06.00.11.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Aug 2019 00:11:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nzam9gYUF60MRs/2JS9aPYlPKRjnWzxCy94vlOEn3tw=; b=Pm0R3BqRKOySZUrZsvVy6cp5kC6cLZtY6s7Xph81K1pNQ6VES8+tWuCSkmrH7ZKA/S jTAB7UXFWQc+Z9sYAZxbIjZRM3ESGEYYja8Qd4UgtYK/s+WCzVttSFw6FWXXuoeXG7Mh ISeAgP+pIc40O/lWwC+jwV4rh5IPl3684uVlQtMi+PI8mJ0Ob0olLtp3SYIf2DPc7JSJ XScvnXhy7mCML3gGFFMFUrUqRHwemnpRz9CPqpD2m9ZqMb9xFe2M5WB6DObnjRQRhzI1 f8ZEAUqxNJ+0rdA5yufxOk9oy79ViJckRO9+a2BLkwJeW6hPoLXRsTP1uNqnocI41H2R wpPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=nzam9gYUF60MRs/2JS9aPYlPKRjnWzxCy94vlOEn3tw=; b=WUqL3gnTVgUfu9TopCaKwR04Fn8tCLHDqxmTsReH1fXRot4aeGYydjITN/T7iKdEKg Pau/NqObIP4Pw7/Z/bC9TLrgLnetnUjL9SaI72BOn1j1Abi6bx+MxR50KSJ8LM7X+BUX ZfRjY3r9ic0Zzj3F/qhwaasL3WuTnVqJA/TFlc6NMHj609A+yMq1/7bhK6iKcmF7jQ4D ZQK4ga66olhAj8/lXkOez0HCK9jKuQmEd5ms2lFZQpcJuQmv7EVRReQP2qDvV6m4CAPJ 61SYOPqmzJV/VVT+MSzOsW6Z0IWK7YBNadmSewmX55WuTPmryH4bErGbYE1oixm8IlFf KK7Q== X-Gm-Message-State: APjAAAVBaIX761iz9pSRmM+7Cz0XQSofArPoChRKTV1HXYGkzuMDPSk8 uruHlWCeeA8OVmJQpFyO9uQhCKOB X-Google-Smtp-Source: APXvYqyq0ha7QOPPcJuAOs8YdWnKWqvpmCInwiV151T3/g2rdRznRe53Z+HfR4pdzn6uFzqH6NEcgg== X-Received: by 2002:a5d:63c9:: with SMTP id c9mr2759267wrw.15.1565075468989; Tue, 06 Aug 2019 00:11:08 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Aug 2019 09:11:04 +0200 Message-Id: <1565075466-14943-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1565075466-14943-1-git-send-email-pbonzini@redhat.com> References: <1565075466-14943-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 Subject: [Qemu-devel] [PATCH 1/3] module: use g_hash_table_add() 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: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , armbru@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau The hashtable is used like a set, use the convenience g_hash_table_add() function. Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini --- util/module.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util/module.c b/util/module.c index 142db7e..ca9885c 100644 --- a/util/module.c +++ b/util/module.c @@ -179,11 +179,10 @@ void module_load_one(const char *prefix, const char *= lib_name) =20 module_name =3D g_strdup_printf("%s%s", prefix, lib_name); =20 - if (g_hash_table_lookup(loaded_modules, module_name)) { + if (!g_hash_table_add(loaded_modules, module_name)) { g_free(module_name); return; } - g_hash_table_insert(loaded_modules, module_name, module_name); =20 exec_dir =3D qemu_get_exec_dir(); search_dir =3D getenv("QEMU_MODULE_DIR"); --=20 1.8.3.1