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-next>] [day] [month] [year] [list]
Message-ID: <20220827011351.9185-1-xuqiang36@huawei.com>
Date:   Sat, 27 Aug 2022 01:13:49 +0000
From:   Xu Qiang <xuqiang36@...wei.com>
To:     <tglx@...utronix.de>, <frederic@...nel.org>,
        <peterz@...radead.org>, <nitesh@...hat.com>,
        <bigeasy@...utronix.de>, <douliyangs@...il.com>, <maz@...nel.org>
CC:     <linux-kernel@...r.kernel.org>, <guohanjun@...wei.com>,
        <weiyongjun1@...wei.com>, <xuqiang36@...wei.com>
Subject: [PATCH -next 1/3] genirq/affinity: replace managed with is_managed in irq_affinity_desc

This submission is based on the following two considerations:

1. The definition of is_managed field is misleading to assume
   that it only uses 1 bit of memory, which is not the case;
2. from the actual use of is_managed, it should be a Boolean type;

Fixes: c410abbbacb9 (“genirq/affinity: Add is_managed to struct irq_affinity_desc”)
Signed-off-by: Xu Qiang <xuqiang36@...wei.com>
---
 include/linux/interrupt.h | 4 ++--
 kernel/irq/affinity.c     | 2 +-
 kernel/irq/irqdesc.c      | 2 +-
 kernel/irq/manage.c       | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index a92bce40b04b..9fb36545c8b2 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -294,11 +294,11 @@ struct irq_affinity {
 /**
  * struct irq_affinity_desc - Interrupt affinity descriptor
  * @mask:	cpumask to hold the affinity assignment
- * @is_managed: 1 if the interrupt is managed internally
+ * @managed:	true if the interrupt is managed internally
  */
 struct irq_affinity_desc {
 	struct cpumask	mask;
-	unsigned int	is_managed : 1;
+	bool		managed;
 };
 
 #if defined(CONFIG_SMP)
diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c
index d9a5c1d65a79..2a9fef1713df 100644
--- a/kernel/irq/affinity.c
+++ b/kernel/irq/affinity.c
@@ -483,7 +483,7 @@ irq_create_affinity_masks(unsigned int nvecs, struct irq_affinity *affd)
 
 	/* Mark the managed interrupts */
 	for (i = affd->pre_vectors; i < nvecs - affd->post_vectors; i++)
-		masks[i].is_managed = 1;
+		masks[i].managed = true;
 
 	return masks;
 }
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 5db0230aa6b5..8388b821e58b 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -486,7 +486,7 @@ static int alloc_descs(unsigned int start, unsigned int cnt, int node,
 		unsigned int flags = 0;
 
 		if (affinity) {
-			if (affinity->is_managed) {
+			if (affinity->managed) {
 				flags = IRQD_AFFINITY_MANAGED |
 					IRQD_MANAGED_SHUTDOWN;
 			}
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 40fe7806cc8c..c3423f552e0b 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -431,7 +431,7 @@ int irq_update_affinity_desc(unsigned int irq,
 	if (activated)
 		irq_domain_deactivate_irq(&desc->irq_data);
 
-	if (affinity->is_managed) {
+	if (affinity->managed) {
 		irqd_set(&desc->irq_data, IRQD_AFFINITY_MANAGED);
 		irqd_set(&desc->irq_data, IRQD_MANAGED_SHUTDOWN);
 	}
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ