Messages in this thread | | | Date | Tue, 30 Jul 2019 11:17:57 +0200 (CEST) | From | Thomas Gleixner <> | Subject | Re: [PATCH 05/12] genirq/debugfs: Replace strncmp with str_has_prefix |
| |
On Mon, 29 Jul 2019, Chuhong Yuan wrote:
> strncmp(str, const, len) is error-prone. > We had better use newly introduced > str_has_prefix() instead of it.
Can you please provide a proper explanation why the below strncmp() is error prone?
Just running a script and copying some boiler plate changelog saying 'strncmp() is error prone' does not cut it.
> - if (!strncmp(buf, "trigger", size)) { > + if (str_has_prefix(buf, "trigger")) {
Especially when the resulting code is not equivalent.
Thanks,
tglx
| |