[<prev] [next>] [day] [month] [year] [list]
Message-ID: <3edf17ad-e784-f541-1b49-3c95a982d6b5@huawei.com>
Date: Thu, 28 Oct 2021 20:51:37 +0800
From: Yunfeng Ye <yeyunfeng@...wei.com>
To: <tglx@...utronix.de>, <linux-kernel@...r.kernel.org>
CC: <wuxu.wu@...wei.com>, Hewenliang <hewenliang4@...wei.com>
Subject: [PATCH] genirq: Use AFFINITY and AFFINITY_LIST in
write_irq_affinity()
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@...wei.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
Powered by blists - more mailing lists