mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Vikas Shivappa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: vikas.shivappa@linux.intel.com, linux-kernel@vger.kernel.org,
	sai.praneeth.prakhya@intel.com, mingo@kernel.org,
	tglx@linutronix.de, hpa@zytor.com
Subject: [tip:x86/cpu] x86/intel_rdt: Trim whitespace while parsing schemata input
Date: Thu, 20 Apr 2017 07:04:27 -0700	[thread overview]
Message-ID: <tip-634b0e0491d6f6e882b922eb41c278d01a743bab@git.kernel.org> (raw)
In-Reply-To: <1492645804-17465-3-git-send-email-vikas.shivappa@linux.intel.com>

Commit-ID:  634b0e0491d6f6e882b922eb41c278d01a743bab
Gitweb:     http://git.kernel.org/tip/634b0e0491d6f6e882b922eb41c278d01a743bab
Author:     Vikas Shivappa <vikas.shivappa@linux.intel.com>
AuthorDate: Wed, 19 Apr 2017 16:50:03 -0700
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 20 Apr 2017 15:57:59 +0200

x86/intel_rdt: Trim whitespace while parsing schemata input

Schemata is displayed in tabular format which introduces some whitespace
to show data in a tabular format.

Writing back the same data fails as the parser does not handle the
whitespace.

Trim the leading and trailing whitespace before parsing.

Reported-by: Prakhya, Sai Praneeth <sai.praneeth.prakhya@intel.com>
Signed-off-by: Vikas Shivappa <vikas.shivappa@linux.intel.com>
Tested-by: Prakhya, Sai Praneeth <sai.praneeth.prakhya@intel.com>
Cc: fenghua.yu@intel.com
Cc: tony.luck@intel.com
Cc: ravi.v.shankar@intel.com
Cc: vikas.shivappa@intel.com
Link: http://lkml.kernel.org/r/1492645804-17465-3-git-send-email-vikas.shivappa@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/x86/kernel/cpu/intel_rdt_schemata.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/intel_rdt_schemata.c b/arch/x86/kernel/cpu/intel_rdt_schemata.c
index 9467a00..e64b2cf 100644
--- a/arch/x86/kernel/cpu/intel_rdt_schemata.c
+++ b/arch/x86/kernel/cpu/intel_rdt_schemata.c
@@ -141,6 +141,7 @@ next:
 	id = strsep(&dom, "=");
 	if (!dom || kstrtoul(id, 10, &dom_id))
 		return -EINVAL;
+	dom = strim(dom);
 	list_for_each_entry(d, &r->domains, list) {
 		if (d->id == dom_id) {
 			if (r->parse_ctrlval(dom, r, d))
@@ -214,7 +215,7 @@ ssize_t rdtgroup_schemata_write(struct kernfs_open_file *of,
 			dom->have_new_ctrl = false;
 
 	while ((tok = strsep(&buf, "\n")) != NULL) {
-		resname = strsep(&tok, ":");
+		resname = strim(strsep(&tok, ":"));
 		if (!tok) {
 			ret = -EINVAL;
 			goto out;

  parent reply	other threads:[~2017-04-20 14:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19 23:50 [PATCH 0/3] x86/intel_rdt: Fixes for schemata parsing issues Vikas Shivappa
2017-04-19 23:50 ` [PATCH 1/3] x86/intel_rdt: Fix padding when resource is enabled via mount Vikas Shivappa
2017-04-20 14:03   ` [tip:x86/cpu] " tip-bot for Vikas Shivappa
2017-04-19 23:50 ` [PATCH 2/3] x86/intel_rdt: Trim whitespace while parsing schemata input Vikas Shivappa
2017-04-20 13:51   ` Thomas Gleixner
2017-04-20 17:51     ` Shivappa Vikas
2017-04-20 17:52       ` Thomas Gleixner
2017-04-20 21:19         ` Shivappa Vikas
2017-04-20 14:04   ` tip-bot for Vikas Shivappa [this message]
2017-04-19 23:50 ` [PATCH 3/3] x86/intel_rdt: Return error for incorrect resource names in schemata Vikas Shivappa
2017-04-20 13:44   ` Thomas Gleixner
2017-04-20 18:57     ` Shivappa Vikas
2017-04-20 14:04   ` [tip:x86/cpu] " tip-bot for Vikas Shivappa

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-634b0e0491d6f6e882b922eb41c278d01a743bab@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=sai.praneeth.prakhya@intel.com \
    --cc=tglx@linutronix.de \
    --cc=vikas.shivappa@linux.intel.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

Powered by JetHome