Re: [PATCH] staging: sm750fb: Use str_has_prefix instead of strncmp()

From: Dan Carpenter

Date: Mon Nov 23 2026 - 02:34:00 EST


On Sat, Nov 21, 2026 at 07:08:43PM +0530, Vaibhav Chahar wrote:
> Using str_has_prefix() is cleaner and more readable than using
> strncmp() with strlen(). Also avoiding the possibility of errors due to
> mismatched string lengths.
>
> Signed-off-by: Vaibhav Chahar <vaibhav.chahar26@xxxxxxxxx>
> ---

Ah. The str_has_prefix() has been there for 8 years and I'm only
learning about it now. I like it! Much more intentional than
strncmp().

Reviewed-by: Dan Carpenter <error27@xxxxxxxxx>

regards,
dan carpenter