Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965041AbcCNNxE (ORCPT ); Mon, 14 Mar 2016 09:53:04 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:38637 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964973AbcCNNxB (ORCPT ); Mon, 14 Mar 2016 09:53:01 -0400 Subject: Re: [PATCH] kdb: Replace strncasecmp with strcasecmp To: Joe Perches , Rasmus Villemoes , linux-kernel@vger.kernel.org References: <96898f808dcd5b2770bfda1c55d7a3bfe68a5e47.1457922411.git.joe@perches.com> Cc: Jason Wessel , kgdb-bugreport@lists.sourceforge.net From: Daniel Thompson Message-ID: <56E6C23A.6080808@linaro.org> Date: Mon, 14 Mar 2016 13:52:58 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <96898f808dcd5b2770bfda1c55d7a3bfe68a5e47.1457922411.git.joe@perches.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1274 Lines: 33 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 Reviewed-by: Daniel Thompson > --- > 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; >