iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] swiotlb: remove an unecessary NULL check
@ 2018-04-05 11:19 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2018-04-05 11:19 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk, Christoph Hellwig
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

Smatch complains here:

    lib/swiotlb.c:730 swiotlb_alloc_buffer()
    warn: variable dereferenced before check 'dev' (see line 716)

"dev" isn't ever NULL in this function so we can just remove the check.

Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index 47aeb04c1997..51dde88e50a3 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -727,7 +727,7 @@ swiotlb_alloc_buffer(struct device *dev, size_t size, dma_addr_t *dma_handle,
 
 out_unmap:
 	dev_warn(dev, "hwdev DMA mask = 0x%016Lx, dev_addr = 0x%016Lx\n",
-		(unsigned long long)(dev ? dev->coherent_dma_mask : 0),
+		(unsigned long long)dev->coherent_dma_mask,
 		(unsigned long long)*dma_handle);
 
 	/*

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-05 11:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-05 11:19 [PATCH] swiotlb: remove an unecessary NULL check Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).