From nobody Sat Feb 7 09:14:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642516696; cv=none; d=zohomail.com; s=zohoarc; b=muljw81RjM/hKF0R63Ape8u5p/yg1N+w0uBfiPyP3MkevzuNIivFGS3ZYaAsFkbZxX+uqzWJchriVEXiRS0yE5tMLNm3e+dHRK6fcdVTiMZO/xDYQECoqecvRCtolDyK6A+/t2jLSoHaeAHFlGvoqTsrg5jnjKc8OF6qv8ezrq8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642516696; h=Content-Type:Content-Transfer-Encoding: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=HOI5MO/DnZeIVglUEGzJi9Fae+jqF5Hn5EAjFmVBxv4=; b=BCX9/utauzh2Fk62oilp4Mun2IY3mrpcXeUsMPBwSnkVpZVfrCbEt8XsTB9BfmA2HROK+3WX1zJYYthLeymOMOTJKYDqujqIhu65ePT1h9k8o/WcZZYaUZh87YgYBo+qrls400X4613YniX4GvXZDTejgvDvm+vWEiD/dwSdKr8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1642516696709666.430649212989; Tue, 18 Jan 2022 06:38:16 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-146-y1CafkNRPe-NlckLCXSKbA-1; Tue, 18 Jan 2022 09:38:13 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 72D6E36393; Tue, 18 Jan 2022 14:38:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DD819753D1; Tue, 18 Jan 2022 14:38:07 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F09191809CB8; Tue, 18 Jan 2022 14:38:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20IEbe5k016620 for ; Tue, 18 Jan 2022 09:37:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5BE652C1AE; Tue, 18 Jan 2022 14:37:40 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9FFF2BE7F for ; Tue, 18 Jan 2022 14:37:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642516695; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=HOI5MO/DnZeIVglUEGzJi9Fae+jqF5Hn5EAjFmVBxv4=; b=HA69u6MxP1+kPta4afYaSPz8JOUyqE23GrVt4PqgFjb2s7eGESqerGG43OkWgKeQrr0TNq RujINoHJePKN0t0SOIzmZtRLpHul5dDsCIvigl8pkvROjPNid32dXDArVGoMR2/BoBIDTr zi/hrPNdoTclXAo5lNz6AR9bMkbfyxI= X-MC-Unique: y1CafkNRPe-NlckLCXSKbA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v5 01/13] virdnsmasq: Drop @binaryPath argument from dnsmasqCapsNewEmpty() Date: Tue, 18 Jan 2022 15:37:08 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642516698758100001 Content-Type: text/plain; charset="utf-8" Both callers of dnsmasqCapsNewEmpty() pass DNSMASQ as an argument which is then fed to a ternary operator which looks like this (after substitution). DNSMASQ ? DNSMASQ : DNSMASQ While I like tautologies, the code can be simplified by dropping the argument. Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- src/util/virdnsmasq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c index e5edec2b64..d304929d51 100644 --- a/src/util/virdnsmasq.c +++ b/src/util/virdnsmasq.c @@ -700,7 +700,7 @@ dnsmasqCapsRefreshInternal(dnsmasqCaps *caps, bool forc= e) } =20 static dnsmasqCaps * -dnsmasqCapsNewEmpty(const char *binaryPath) +dnsmasqCapsNewEmpty(void) { dnsmasqCaps *caps; =20 @@ -708,14 +708,14 @@ dnsmasqCapsNewEmpty(const char *binaryPath) return NULL; if (!(caps =3D virObjectNew(dnsmasqCapsClass))) return NULL; - caps->binaryPath =3D g_strdup(binaryPath ? binaryPath : DNSMASQ); + caps->binaryPath =3D g_strdup(DNSMASQ); return caps; } =20 dnsmasqCaps * dnsmasqCapsNewFromBuffer(const char *buf) { - dnsmasqCaps *caps =3D dnsmasqCapsNewEmpty(DNSMASQ); + dnsmasqCaps *caps =3D dnsmasqCapsNewEmpty(); =20 if (!caps) return NULL; @@ -730,7 +730,7 @@ dnsmasqCapsNewFromBuffer(const char *buf) dnsmasqCaps * dnsmasqCapsNewFromBinary(void) { - dnsmasqCaps *caps =3D dnsmasqCapsNewEmpty(DNSMASQ); + dnsmasqCaps *caps =3D dnsmasqCapsNewEmpty(); =20 if (!caps) return NULL; --=20 2.34.1