All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Travis <mike.travis@hpe.com>
To: Borislav Petkov <bp@alien8.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Steve Wahl <steve.wahl@hpe.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org
Cc: Mike Travis <mike.travis@hpe.com>,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Russ Anderson <russ.anderson@hpe.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] x86/platform/uv: Remove spaces from OEM IDs
Date: Thu,  5 Nov 2020 16:27:40 -0600	[thread overview]
Message-ID: <20201105222741.157029-3-mike.travis@hpe.com> (raw)
In-Reply-To: <20201105222741.157029-1-mike.travis@hpe.com>

Testing shows that trailing spaces caused problems with the OEM_ID and
the OEM_TABLE_ID.  One being that the OEM_ID would not string compare
correctly.  Another the OEM_ID and OEM_TABLE_ID would be concatenated
in the printout.  Remove any trailing spaces.

Fixes: 1e61f5a95f191 ("Add and decode Arch Type in UVsystab")

Signed-off-by: Mike Travis <mike.travis@hpe.com>
---
 arch/x86/kernel/apic/x2apic_uv_x.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index a5794794ea59..0f848d6dddc9 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -290,6 +290,9 @@ static void __init uv_stringify(int len, char *to, char *from)
 {
 	/* Relies on 'to' being NULL chars so result will be NULL terminated */
 	strncpy(to, from, len-1);
+
+	/* Trim trailing spaces */
+	(void)strim(to);
 }
 
 /* Find UV arch type entry in UVsystab */
-- 
2.21.0


  parent reply	other threads:[~2020-11-05 22:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 22:27 [PATCH 0/3] x86/platform/uv: UV5 Update Fixes Mike Travis
2020-11-05 22:27 ` [PATCH 1/3] x86/platform/uv: Fix missing OEM_TABLE_ID Mike Travis
2020-11-07 10:18   ` [tip: x86/urgent] " tip-bot2 for Mike Travis
2020-11-05 22:27 ` Mike Travis [this message]
2020-11-07 10:18   ` [tip: x86/urgent] x86/platform/uv: Remove spaces from OEM IDs tip-bot2 for Mike Travis
2020-11-05 22:27 ` [PATCH 3/3] x86/platform/uv: Recognize UV5 hubless system identifier Mike Travis
2020-11-07 10:18   ` [tip: x86/urgent] " tip-bot2 for Mike Travis

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=20201105222741.157029-3-mike.travis@hpe.com \
    --to=mike.travis@hpe.com \
    --cc=bp@alien8.de \
    --cc=dimitri.sivanich@hpe.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=russ.anderson@hpe.com \
    --cc=steve.wahl@hpe.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.