linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	linux-kernel@vger.kernel.org
Cc: Jason Wessel <jason.wessel@windriver.com>,
	kgdb-bugreport@lists.sourceforge.net
Subject: [PATCH] kdb: Replace strncasecmp with strcasecmp
Date: Sun, 13 Mar 2016 19:27:58 -0700	[thread overview]
Message-ID: <96898f808dcd5b2770bfda1c55d7a3bfe68a5e47.1457922411.git.joe@perches.com> (raw)

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

             reply	other threads:[~2016-03-14  2:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-14  2:27 Joe Perches [this message]
2016-03-14 13:52 ` [PATCH] kdb: Replace strncasecmp with strcasecmp Daniel Thompson

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=96898f808dcd5b2770bfda1c55d7a3bfe68a5e47.1457922411.git.joe@perches.com \
    --to=joe@perches.com \
    --cc=jason.wessel@windriver.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;
as well as URLs for NNTP newsgroup(s).