From: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
To: johan.hedberg@gmail.com,
"linux-bluetooth@vger.kernel.org"
<linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH_v4] android/hal-health: Add HDP .register_application method
Date: Tue, 18 Mar 2014 14:00:42 +0200 [thread overview]
Message-ID: <5328356A.3060704@linux.intel.com> (raw)
In-Reply-To: <20140318114822.GA17578@johan-t440s.lan>
Hi Johan,
On 03/18/2014 01:48 PM, Johan Hedberg wrote:
> Hi Ravi,
>
> On Tue, Mar 18, 2014, Ravi kumar Veeramally wrote:
>> +static bool string_to_hal(const char *str, struct hal_string *hstr,
>> + ssize_t *len)
>> +{
>> + if (!hstr || !len)
>> + return false;
>> +
>> + if (!str) {
>> + hstr->len = 0;
>> + return true;
>> + }
>> +
>> + hstr->len = strlen(str) + 1;
>> + *len += hstr->len;
>> + if (*len > IPC_MTU)
>> + return false;
> Usually we design APIs so that a failure means the return parameters
> were left untouched. The way you've implemented this here the caller
> couldn't know if *len or hstr->len were modified in case false is
> returned. We should be more predictable than that. So please fix up the
> function so that it only touches the parameters if true is returned.
>
Ok, I'll fix that.
Thanks,
Ravi.
prev parent reply other threads:[~2014-03-18 12:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-18 11:22 [PATCH_v4] android/hal-health: Add HDP .register_application method Ravi kumar Veeramally
2014-03-18 11:48 ` Johan Hedberg
2014-03-18 12:00 ` Ravi kumar Veeramally [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=5328356A.3060704@linux.intel.com \
--to=ravikumar.veeramally@linux.intel.com \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.