lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160531212711.28908.22342.stgit@bhelgaas-glaptop2.roam.corp.google.com>
Date:	Tue, 31 May 2016 16:27:11 -0500
From:	Bjorn Helgaas <bhelgaas@...gle.com>
To:	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
	"H. Peter Anvin" <hpa@...or.com>
Cc:	Max Filippov <jcmvbkbc@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, Guenter Roeck <linux@...ck-us.net>,
	Valentin Rothberg <valentinrothberg@...il.com>
Subject: [PATCH] dma-mapping: Simplify get_dma_ops() control flow

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

Signed-off-by: Bjorn Helgaas <bhelgaas@...gle.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);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ