mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yunfeng Ye <yeyunfeng@huawei.com>
To: <tglx@linutronix.de>, <linux-kernel@vger.kernel.org>
Cc: <wuxu.wu@huawei.com>, Hewenliang <hewenliang4@huawei.com>
Subject: [PATCH] genirq: Use AFFINITY and AFFINITY_LIST in write_irq_affinity()
Date: Thu, 28 Oct 2021 20:51:37 +0800	[thread overview]
Message-ID: <3edf17ad-e784-f541-1b49-3c95a982d6b5@huawei.com> (raw)

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

                 reply	other threads:[~2021-10-28 12:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3edf17ad-e784-f541-1b49-3c95a982d6b5@huawei.com \
    --to=yeyunfeng@huawei.com \
    --cc=hewenliang4@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=wuxu.wu@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®