From nobody Wed Nov 27 04:55:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1701451070; cv=none; d=zohomail.com; s=zohoarc; b=Tzj5/aIPC9VBzIlb8eSrctgXYJDy/QDInUSakBIg/b0R0WfhGFQSegYL1tquVWHgagZ0gUC2/1JT/PKXYBRnL0unD3vCcLianEngz++cLn0GpJOoEHs3URsu8KOcLdXrHxc/jnBjMQjvgldz2GGkotqsp1M/xtaLGaQygnoDBI4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701451070; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=H1JMOyu2nTSDqoh4LCBRYQLr+2pQDRCpjv4f4k1WD7I=; b=AYfQGA6TXm2BiUTQk4rmcqeW/Kgs4z+ofSKNDF3tT5wfblT48jlJ+uvz4qfzKEPZ2Z/WE/02BuUqhJNQPF2cUSgigY4V7vzXyBYUS4R5dJjXwZu+huBcERBzUtw4UE5ExjL/0LG9jQNPuXzM+ICuqovs3xVW6rMjniHFlPVEeQs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1701451070564229.52578773865127; Fri, 1 Dec 2023 09:17:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r977R-00037o-Jt; Fri, 01 Dec 2023 12:16:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r977F-0002vU-1H for qemu-devel@nongnu.org; Fri, 01 Dec 2023 12:15:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r977D-0007mH-1G for qemu-devel@nongnu.org; Fri, 01 Dec 2023 12:15:48 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-54-bGV302caOYqMmumOAwUbTA-1; Fri, 01 Dec 2023 12:15:43 -0500 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-40b5482879cso19266655e9.0 for ; Fri, 01 Dec 2023 09:15:42 -0800 (PST) Received: from redhat.com ([2a06:c701:73e1:6f00:c7ce:b553:4096:d504]) by smtp.gmail.com with ESMTPSA id n10-20020a05600c4f8a00b0040b4b2a15ebsm5953424wmq.28.2023.12.01.09.15.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 09:15:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701450945; 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: in-reply-to:in-reply-to:references:references; bh=H1JMOyu2nTSDqoh4LCBRYQLr+2pQDRCpjv4f4k1WD7I=; b=FUs5PpJbL/lFbebA9MNa/d4QwnODtoZxuHB1KeNNfdblL0cm8Aw3d0NyJmx4pheYKI8Kbf lw9b1gMSQpNTGeIW6mUmlqjg2InMIIbMJSoijfktqUVVU3+OVAymZkCQt2XjTMQA5F6gBu d173bqVgs9kVFVXci1cDw4PJJxALpmU= X-MC-Unique: bGV302caOYqMmumOAwUbTA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701450941; x=1702055741; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=H1JMOyu2nTSDqoh4LCBRYQLr+2pQDRCpjv4f4k1WD7I=; b=ZT1GjptMe/8jAERitd3tvVwhya2VjFT+rMGA6NELlDvAOv3RQW3NZWJpyx93g5Hdsd 0u9Jgzh3aTeTFlgY/icqC2zLQSZ3DNO3DoeeaaZxNRJP3PMNRM84zeHeEWmwtxaGpZw2 5K1hqZzpi5P7qMIp3AmGF9rTHDDITg7uv1e7PFCtUpUzcRAFDG2Py4ciw99FMjuxjJiw C0S8A9QK8JGvU3nIfuZdK4u6M2+Vmw66p+4hYV+miB6PsYzYTWN3VVTXh6qFDO5ZQ+nR 9wGClTmz1QYJHJliTMecyCO/KeTMk0nyeDpDJ53YRDuHGWIAhvQRaF9LgxVimUTlfL/i t11w== X-Gm-Message-State: AOJu0YxAevgeYKO4Zntv7R2qMwlL7wZQZbPbuVeNDJaKcjFIPTcZISep 4vTXIN1Qwo53mzN/SY3Eq2j2lbojh2+hcsjOAQc4hJbogHFInWW5D/bm0aKqBM2gmbN4HjyaGuw zf7cHYjfJ3RSuT3h3AdVtD7MC9cPhCU60LgtdixqUrIIfR72WJz07dVE8sBO/EM9RKsDn X-Received: by 2002:a05:600c:4ec8:b0:40b:5e4a:2347 with SMTP id g8-20020a05600c4ec800b0040b5e4a2347mr863555wmq.73.1701450941355; Fri, 01 Dec 2023 09:15:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBVeKqZaDS0Tuvk4V63o6BSfAwFyjV8aMvhmkVTesM+TNPi9AzShGDVBPDDZi1+dgfes5EKA== X-Received: by 2002:a05:600c:4ec8:b0:40b:5e4a:2347 with SMTP id g8-20020a05600c4ec800b0040b5e4a2347mr863549wmq.73.1701450941043; Fri, 01 Dec 2023 09:15:41 -0800 (PST) Date: Fri, 1 Dec 2023 12:15:39 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Eric Auger Subject: [PULL 12/15] virtio-iommu: Remove useless !sdev check in virtio_iommu_probe() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1701451071161000001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Eric Auger The code already checks iommu_mr is not NULL so there is no need to check container_of() is not NULL. Remove the check. Fixes: CID 1523901 Fixes: 09b4c3d6a2 ("virtio-iommu: Record whether a probe request has been issued") Signed-off-by: Eric Auger Reported-by: Coverity (CID 1523901) Message-Id: <20231109170715.259520-1-eric.auger@redhat.com> Reviewed-by: Peter Maydell Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-iommu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c index 89fb5767d1..9d463efc52 100644 --- a/hw/virtio/virtio-iommu.c +++ b/hw/virtio/virtio-iommu.c @@ -698,9 +698,6 @@ static int virtio_iommu_probe(VirtIOIOMMU *s, } =20 sdev =3D container_of(iommu_mr, IOMMUDevice, iommu_mr); - if (!sdev) { - return -EINVAL; - } =20 count =3D virtio_iommu_fill_resv_mem_prop(sdev, ep_id, buf, free); if (count < 0) { --=20 MST