Re: [PATCH RESEND] staging: nvec: use strcmp() instead of strncmp() with magic length

Dan Carpenter <[email protected]> Tue, 28 Jul 2026 18:29:06 +0300
Newsgroups org.kernel.vger.linux-tegra,dev.linux.lists.linux-staging
Message-ID <[email protected]>
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