Re: [PATCH 08/12] printk: Replace strncmp with str_has_prefix

2019-08-01 Thread Joe Perches
On Thu, 2019-08-01 at 23:23 +0800, Chuhong Yuan wrote: > Joe Perches 于2019年7月30日周二 上午8:16写道: > > On Mon, 2019-07-29 at 23:15 +0800, Chuhong Yuan wrote: > > > strncmp(str, const, len) is error-prone. > > > We had better use newly introduced > > > str_has_prefix() instead of it. > > [] > > > diff

Re: [PATCH 08/12] printk: Replace strncmp with str_has_prefix

2019-08-01 Thread Steven Rostedt
On Thu, 01 Aug 2019 09:19:04 -0700 Joe Perches wrote: > > I find that checkpatch.pl forbids assignment in if condition. > > So this seems to be infeasible... > > checkpatch is a stupid script and doesn't forbid > anything. It's just a suggestion guide. > > Ignore checkpatch when you know

Re: [PATCH 08/12] printk: Replace strncmp with str_has_prefix

2019-08-01 Thread Joe Perches
On Thu, 2019-08-01 at 23:23 +0800, Chuhong Yuan wrote: > Joe Perches 于2019年7月30日周二 上午8:16写道: > > On Mon, 2019-07-29 at 23:15 +0800, Chuhong Yuan wrote: > > > strncmp(str, const, len) is error-prone. > > > We had better use newly introduced > > > str_has_prefix() instead of it. > > [] > > > diff

Re: [PATCH 08/12] printk: Replace strncmp with str_has_prefix

2019-08-01 Thread Chuhong Yuan
Joe Perches 于2019年7月30日周二 上午8:16写道: > > On Mon, 2019-07-29 at 23:15 +0800, Chuhong Yuan wrote: > > strncmp(str, const, len) is error-prone. > > We had better use newly introduced > > str_has_prefix() instead of it. > [] > > diff --git a/kernel/printk/braille.c b/kernel/printk/braille.c > [] > >

Re: [PATCH 08/12] printk: Replace strncmp with str_has_prefix

2019-07-29 Thread Joe Perches
On Mon, 2019-07-29 at 23:15 +0800, Chuhong Yuan wrote: > strncmp(str, const, len) is error-prone. > We had better use newly introduced > str_has_prefix() instead of it. [] > diff --git a/kernel/printk/braille.c b/kernel/printk/braille.c [] > @@ -11,10 +11,10 @@ > > int

[PATCH 08/12] printk: Replace strncmp with str_has_prefix

2019-07-29 Thread Chuhong Yuan
strncmp(str, const, len) is error-prone. We had better use newly introduced str_has_prefix() instead of it. Signed-off-by: Chuhong Yuan --- kernel/printk/braille.c | 4 ++-- kernel/printk/printk.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git