From: Daniel Thompson <daniel.thompson@linaro.org>
To: Joe Perches <joe@perches.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
linux-kernel@vger.kernel.org
Cc: Jason Wessel <jason.wessel@windriver.com>,
kgdb-bugreport@lists.sourceforge.net
Subject: Re: [PATCH] kdb: Replace strncasecmp with strcasecmp
Date: Mon, 14 Mar 2016 13:52:58 +0000 [thread overview]
Message-ID: <56E6C23A.6080808@linaro.org> (raw)
In-Reply-To: <96898f808dcd5b2770bfda1c55d7a3bfe68a5e47.1457922411.git.joe@perches.com>
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;
>
prev parent reply other threads:[~2016-03-14 13:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-14 2:27 [PATCH] kdb: Replace strncasecmp with strcasecmp Joe Perches
2016-03-14 13:52 ` Daniel Thompson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56E6C23A.6080808@linaro.org \
--to=daniel.thompson@linaro.org \
--cc=jason.wessel@windriver.com \
--cc=joe@perches.com \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox