From: Szymon Janc <szymon.janc@tieto.com>
To: Lukasz Rymanowski <lukasz.rymanowski@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/2] shared/hfp: Remove reduntant check
Date: Thu, 30 Oct 2014 10:56:22 +0100 [thread overview]
Message-ID: <5280356.hO7J17kob9@leonov> (raw)
In-Reply-To: <1414624583-29236-1-git-send-email-lukasz.rymanowski@tieto.com>
Hi Łukasz,
On Thursday 30 of October 2014 00:16:22 Lukasz Rymanowski wrote:
> This check is not needed. Below memcmp check is sufficient
> ---
> src/shared/hfp.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/src/shared/hfp.c b/src/shared/hfp.c
> index 22e9622..f5a812d 100644
> --- a/src/shared/hfp.c
> +++ b/src/shared/hfp.c
> @@ -135,9 +135,6 @@ 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)))
> return false;
So, why not just use strcmp here instead?
--
BR
Szymon Janc
next prev parent reply other threads:[~2014-10-30 9:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-29 23:16 [PATCH 1/2] shared/hfp: Remove reduntant check Lukasz Rymanowski
2014-10-29 23:16 ` [PATCH 2/2] shared/hfp: Fix for invalid string copy Lukasz Rymanowski
2014-10-31 19:23 ` Szymon Janc
2014-10-30 9:56 ` Szymon Janc [this message]
2014-10-30 10:11 ` [PATCH 1/2] shared/hfp: Remove reduntant check Marcin Kraglak
2014-10-30 15:09 ` Lukasz Rymanowski
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=5280356.hO7J17kob9@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