[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190829123450.GP2332@hirez.programming.kicks-ass.net>
Date: Thu, 29 Aug 2019 14:34:50 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Chuhong Yuan <hslester96@...il.com>
Cc: Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 6/8] sched: Replace strncmp with str_has_prefix
On Fri, Aug 09, 2019 at 03:10:51PM +0800, Chuhong Yuan wrote:
> strncmp(str, const, len) is error-prone because len
> is easy to have typo.
I'm thinking that is exactly the easy case for compilers/semantic
checkers to verify. Now granted, GCC doesn't seem to do that by itself,
but still.
I'd buy your argument if the prefix is variable, because in that case
you can do prefix matching cheaper than strlen+strncmp, but as is, not
really.
Powered by blists - more mailing lists