[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <mhng-d2276021-b769-46e2-af6c-40802385909c@palmer-ri-x1c9>
Date: Tue, 17 Sep 2024 06:24:43 -0700 (PDT)
From: Palmer Dabbelt <palmer@...belt.com>
To: lihongbo22@...wei.com
CC: tglx@...utronix.de, Paul Walmsley <paul.walmsley@...ive.com>,
samuel.holland@...ive.com, linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
lihongbo22@...wei.com
Subject: Re: [PATCH -next] irqchip/sifive-plic: Make use of __assign_bit() API
On Mon, 02 Sep 2024 06:08:24 PDT (-0700), lihongbo22@...wei.com wrote:
> We have for some time the __assign_bit() API to replace
> open coded
> if (foo)
> __set_bit(n, bar);
> else
> __clear_bit(n, bar);
>
> Use this API to simplify the code. No functional change
> intended.
>
> Signed-off-by: Hongbo Li <lihongbo22@...wei.com>
> ---
> drivers/irqchip/irq-sifive-plic.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
> index 2f6ef5c495bd..c576b9bbeb13 100644
> --- a/drivers/irqchip/irq-sifive-plic.c
> +++ b/drivers/irqchip/irq-sifive-plic.c
> @@ -252,10 +252,8 @@ static int plic_irq_suspend(void)
> priv = per_cpu_ptr(&plic_handlers, smp_processor_id())->priv;
>
> for (i = 0; i < priv->nr_irqs; i++)
> - if (readl(priv->regs + PRIORITY_BASE + i * PRIORITY_PER_ID))
> - __set_bit(i, priv->prio_save);
> - else
> - __clear_bit(i, priv->prio_save);
> + __assign_bit(i, priv->prio_save,
> + readl(priv->regs + PRIORITY_BASE + i * PRIORITY_PER_ID));
>
> for_each_cpu(cpu, cpu_present_mask) {
> struct plic_handler *handler = per_cpu_ptr(&plic_handlers, cpu);
Reviewed-by: Palmer Dabbelt <palmer@...osinc.com>
Acked-by: Palmer Dabbelt <palmer@...osinc.com>
Powered by blists - more mailing lists