From: Dan Carpenter <error27@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Artem Lytkin <iprintercanon@gmail.com>,
linux-staging@lists.linux.dev, marvin24@gmx.de,
linux-tegra@vger.kernel.org
Subject: Re: [PATCH RESEND] staging: nvec: use strcmp() instead of strncmp() with magic length
Date: Tue, 28 Jul 2026 18:29:06 +0300 [thread overview]
Message-ID: <amjKwgaQc0sM4UW8@stanley.mountain> (raw)
In-Reply-To: <2026072836-swerve-splotchy-bf8d@gregkh>
On Tue, Jul 28, 2026 at 09:09:23AM +0200, Greg KH wrote:
> On Thu, Jul 23, 2026 at 07:18:23PM +0300, Artem Lytkin wrote:
> > Replace strncmp() with a hardcoded length of 30 with strcmp().
>
> I thought we were trying to get rid of strcmp() usage? Why add it
> back?
I don't think we're trying to get rid of strcmp().
strncmp() is for prefixes and and strcmp() is for whole words.
They're not the same. strncmp() with a fixed string always
seemed like nonsense to me and it causes a static checker in
unpublished Smatch checks because we've seen that bug where
people wanted to check the prefix but used the wrong number of
characters.
regards,
dan carpenter
next prev parent reply other threads:[~2026-07-28 15:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 16:18 [PATCH RESEND] staging: nvec: use strcmp() instead of strncmp() with magic length Artem Lytkin
2026-07-27 15:58 ` Thierry Reding
2026-07-28 7:09 ` Greg KH
2026-07-28 15:29 ` Dan Carpenter [this message]
2026-07-29 10:15 ` Thierry Reding
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=amjKwgaQc0sM4UW8@stanley.mountain \
--to=error27@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=iprintercanon@gmail.com \
--cc=linux-staging@lists.linux.dev \
--cc=linux-tegra@vger.kernel.org \
--cc=marvin24@gmx.de \
/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.