From nobody Sun May 19 05:51:07 2024 Received: from mail-out.aladdin-rd.ru (mail-out.aladdin-rd.ru [91.199.251.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECF0D5B676 for ; Sun, 11 Feb 2024 15:10:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.199.251.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707664210; cv=none; b=dZ9DLCmYghgY5T2FKpkuUt9Ytfe8s43tAeqfIW3v45EgmjaKENUFU1eXBLc8V68yH6jbQZ9KOdMS//JX6cx/vf5vdV1ibsXO6mIdkgOawGG0xH7k95BqtYoIs1Y8ZNN31c+ZHoobIzvi8UPCoOCinUGs8XLDwvOnmnrrxZlVePQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707664210; c=relaxed/simple; bh=CFda6FtgqFCoYpvumAV9E9kesldPM7xLZy26c/iaEys=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=W3VKBJBQp1WQS5y9BWPuqypqD8P3PwHdFc08UOfn+HIaOdwf3vJmrV5zBKRVUEB3WdF54KHQiRcxGd8Qu0gKTpyjL02Dq2mvHW9vgONG/DM2wJjZ9/gEtBjpOJwNzYeTs4JS1/oXcL9pod5V4dTQk2PdYlR8hwwssUU5CQiHEr8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=aladdin.ru; spf=pass smtp.mailfrom=aladdin.ru; arc=none smtp.client-ip=91.199.251.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=aladdin.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aladdin.ru From: Daniil Dulov To: Juergen Gross CC: Daniil Dulov , Boris Ostrovsky , Konrad Rzeszutek Wilk , Stefano Stabellini , Jeremy Fitzhardinge , , , , Subject: [PATCH] swiotlb-xen: remove redundant NULL check Date: Sun, 11 Feb 2024 07:09:58 -0800 Message-ID: <20240211150958.4112-1-d.dulov@aladdin.ru> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: EXCH-2016-03.aladdin.ru (192.168.1.103) To EXCH-2016-01.aladdin.ru (192.168.1.101) Content-Type: text/plain; charset="utf-8" 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 PC= I 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; =20 - if (hwdev && hwdev->coherent_dma_mask) + if (hwdev->coherent_dma_mask) dma_mask =3D hwdev->coherent_dma_mask; =20 /* At this point dma_handle is the dma address, next we are --=20 2.25.1