All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dma-mapping: Simplify get_dma_ops() control flow
@ 2016-05-31 21:27 Bjorn Helgaas
  2016-06-01  7:55 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Bjorn Helgaas @ 2016-05-31 21:27 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, x86, H. Peter Anvin
  Cc: Max Filippov, Andrew Morton, linux-kernel, Guenter Roeck,
	Valentin Rothberg

Simplify code flow of get_dma_ops() by getting rid of several negations.
No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 arch/x86/include/asm/dma-mapping.h |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h
index 3a27b93..96db8ea 100644
--- a/arch/x86/include/asm/dma-mapping.h
+++ b/arch/x86/include/asm/dma-mapping.h
@@ -30,14 +30,11 @@ extern struct dma_map_ops *dma_ops;
 
 static inline struct dma_map_ops *get_dma_ops(struct device *dev)
 {
-#ifndef CONFIG_X86_DEV_DMA_OPS
-	return dma_ops;
-#else
-	if (unlikely(!dev) || !dev->archdata.dma_ops)
-		return dma_ops;
-	else
+#ifdef CONFIG_X86_DEV_DMA_OPS
+	if (likely(dev) && dev->archdata.dma_ops)
 		return dev->archdata.dma_ops;
 #endif
+	return dma_ops;
 }
 
 bool arch_dma_alloc_attrs(struct device **dev, gfp_t *gfp);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dma-mapping: Simplify get_dma_ops() control flow
  2016-05-31 21:27 [PATCH] dma-mapping: Simplify get_dma_ops() control flow Bjorn Helgaas
@ 2016-06-01  7:55 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2016-06-01  7:55 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Thomas Gleixner, Ingo Molnar, x86, H. Peter Anvin, Max Filippov,
	Andrew Morton, linux-kernel, Guenter Roeck, Valentin Rothberg

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-01  7:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-31 21:27 [PATCH] dma-mapping: Simplify get_dma_ops() control flow Bjorn Helgaas
2016-06-01  7:55 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.