linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: Lukasz Rymanowski <lukasz.rymanowski@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v2 1/2] shared/hfp: Remove reduntant check
Date: Fri, 31 Oct 2014 20:13:56 +0100	[thread overview]
Message-ID: <2055148.4gy5d5hbTD@leonov> (raw)
In-Reply-To: <1414747952-22446-1-git-send-email-lukasz.rymanowski@tieto.com>

Hi Łukasz,

On Friday 31 of October 2014 10:32:32 Lukasz Rymanowski wrote:
> To make this check strcmp is good enought. Not need to check len first
> and then do memory compare.
> ---
>  src/shared/hfp.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/src/shared/hfp.c b/src/shared/hfp.c
> index 9a66ed2..0ce38cc 100644
> --- a/src/shared/hfp.c
> +++ b/src/shared/hfp.c
> @@ -135,10 +135,7 @@ static bool match_handler_prefix(const void *a, const
> void *b) const struct cmd_handler *handler = a;
>  	const char *prefix = b;
> 
> -	if (strlen(handler->prefix) != strlen(prefix))
> -		return false;
> -
> -	if (memcmp(handler->prefix, prefix, strlen(prefix)))
> +	if (strcmp(handler->prefix, prefix) != 0)
>  		return false;
> 
>  	return true;

Applied (with typos in commit message fixed), thanks.

-- 
BR
Szymon Janc

      reply	other threads:[~2014-10-31 19:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31  9:32 [PATCH v2 1/2] shared/hfp: Remove reduntant check Lukasz Rymanowski
2014-10-31 19:13 ` Szymon Janc [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=2055148.4gy5d5hbTD@leonov \
    --to=szymon.janc@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=lukasz.rymanowski@tieto.com \
    /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).