Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2743349rdb; Mon, 12 Feb 2024 15:29:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU5nfFuMaLcmZhs4aJzuk1tKQF977ZG+is1tMf0wCLlwOSZo942x14lHYqs5YGMOo1I+vM39qrtJ9q0WgiYLqsOh0IIZcJBlCxz51OzTA== X-Google-Smtp-Source: AGHT+IGzWUuR4Yo8juEK0ps75NlWMJyiDAtEZQ4pngDbk7/MaNnW+Eot94CV0+BSbwF8ScZ0kgig X-Received: by 2002:a17:903:1c3:b0:1d9:b86c:429a with SMTP id e3-20020a17090301c300b001d9b86c429amr12138977plh.62.1707780585429; Mon, 12 Feb 2024 15:29:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707780585; cv=pass; d=google.com; s=arc-20160816; b=lVuqV55eTAcs2DCiCABXFlIjwaXcrPHBB4uAdV4h1xh7U5IRlHdUHJ5Y5roEiwRasU Ki+2aiJ7MieJEkKjycv9B4+MYMWqVocW+3h3EqwuA89KNJPZO6sMc6lIXIl1+0FqpIoL BSJh9ZhjyOX+BXYW5F7DMMEfUX5t6ZklRC0FPJQsHe2rH6LNcrH4hLvkPtMm1Yp88Xd3 Z/3rXNaVh5Y+8JyWFrh8VqqIaKkKQahDPuJAXOqAocqvyOu1Kuiy0L6m2O93bLM5MoIK m4Pd5nkqaxmgo6ZcBjSRYaktOBLw4e8PF7sfJrsS8oBhNrj0JoW+uMrunQd3NHU0Fo+m C7HA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:references:message-id:in-reply-to:subject:cc:to:from :date:dkim-signature; bh=Vq12Yee9hI1X53ep8YfySL2U8t2HBzUlO3opQCvK6MU=; fh=KZA/Bc6FxhmLHPX1yFAsZUCslynlny4z5umQjC9oTrk=; b=yH1sjihlHCIzC/rmNyyoaGTCsHc64kRXthWdTgDM07my5EhiO8ee0zlRcCofN4GhyW leJQI/ZzG+/hGqdxTH87zay5d1oGks4tNSYDEjgogK35s+x0cjH7jjnC9/4JkGToJ2Lr wco2hGqr0nZkF1Pg20sINBMC1c3wBfE2Ao7Qo5mkeSRXeDrqs0bGbcGiZA6+ta1rLqhm zif3LETvThE466PuadmBok+fdsBUGk+sAGOPTD28ArnoIQf3jM3HYyzE78Q0kvuGZMpU wSba9MmnwcXc3BfFa4HbSa/fvP8bnBEnBfJrtjgO5AduW8tIxOAquloojIBnXvG1qgGA 00zw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sUhjCLey; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-62538-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62538-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXSvJb66j1F8t14yYPz5D0mnHC1hS4azGWqS4Ga5pOJddnPDRv76SN1un1g7BlphF8C+WkRrOWFGQA4O+LV9i9JXZukiUnSb2j5jsMXFQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l18-20020a170903245200b001d95e26b2bbsi973733pls.75.2024.02.12.15.29.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 15:29:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62538-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sUhjCLey; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-62538-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62538-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C6761283E5D for ; Mon, 12 Feb 2024 23:29:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B73F55024A; Mon, 12 Feb 2024 23:29:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sUhjCLey" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF4BB4F888 for ; Mon, 12 Feb 2024 23:29:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707780544; cv=none; b=R1wqbhz1CWjAcoQ3uC9foBlymWizQ4aHruqk12V00sQQTahIRdKXDljzTB3NZLJvSyD86Lnwwwrqbg+G6yko9N40+At9N5LMrY0yIe5/IG//CB/RzqtvfxJ3xSUkLOovTjpFkeVNDE0ivGtZ0VLfC31Igsu0otOywrvbzD1+lPw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707780544; c=relaxed/simple; bh=OZmWRyAZ96aIiqGUnApBj9/GzU1LECVikVIx9OJtviQ=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=Jx4yQGxpVFP4zYg7t8HH3Lwk7bqwlFJhN2VxqI27Abt3z4mrwzcHUU/oUia1l/BTBRU9dM53G2WWwLxS20plvCCQYvHSwUd/okGWHk7xaMukCjrhG02TYPVgDH90O1MrgJbC1LKNncyembqq1xAJm0P146a90xs48rJwqGx0NVU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sUhjCLey; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 606FCC433F1; Mon, 12 Feb 2024 23:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707780543; bh=OZmWRyAZ96aIiqGUnApBj9/GzU1LECVikVIx9OJtviQ=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=sUhjCLeyJQSC+hYpQL8kqbT2BVhPqwCcgcfsMisIAG+uQqimRkMNRF9PL9cfIRKWh yRUbEFI3XOWQKFB1UR0dJ93ghozW/fXhgrK30ChKeAve0qshx7Wc1y+sXH7Ay3TZnO wkgJg07KcZaPhuYqRXw7wJrwi4jp95t7xecibBbo8B8ZPlhcnJ68jwo9iuOql/9IrY EopbupN+xxGkeFL29wrjUI15kTwGaCaygI4nAdrKVLMaTQVfdOsNmov+B3+ehDu+Im iQIqRFZP5eT+ZBuUJjvfoMHuqhyiGdZ78Uza/0kXjFxS7X1f6EzKp7sLoDlhMyjDst ncPa8BgzLi+mQ== Date: Mon, 12 Feb 2024 15:29:00 -0800 (PST) From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: Daniil Dulov cc: Juergen Gross , Boris Ostrovsky , Konrad Rzeszutek Wilk , Stefano Stabellini , Jeremy Fitzhardinge , xen-devel@lists.xenproject.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: Re: [PATCH] swiotlb-xen: remove redundant NULL check In-Reply-To: <20240211150958.4112-1-d.dulov@aladdin.ru> Message-ID: References: <20240211150958.4112-1-d.dulov@aladdin.ru> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Hi Daniil, Against which Linux branch was this patch generated? Cheers, Stefano On Sun, 11 Feb 2024, Daniil Dulov wrote: > In this case hwdev cannot be NULL, so remove redundant NULL check. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: b097186fd29d ("swiotlb-xen: SWIOTLB library for Xen PV guest with PCI passthrough.") > Signed-off-by: Daniil Dulov > --- > drivers/xen/swiotlb-xen.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c > index 2b385c1b4a99..b166f6efea26 100644 > --- a/drivers/xen/swiotlb-xen.c > +++ b/drivers/xen/swiotlb-xen.c > @@ -305,7 +305,7 @@ xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size, > if (!ret) > return ret; > > - if (hwdev && hwdev->coherent_dma_mask) > + if (hwdev->coherent_dma_mask) > dma_mask = hwdev->coherent_dma_mask; > > /* At this point dma_handle is the dma address, next we are > -- > 2.25.1 >