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: <172788381757.1442.12089508423665995021.tip-bot2@tip-bot2>
Date: Wed, 02 Oct 2024 15:43:37 -0000
From: "tip-bot2 for Hongbo Li" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Hongbo Li <lihongbo22@...wei.com>, Thomas Gleixner <tglx@...utronix.de>,
 Palmer Dabbelt <palmer@...osinc.com>, x86@...nel.org,
 linux-kernel@...r.kernel.org, maz@...nel.org
Subject: [tip: irq/core] irqchip/sifive-plic: Make use of __assign_bit()

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     40d7af5375a4e27d8576d9d11954ac213d06f09e
Gitweb:        https://git.kernel.org/tip/40d7af5375a4e27d8576d9d11954ac213d06f09e
Author:        Hongbo Li <lihongbo22@...wei.com>
AuthorDate:    Mon, 02 Sep 2024 21:08:24 +08:00
Committer:     Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Wed, 02 Oct 2024 15:39:39 +02:00

irqchip/sifive-plic: Make use of __assign_bit()

Replace the open coded

if (foo)
        __set_bit(n, bar);
    else
        __clear_bit(n, bar);

with __assign_bit(). No functional change intended.

Signed-off-by: Hongbo Li <lihongbo22@...wei.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Palmer Dabbelt <palmer@...osinc.com>
Link: https://lore.kernel.org/all/20240902130824.2878644-1-lihongbo22@huawei.com

---
 drivers/irqchip/irq-sifive-plic.c |  9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
index 2f6ef5c..a3b199d 100644
--- a/drivers/irqchip/irq-sifive-plic.c
+++ b/drivers/irqchip/irq-sifive-plic.c
@@ -251,11 +251,10 @@ 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);
+	for (i = 0; i < priv->nr_irqs; i++) {
+		__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);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ