lkml.org 
[lkml]   [2024]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] swiotlb-xen: remove redundant NULL check
Date
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 <d.dulov@aladdin.ru>
---
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

\
 
 \ /
  Last update: 2024-05-27 14:57    [W:2.208 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site