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] [day] [month] [year] [list]
Message-ID: <fa150839-43d3-ed28-b1ae-7eaa15a1200d@huawei.com>
Date: Mon, 2 Sep 2024 09:58:16 +0800
From: Jinjie Ruan <ruanjinjie@...wei.com>
To: David Laight <David.Laight@...LAB.COM>, "tglx@...utronix.de"
	<tglx@...utronix.de>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] genirq/timings: Use min_t() to simplify the code



On 2024/9/2 4:53, David Laight wrote:
> From: Jinjie Ruan
>> Sent: 31 August 2024 10:37
>>
>> The irq count can not exceed circular buffer IRQ_TIMINGS_SIZE, use
>> min_t() to simplify it.
>>
>> Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
>> ---
>>  kernel/irq/timings.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/kernel/irq/timings.c b/kernel/irq/timings.c
>> index c43e2ac2f8de..69f103b4c7a6 100644
>> --- a/kernel/irq/timings.c
>> +++ b/kernel/irq/timings.c
>> @@ -406,8 +406,7 @@ static u64 __irq_timings_next_event(struct irqt_stat *irqs, int irq, u64 now)
>>  	/*
>>  	 * '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);
> 
> Why min_t() ?
> 
> 	David

To align with the latter min_t() in __irq_timings_next_event().

> 
>>
>>  	start = irqs->count < IRQ_TIMINGS_SIZE ?
>>  		0 : (irqs->count & IRQ_TIMINGS_MASK);
>> --
>> 2.34.1
>>
> 
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ