Re: [PATCH v4 4/8] printk: Replace strncmp with str_has_prefix
From: Sergey Senozhatsky
Date: Thu Aug 15 2019 - 03:50:38 EST
On (08/14/19 12:49), Petr Mladek wrote:
> On Fri 2019-08-09 15:10:34, Chuhong Yuan wrote:
> > strncmp(str, const, len) is error-prone because len
> > is easy to have typo.
> > The example is the hard-coded len has counting error
> > or sizeof(const) forgets - 1.
> > So we prefer using newly introduced str_has_prefix()
> > to substitute such strncmp to make code better.
> >
> > Signed-off-by: Chuhong Yuan <hslester96@xxxxxxxxx>
>
> Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx>
-ss