Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1357245

Re: [PATCH] kdb: Replace strncasecmp with strcasecmp

From Daniel Thompson <daniel.thompson@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH] kdb: Replace strncasecmp with strcasecmp
Date 2016-03-14 15:00 +0100
Message-ID <rcBcm-4sZ-3@gated-at.bofh.it> (permalink)
References <rcqqC-5Q0-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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;
>

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] kdb: Replace strncasecmp with strcasecmp Joe Perches <joe@perches.com> - 2016-03-14 03:30 +0100
  Re: [PATCH] kdb: Replace strncasecmp with strcasecmp Daniel Thompson <daniel.thompson@linaro.org> - 2016-03-14 15:00 +0100

csiph-web