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: <20190524135742.GX9224@smile.fi.intel.com>
Date:   Fri, 24 May 2019 16:57:42 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Daniel Lezcano <daniel.lezcano@...aro.org>
Cc:     tglx@...utronix.de, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2 4/9] genirq/timings: Use the min kernel macro

On Fri, May 24, 2019 at 01:16:10PM +0200, Daniel Lezcano wrote:
> The' min' is available as a kernel macro. Use it instead of writing
> the same code.

While it's technically correct...

>  	/*
>  	 * 'count' will depends if the circular buffer wrapped or not
>  	 */
> -	count = irqs->count < IRQ_TIMINGS_SIZE ?
> -		irqs->count : IRQ_TIMINGS_SIZE;
> +	count = min_t(int, irqs->count,  IRQ_TIMINGS_SIZE);
>  
>  	start = irqs->count < IRQ_TIMINGS_SIZE ?
>  		0 : (irqs->count & IRQ_TIMINGS_MASK);

...looking to the context I would leave as is to have a pattern.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ