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: <668e65d3-f7a5-2387-bad8-d4b29bb69563@huawei.com>
Date: Tue, 14 May 2024 21:11:16 +0800
From: Jinjie Ruan <ruanjinjie@...wei.com>
To: <tglx@...utronix.de>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] genirq: Clean code for handle_edge_irq()



On 2024/5/14 21:09, Jinjie Ruan wrote:
> The pending set and mask_ack_irq() repeated twice, a new goto label can
> reduce a few lines of code, with no functional changes.
> 
> Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
> ---
>  kernel/irq/chip.c | 17 +++++++----------
>  1 file changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
> index 638cf5eee04b..4613dc9ff6b6 100644
> --- a/kernel/irq/chip.c
> +++ b/kernel/irq/chip.c
> @@ -775,21 +775,15 @@ void handle_edge_irq(struct irq_desc *desc)
>  
>  	desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
>  
> -	if (!irq_may_run(desc)) {
> -		desc->istate |= IRQS_PENDING;
> -		mask_ack_irq(desc);
> -		goto out_unlock;
> -	}
> +	if (!irq_may_run(desc))
> +		goto out_mask_ack;
>  
>  	/*
>  	 * If its disabled or no action available then mask it and get
>  	 * out of here.
>  	 */
> -	if (irqd_irq_disabled(&desc->irq_data) || !desc->action) {
> -		desc->istate |= IRQS_PENDING;
> -		mask_ack_irq(desc);
> -		goto out_unlock;
> -	}
> +	if (irqd_irq_disabled(&desc->irq_data) || !desc->action)
> +		goto out_mask_ack;
>  
>  	kstat_incr_irqs_this_cpu(desc);
>  
> @@ -818,6 +812,9 @@ void handle_edge_irq(struct irq_desc *desc)
>  	} while ((desc->istate & IRQS_PENDING) &&
>  		 !irqd_irq_disabled(&desc->irq_data));
>  
> +out_mask_ack:
> +	desc->istate |= IRQS_PENDING;
> +	mask_ack_irq(desc);

Please ignore this patch, this is a generic export and should not be
used as such.

>  out_unlock:
>  	raw_spin_unlock(&desc->lock);
>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ