From nobody Sat Jul 27 00:39:35 2024 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=1678264144; cv=none; d=zohomail.com; s=zohoarc; b=Pqk2Gil/N1ix59Doye9tn1QFUC8n981ks4s0d32IJZM0oAtfyoweNJdDtljjDc/dHvwxEjoOa4P36Ntm2qCgoASLTbmZV4qe27Z0cJiQebXYTmrcKs++Mp2dUSxDxUuDe5DdY03DRD0/NolTKbMwGajvTPNxeaSj/zLAQyJT8pE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678264144; 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=jRIqKl7o6l6obor1i7bFpWk5/7Xix175kNlrZz2nt0g=; b=HkwmnY/is4XmZkF9KkuzHLgKcZ5Ye2ig9/7TA12kpgTipq0CQ1eNO5km2oRufvg7h9xTUw8WPKL46rpi8oE5r1GzcvzaixcNpHk6599/NxGE7Y+xj8PLzZbpXHGNfwRs10WO6jDudrUcSIgIkivBPQ52Lgz9GnhC8TgQtaQDO5A= 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 1678264144539344.2739770125096; Wed, 8 Mar 2023 00:29:04 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-458-5bXuOo2zNr6OSAmHKk-1ug-1; Wed, 08 Mar 2023 03:28:49 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ABB81857F5E; Wed, 8 Mar 2023 08:28:45 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E4CB14171C3; Wed, 8 Mar 2023 08:28:45 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2E95C19472C7; Wed, 8 Mar 2023 08:28:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9CBDD19465B3 for ; Wed, 8 Mar 2023 08:28:24 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 693A1440E1; Wed, 8 Mar 2023 08:28:24 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A4E8440DD for ; Wed, 8 Mar 2023 08:28:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678264143; 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=jRIqKl7o6l6obor1i7bFpWk5/7Xix175kNlrZz2nt0g=; b=i6CipsD9H3IJOiIXCu6jm+K5PNIYliH1dKv28BQyvqQiio/Jvc+81RmRArvBPaglR2yART WPhuIdZmFRONfho9QtCfB7e1N+rqLDaGmN1IiJLX6iMR0UClwDGj8xB6Dz+WNXbx+JJowW 7aaQf8iqMkWW1fIh/9gEnVsEvURXgpE= X-MC-Unique: 5bXuOo2zNr6OSAmHKk-1ug-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/4] virscsihost: Drop needless labels Date: Wed, 8 Mar 2023 09:28:20 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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: 1678264145493100002 Content-Type: text/plain; charset="utf-8"; x-default="true" After previous cleanups, we're left with a couple of needless labels, that contain nothing but a return statement. Drop those. Signed-off-by: Michal Privoznik --- src/util/virscsihost.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/util/virscsihost.c b/src/util/virscsihost.c index c816b21f64..014b96452c 100644 --- a/src/util/virscsihost.c +++ b/src/util/virscsihost.c @@ -95,7 +95,6 @@ virSCSIHostFindByPCI(const char *sysfs_prefix, const char *prefix =3D sysfs_prefix ? sysfs_prefix : SYSFS_SCSI_HOST_P= ATH; struct dirent *entry =3D NULL; g_autoptr(DIR) dir =3D NULL; - char *ret =3D NULL; =20 if (virDirOpen(&dir, prefix) < 0) return NULL; @@ -114,7 +113,7 @@ virSCSIHostFindByPCI(const char *sysfs_prefix, host_link =3D g_strdup_printf("%s/%s", prefix, entry->d_name); =20 if (virFileResolveLink(host_link, &host_path) < 0) - goto cleanup; + return NULL; =20 if (!strstr(host_path, parentaddr)) { continue; @@ -127,24 +126,22 @@ virSCSIHostFindByPCI(const char *sysfs_prefix, } =20 if (virFileReadAll(unique_path, 1024, &buf) < 0) - goto cleanup; + return NULL; =20 if ((p =3D strchr(buf, '\n'))) *p =3D '\0'; =20 if (virStrToLong_ui(buf, NULL, 10, &read_unique_id) < 0) - goto cleanup; + return NULL; =20 if (read_unique_id !=3D unique_id) { continue; } =20 - ret =3D g_strdup(entry->d_name); - break; + return g_strdup(entry->d_name); } =20 - cleanup: - return ret; + return NULL; } =20 =20 @@ -224,10 +221,9 @@ virSCSIHostGetNameByParentaddr(unsigned int domain, _("Failed to find scsi_host using PCI '%s' " "and unique_id=3D'%u'"), parentaddr, unique_id); - goto cleanup; + return NULL; } =20 - cleanup: return name; } =20 --=20 2.39.2