[PATCH v4 0/8] Replace strncmp with str_has_prefix

2019-08-09 Thread Chuhong Yuan
return value of str_has_prefix() to eliminate hard coding. - Remove possible false positives and add newly detected one in upstream. v2 -> v3: - Revise the description. - Remove else uses in printk.c. v3 -> v4: - Eliminate assignments in if conditions. Chuhong Yuan (8):

[PATCH v4 1/8] dma: debug: Replace strncmp with str_has_prefix

2019-08-09 Thread Chuhong Yuan
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

[PATCH v3 1/8] dma: debug: Replace strncmp with str_has_prefix

2019-08-05 Thread Chuhong Yuan
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

[PATCH v3 0/8] Replace strncmp with str_has_prefix

2019-08-05 Thread Chuhong Yuan
return value of str_has_prefix() to eliminate hard coding. - Remove possible false positives and add newly detected one in upstream. v2 -> v3: - Revise the description. - Remove else uses in printk.c. Chuhong Yuan (8): dma: debug: Replace strncmp with str_has_prefix module:

[PATCH v2 00/10] Replace strncmp with str_has_prefix

2019-08-01 Thread Chuhong Yuan
return value of str_has_prefix() to eliminate hard coding. - Remove possible false positives and add newly detected one in upstream. Chuhong Yuan (10): dma: debug: Replace strncmp with str_has_prefix gcov: Replace strncmp with str_has_prefix locking/locktorture: Replace

[PATCH v2 01/10] dma: debug: Replace strncmp with str_has_prefix

2019-08-01 Thread Chuhong Yuan
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. Signed-off-by: Chuhong Yuan --- Changes in v2: - Revise

[PATCH 00/12] Replace strncmp with str_has_prefix

2019-07-29 Thread Chuhong Yuan
s use str_has_prefix to replace such pattern of strncmp usages. Chuhong Yuan (12): rdmacg: Replace strncmp with str_has_prefix kdb: Replace strncmp with str_has_prefix dma-debug: Replace strncmp with str_has_prefix gcov: Replace strncmp with str_has_prefix genirq/debugfs: Replace strncmp

[PATCH 03/12] dma-debug: 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/dma/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index 099002d84f46