Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2008789rdb; Sun, 11 Feb 2024 07:19:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXcm8r77aRsxZ+Ogl+sD35Dt8cV+hBUVIWvf+iN4CZxM9NmnItBfKUVHEbQOX4ai0Sxvh4RoP7bv4afWup601sL/qp+zLKnbe/sKQM5qg== X-Google-Smtp-Source: AGHT+IGlsX/6zVFp8v3cIK1VGzY8LdvXS2574Ji1ww6tTEgzbsA2SIWZKM6Y5QcLRT6+8/nTwKCt X-Received: by 2002:a17:90a:7446:b0:295:aaaa:74fe with SMTP id o6-20020a17090a744600b00295aaaa74femr6164408pjk.14.1707664766570; Sun, 11 Feb 2024 07:19:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707664766; cv=pass; d=google.com; s=arc-20160816; b=inBOLNRDANMZCEeWz75dqX06sc4bSbCjT121YYJBBKqKXZtHWHPeJhoBjWkQ7dfhLz x7I1ue60Rmvdvk/WVOpzqjLMqj+CGYRwQWFeAsAPQVk0kftFyir9Gom8xb1m+v47Tdha mmbS/gBkVw6pBNAfaT1sgu/iLGwjFYS2F9JtLZ8E/rT0aj8IshZoKJKz9mUKQvpLVqAs J2ltl4lHOJHiBa+KF/vnOAflIlGPEVgfHX2N3/vJPb664aiAjStxgrJJOVUjc6x+fNcO Z9CzVhV8cqPQwrRibNajHt/HZ5Ddpk+Uc2G+9WnPp8LnbQUbOq2ZJccOrIU6OKsiJahX hj9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=dzwIJZ+AkkNYn86AF0UR4INoEuJdpPjbsWwgaGqqCcg=; fh=/gGqIgk7Rq93P7rPF+hrXVyGCA1vsIctSQ761vbj6TQ=; b=QLj13tGT2ILWUUMZrUX2/iEjHZPrxxwmaFv2WfQHv7NfJh2RQdtlgBOKSxqe8HL/U5 XjEacFW/NtatHMvC7bJr6hgfyvttyC82TcYkXsOrg8LJYV0zzPra+V6LPMd7n3m5xHD0 WiBws4ba7RZSvZoubcvl63SOTBMMWenRs2h9UT2lDJl0Xh0G94vUlOov11mYDL7rZzpE 3YzSd+Qfc8GU7IflpwyXkfBtxBsMh8WtGmHa7/iY3+nUi2eEAYoS3EieWzb/taySlMkR rUNAvhP7ew6IC4TQvRrg895yaMvv2W49crvQe2jOwk9ixCDSXGIiuHxihRtloKbc4TQJ wasg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=aladdin.ru dmarc=pass fromdomain=aladdin.ru); spf=pass (google.com: domain of linux-kernel+bounces-60827-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60827-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aladdin.ru X-Forwarded-Encrypted: i=2; AJvYcCWRUgov/hedeAznPhLzBYHtNX5kcBAZKfR6mvk95e5dMbtqDN0GdsQWqfOSjsI/Nqyq1pv1W7qz0n3ge8iACrKyd3n0Q1VQ5gebDkxgsQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id nl8-20020a17090b384800b002970ca998a7si4247161pjb.25.2024.02.11.07.19.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 07:19:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60827-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=aladdin.ru dmarc=pass fromdomain=aladdin.ru); spf=pass (google.com: domain of linux-kernel+bounces-60827-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60827-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aladdin.ru 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 3EBF228496D for ; Sun, 11 Feb 2024 15:11:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E8F9F5C60A; Sun, 11 Feb 2024 15:10:10 +0000 (UTC) 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: 8bit Content-Type: text/plain X-ClientProxiedBy: EXCH-2016-03.aladdin.ru (192.168.1.103) To EXCH-2016-01.aladdin.ru (192.168.1.101) 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