* [PATCH] kdb: Replace strncasecmp with strcasecmp
@ 2016-03-14 2:27 Joe Perches
2016-03-14 13:52 ` Daniel Thompson
0 siblings, 1 reply; 2+ messages in thread
From: Joe Perches @ 2016-03-14 2:27 UTC (permalink / raw)
To: Rasmus Villemoes, linux-kernel; +Cc: Jason Wessel, kgdb-bugreport
Remove the unnecessary last sizeof("foo") argument to strncasecmp using
strcasecmp without that sizeof as it iss equivalent, simpler and smaller.
Signed-off-by: Joe Perches <joe@perches.com>
---
kernel/debug/kdb/kdb_bp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/debug/kdb/kdb_bp.c b/kernel/debug/kdb/kdb_bp.c
index 90ff129..4714b33 100644
--- a/kernel/debug/kdb/kdb_bp.c
+++ b/kernel/debug/kdb/kdb_bp.c
@@ -52,11 +52,11 @@ static int kdb_parsebp(int argc, const char **argv, int *nextargp, kdb_bp_t *bp)
bp->bph_length = 1;
if ((argc + 1) != nextarg) {
- if (strncasecmp(argv[nextarg], "datar", sizeof("datar")) == 0)
+ if (strcasecmp(argv[nextarg], "datar") == 0)
bp->bp_type = BP_ACCESS_WATCHPOINT;
- else if (strncasecmp(argv[nextarg], "dataw", sizeof("dataw")) == 0)
+ else if (strcasecmp(argv[nextarg], "dataw") == 0)
bp->bp_type = BP_WRITE_WATCHPOINT;
- else if (strncasecmp(argv[nextarg], "inst", sizeof("inst")) == 0)
+ else if (strcasecmp(argv[nextarg], "inst") == 0)
bp->bp_type = BP_HARDWARE_BREAKPOINT;
else
return KDB_ARGCOUNT;
--
2.6.3.368.gf34be46
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] kdb: Replace strncasecmp with strcasecmp
2016-03-14 2:27 [PATCH] kdb: Replace strncasecmp with strcasecmp Joe Perches
@ 2016-03-14 13:52 ` Daniel Thompson
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Thompson @ 2016-03-14 13:52 UTC (permalink / raw)
To: Joe Perches, Rasmus Villemoes, linux-kernel; +Cc: Jason Wessel, kgdb-bugreport
On 14/03/16 02:27, Joe Perches wrote:
> Remove the unnecessary last sizeof("foo") argument to strncasecmp using
> strcasecmp without that sizeof as it iss equivalent, simpler and smaller.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
> ---
> kernel/debug/kdb/kdb_bp.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/debug/kdb/kdb_bp.c b/kernel/debug/kdb/kdb_bp.c
> index 90ff129..4714b33 100644
> --- a/kernel/debug/kdb/kdb_bp.c
> +++ b/kernel/debug/kdb/kdb_bp.c
> @@ -52,11 +52,11 @@ static int kdb_parsebp(int argc, const char **argv, int *nextargp, kdb_bp_t *bp)
>
> bp->bph_length = 1;
> if ((argc + 1) != nextarg) {
> - if (strncasecmp(argv[nextarg], "datar", sizeof("datar")) == 0)
> + if (strcasecmp(argv[nextarg], "datar") == 0)
> bp->bp_type = BP_ACCESS_WATCHPOINT;
> - else if (strncasecmp(argv[nextarg], "dataw", sizeof("dataw")) == 0)
> + else if (strcasecmp(argv[nextarg], "dataw") == 0)
> bp->bp_type = BP_WRITE_WATCHPOINT;
> - else if (strncasecmp(argv[nextarg], "inst", sizeof("inst")) == 0)
> + else if (strcasecmp(argv[nextarg], "inst") == 0)
> bp->bp_type = BP_HARDWARE_BREAKPOINT;
> else
> return KDB_ARGCOUNT;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-14 13:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-14 2:27 [PATCH] kdb: Replace strncasecmp with strcasecmp Joe Perches
2016-03-14 13:52 ` Daniel Thompson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).