From nobody Mon Feb 9 14:00:35 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1641829579; cv=none; d=zohomail.com; s=zohoarc; b=PtS0G6fF0F1Gj9XFg1JlVCVukBmZH4VKS7z6iJl3KqD832AKrnklUW6450+JjmNpD9W9tQQx3IT4GDitSWVcNB7tuIenEMxOi9gex+oxYDAT86IAOL9i5Gq/6HgKEKYwX30VY8LcV1yqlk4ugmjhlswaZTNFFve33TrAy3IGTpc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641829579; 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=ptTnQhrJmc2yQp3vJxbmcFum8Qzlp6epe0HBHv6X00w=; b=QJbXVhCVLP8KpjtpYya8OM4cSZzVEJvf6jkbxju5BVaQS/YRN3LHHrjXvDNFRDOR4v3ko7JXm6mK9U+a+fawNVsMD56Bl+QOnZfpJ7zjXqL/5Xx9ovWiJyxHyMt5x9ZthnADsj+6uTtpBOuCrvBCV7+4k0BRYIVkD4rv1aOmPUM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1641829579422713.4115856368778; Mon, 10 Jan 2022 07:46:19 -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-177-f98ptrH7PMSUUbzIO9E0QQ-1; Mon, 10 Jan 2022 10:46:14 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E7A4343CD; Mon, 10 Jan 2022 15:46:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 094842BE76; Mon, 10 Jan 2022 15:46:09 +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 CD9BA4CA93; Mon, 10 Jan 2022 15:46:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20AFk7Jd019015 for ; Mon, 10 Jan 2022 10:46:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id EC3FC105C89B; Mon, 10 Jan 2022 15:46:07 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 725EC105C892 for ; Mon, 10 Jan 2022 15:45:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641829578; 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=ptTnQhrJmc2yQp3vJxbmcFum8Qzlp6epe0HBHv6X00w=; b=agzhbKBe853qMlUbWby10q6AwqOVd29kH4YrsDJBTz0AKV8I7jmLCXcfNJyecr5xLZpTDr rzZYPVeSDmousWkOabgvVxInZTxzxvFZbUCxA8HNXP2G7ilMR5T0TfvVFAXPKjBFoP0acT 6E/eG7kQWCU1tC0Uxbr315uUDZJJpcw= X-MC-Unique: f98ptrH7PMSUUbzIO9E0QQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/3] virdnsmasq: Drop @binaryPath argument from dnsmasqCapsNewEmpty() Date: Mon, 10 Jan 2022 16:44:53 +0100 Message-Id: <62966f3d946806b66a31cb27d3fa7696f985817e.1641829321.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.84 on 10.5.11.23 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: 1641829581122100001 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