From nobody Mon Feb 9 03:50:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@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 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1604072281; cv=none; d=zohomail.com; s=zohoarc; b=Sz/TF4dmf1rkldMeQXsT1BVJAKLtU0sKW+/JXhJMXlOLtAIAXgCScY7xiAKRkaN71CGTIAnGsouOE2wS0+Dhzn1nu9/6OP+oKDy6JKNdYprAv6uuKVBYPut8Lo+KgI3CqlTouEqBPjsatCv4HRsIwnF4I67pD92aqY0d1sY7qk0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604072281; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=jauPRIkZdoN+DuZgLe3UIVdytdb2EoyDvX5nzVlCcDw=; b=a9t8fvMk3kyL2snoKwlJ8H8LNgQGUkTeZhUUkQyoquy78JvGcZpl4RByIYTllPPsD/pat61HwmaCoWhVEhiADt3jeAtf83QvzDzha24AdJwr2ZEhMfAOLOy0Uvt23cTIVJ9Js3wZlDPMN/D9gcLDBAMYvhpwaVllw3bOxpzfnpw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 16040722810149.010039262232112; Fri, 30 Oct 2020 08:38:01 -0700 (PDT) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-284-5AkNtghaO-GXH4Fu0CCWhw-1; Fri, 30 Oct 2020 11:37:57 -0400 Received: by mail-wm1-f71.google.com with SMTP id p7so742986wma.9 for ; Fri, 30 Oct 2020 08:37:57 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (234.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.234]) by smtp.gmail.com with ESMTPSA id f6sm3990108wml.5.2020.10.30.08.37.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2020 08:37:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604072279; 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; bh=jauPRIkZdoN+DuZgLe3UIVdytdb2EoyDvX5nzVlCcDw=; b=YROXx56R9+TTrWC6159meSuOcx3LEtSxP/VZjucI2AR3npjw+UyJrq6FrHvhQyD3UZvQHq gceUkORPjrYAaEXgh/AaaJgeUbXad2NOtvZZ6irnt+rx2UurN8wWoDkxTCjXAjt9lt5uZe IPMgpQ8hGrav1zIL4Mc2EEfxutT1yWM= X-MC-Unique: 5AkNtghaO-GXH4Fu0CCWhw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jauPRIkZdoN+DuZgLe3UIVdytdb2EoyDvX5nzVlCcDw=; b=hMvHjD/ICWCBmlc2TMkEk/TxR4mJGLlhOit5smYZYlGEJuS5lkp3zOBRUPYUleg/Jy jFPUmWC2edq6VcaHGRmiugO1iJCFZ7qrcrEw8Tu+19vJd0Yc7liW0jH2CsCfbR+VhiGg bR4DwXNeVIoOEog42lQNmaX26hwN+eJ6mYEah800h0iaJLxTI2cJ8Xxz7ApBg3x0KECS N5chU7AKhhJa/McfHMVBjZt4nvHIVT7gvN7QHQKwqeS9/xl5vNglSnoVPLO1xBCJelB9 E92eEiDf84zIyAdBvgHou0r/8cdlJ9SssnrKoSHCL4NbCBN3BqLUYCO3CPDji0J76lMI cvgw== X-Gm-Message-State: AOAM530QWUE78dZ9Kzy6ByXN0zmvI11doxxKRRSm7FuXsUNgsFCMBjaA ITa4KhNxMfVmIOyB+8dLCgI3sSbxMf0X3d6KN/TyTLu5ma7caFxoAexICjpSaJoYoEoUMk7NAnM altNiCc1K/0b7iQ== X-Received: by 2002:a5d:694b:: with SMTP id r11mr4021362wrw.104.1604072275338; Fri, 30 Oct 2020 08:37:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywnjZdkRnkBCV/sr6LGEeofC9vZfMu4xqnu9Itdfy5gWjEh87xpD0+t3IhSX+lV9QDOd7t3w== X-Received: by 2002:a5d:694b:: with SMTP id r11mr4021350wrw.104.1604072275164; Fri, 30 Oct 2020 08:37:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH-for-5.2] exec: Remove dead code (CID 1432876) Date: Fri, 30 Oct 2020 16:37:52 +0100 Message-Id: <20201030153752.1557776-1-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) We removed the global_locking field in commit 4174495408a, leaving dead code around the 'unlocked' variable. Remove it to fix the DEADCODE issue reported by Coverity (CID 1432876). Fixes: 4174495408a ("exec: Remove MemoryRegion::global_locking field") Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- softmmu/physmem.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/softmmu/physmem.c b/softmmu/physmem.c index a9adedb9f82..0b31be29282 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -2723,22 +2723,14 @@ static int memory_access_size(MemoryRegion *mr, uns= igned l, hwaddr addr) =20 static bool prepare_mmio_access(MemoryRegion *mr) { - bool unlocked =3D !qemu_mutex_iothread_locked(); bool release_lock =3D false; =20 - if (unlocked) { + if (!qemu_mutex_iothread_locked()) { qemu_mutex_lock_iothread(); - unlocked =3D false; release_lock =3D true; } if (mr->flush_coalesced_mmio) { - if (unlocked) { - qemu_mutex_lock_iothread(); - } qemu_flush_coalesced_mmio_buffer(); - if (unlocked) { - qemu_mutex_unlock_iothread(); - } } =20 return release_lock; --=20 2.26.2