diff mbox

[08/32] dmaengine: ste_dma40: Optimise local MAX() macro

Message ID 1366279934-30761-9-git-send-email-lee.jones@linaro.org
State New
Headers show

Commit Message

Lee Jones April 18, 2013, 10:11 a.m. UTC
The current implementation of the DMA40's local MAX() macro evaluates
its arguments more times than is necessary. This patch strips it
optimises it to only evaluate what's appropriate.

Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <djbw@fb.com>
Cc: Per Forlin <per.forlin@stericsson.com>
Cc: Rabin Vincent <rabin@rab.in>
Reported-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/dma/ste_dma40.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index b21a8a3..7b451b2 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -53,7 +53,7 @@ 
 #define D40_ALLOC_PHY		BIT(30)
 #define D40_ALLOC_LOG_FREE	BIT(0)
 
-#define MAX(a, b) (((a) < (b)) ? (b) : (a))
+#define MAX(a, b) ((a > b) ? a : b)
 
 #define D40_IS_SRC(dir)  ((dir == STEDMA40_PERIPH_TO_MEM) ? true : false)
 #define D40_IS_DST(dir) (((dir == STEDMA40_MEM_TO_PERIPH) || \