mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] genirq: Use AFFINITY and AFFINITY_LIST in write_irq_affinity()
@ 2021-10-28 12:51 Yunfeng Ye
  0 siblings, 0 replies; only message in thread
From: Yunfeng Ye @ 2021-10-28 12:51 UTC (permalink / raw)
  To: tglx, linux-kernel; +Cc: wuxu.wu, Hewenliang

The commit 0d3f54257dc3 ("genirq: Introduce effective affinity mask")
introduce AFFINITY and AFFINITY_LIST Enumerated Type, so use it in
write_irq_affinity().

No functional change.

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
---
 kernel/irq/proc.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index ee595ec09778..423f65203a69 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -147,10 +147,16 @@ static ssize_t write_irq_affinity(int type, struct file *file,
 	if (!zalloc_cpumask_var(&new_value, GFP_KERNEL))
 		return -ENOMEM;

-	if (type)
+	switch (type) {
+	case AFFINITY_LIST:
 		err = cpumask_parselist_user(buffer, count, new_value);
-	else
+		break;
+	case AFFINITY:
 		err = cpumask_parse_user(buffer, count, new_value);
+		break;
+	default:
+		err = -EINVAL;
+	}
 	if (err)
 		goto free_cpumask;

@@ -179,13 +185,13 @@ static ssize_t write_irq_affinity(int type, struct file *file,
 static ssize_t irq_affinity_proc_write(struct file *file,
 		const char __user *buffer, size_t count, loff_t *pos)
 {
-	return write_irq_affinity(0, file, buffer, count, pos);
+	return write_irq_affinity(AFFINITY, file, buffer, count, pos);
 }

 static ssize_t irq_affinity_list_proc_write(struct file *file,
 		const char __user *buffer, size_t count, loff_t *pos)
 {
-	return write_irq_affinity(1, file, buffer, count, pos);
+	return write_irq_affinity(AFFINITY_LIST, file, buffer, count, pos);
 }

 static int irq_affinity_proc_open(struct inode *inode, struct file *file)
-- 
2.27.0

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-28 12:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-28 12:51 [PATCH] genirq: Use AFFINITY and AFFINITY_LIST in write_irq_affinity() Yunfeng Ye

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®