mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thorsten Blum <thorsten.blum@linux.dev>
To: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/mtrr: Remove unnecessary strlen() in mtrr_write()
Date: Tue, 25 Feb 2025 20:17:33 +0100	[thread overview]
Message-ID: <35EF1145-7214-4B51-8168-4D54028BE0E5@linux.dev> (raw)
In-Reply-To: <Z73HDk9p2P_Zigu2@gmail.com>

On 25. Feb 2025, at 14:35, Ingo Molnar wrote:
> * Thorsten Blum <thorsten.blum@linux.dev> wrote:
> 
>> The local variable length already holds the string length after calling
>> strncpy_from_user(). Using another local variable linlen and calling
>> strlen() is therefore unnecessary and can be removed. Remove linlen
>> and strlen() and use length instead.
>> 
>> Compile-tested only.
>> 
>> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
>> ---
> 
> I see no corner-case analysis in the changelog about what may happen if 
> the copy fails partially.

Hi Ingo,

I'm not sure what you mean. Why would I describe something I didn't
change? This patch only removes an unnecessary string (line) length
calculation and shouldn't affect the logic in any way.

If strncpy_from_user() fails, we immediately return length from
mtrr_write(), but my patch doesn't change this - unless I'm missing
something?

Thanks,
Thorsten


  reply	other threads:[~2025-02-25 19:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25 13:16 Thorsten Blum
2025-02-25 13:35 ` Ingo Molnar
2025-02-25 19:17   ` Thorsten Blum [this message]
2025-02-25 19:50     ` Ingo Molnar
2025-02-25 20:00 ` [tip: x86/mm] " tip-bot2 for Thorsten Blum

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=35EF1145-7214-4B51-8168-4D54028BE0E5@linux.dev \
    --to=thorsten.blum@linux.dev \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome