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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130422101029.GP24632@intel.com>
Date:	Mon, 22 Apr 2013 15:40:29 +0530
From:	Vinod Koul <vinod.koul@...el.com>
To:	Lee Jones <lee.jones@...aro.org>
Cc:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	arnd@...db.de, linus.walleij@...ricsson.com,
	Dan Williams <djbw@...com>,
	Per Forlin <per.forlin@...ricsson.com>,
	Rabin Vincent <rabin@....in>
Subject: Re: [PATCH 08/32] dmaengine: ste_dma40: Optimise local MAX() macro

On Thu, Apr 18, 2013 at 11:11:50AM +0100, Lee Jones wrote:
> 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@...el.com>
> Cc: Dan Williams <djbw@...com>
> Cc: Per Forlin <per.forlin@...ricsson.com>
> Cc: Rabin Vincent <rabin@....in>
> Reported-by: Harvey Harrison <harvey.harrison@...il.com>
> Signed-off-by: Lee Jones <lee.jones@...aro.org>
> ---
>  drivers/dma/ste_dma40.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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)
Am not a big fan of own redefines, can you use kernel max() macro instead

--
~Vinod
>  
>  #define D40_IS_SRC(dir)  ((dir == STEDMA40_PERIPH_TO_MEM) ? true : false)
>  #define D40_IS_DST(dir) (((dir == STEDMA40_MEM_TO_PERIPH) || \
> -- 
> 1.7.10.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ