linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Wen Yaxng <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: wen.yang99@zte.com.cn, tglx@linutronix.de, hpa@zytor.com,
	linux-kernel@vger.kernel.org, mingo@kernel.org,
	jiang.biao2@zte.com.cn
Subject: [tip:irq/core] genirq/proc: Return proper error code when irq_set_affinity() fails
Date: Sun, 12 Nov 2017 14:31:13 -0800	[thread overview]
Message-ID: <tip-6714796edcce27f7a1845e2f79783cd51bb4799b@git.kernel.org> (raw)
In-Reply-To: <1510106103-184761-1-git-send-email-wen.yang99@zte.com.cn>

Commit-ID:  6714796edcce27f7a1845e2f79783cd51bb4799b
Gitweb:     https://git.kernel.org/tip/6714796edcce27f7a1845e2f79783cd51bb4799b
Author:     Wen Yaxng <wen.yang99@zte.com.cn>
AuthorDate: Wed, 8 Nov 2017 09:55:03 +0800
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Sun, 12 Nov 2017 23:25:39 +0100

genirq/proc: Return proper error code when irq_set_affinity() fails

write_irq_affinity() returns the number of written bytes, which means
success, unconditionally whether the actual irq_set_affinity() call
succeeded or not.

Add proper error handling and pass the error code returned from
irq_set_affinity() back to user space in case of failure.

[ tglx: Fixed coding style and massaged changelog ]

Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Jiang Biao <jiang.biao2@zte.com.cn>
Cc: zhong.weidong@zte.com.cn
Link: https://lkml.kernel.org/r/1510106103-184761-1-git-send-email-wen.yang99@zte.com.cn

---
 kernel/irq/proc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 6376b4a..29d6f52 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -154,8 +154,9 @@ static ssize_t write_irq_affinity(int type, struct file *file,
 		 */
 		err = irq_select_affinity_usr(irq) ? -EINVAL : count;
 	} else {
-		irq_set_affinity(irq, new_value);
-		err = count;
+		err = irq_set_affinity(irq, new_value);
+		if (!err)
+			err = count;
 	}
 
 free_cpumask:

      reply	other threads:[~2017-11-12 22:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08  1:55 [PATCH] irq/proc: throw error number when irq_set_affinity fails in write_irq_affinity() Wen Yang
2017-11-12 22:31 ` tip-bot for Wen Yaxng [this message]

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=tip-6714796edcce27f7a1845e2f79783cd51bb4799b@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=jiang.biao2@zte.com.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=wen.yang99@zte.com.cn \
    /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;
as well as URLs for NNTP newsgroup(s).