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):
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
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
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:
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
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
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
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