From: Johan Hedberg <johan.hedberg@gmail.com>
To: Alex Deymo <deymo@chromium.org>
Cc: linux-bluetooth@vger.kernel.org, marcel@holtmann.org,
keybuk@chromium.org
Subject: Re: [PATCH v3 4/8] core: retry bonding attempt until the iterator reaches the end.
Date: Wed, 24 Apr 2013 14:32:09 +0300 [thread overview]
Message-ID: <20130424113209.GC15231@x220.ger.corp.intel.com> (raw)
In-Reply-To: <1366740247-368-5-git-send-email-deymo@chromium.org>
Hi Alex,
On Tue, Apr 23, 2013, Alex Deymo wrote:
> +static void bonding_attempt_complete(struct btd_adapter *adapter,
> + const bdaddr_t *bdaddr,
> + uint8_t addr_type, uint8_t status)
> +{
> + int err = 0;
> + struct btd_device *device;
> + char addr[18];
> +
> + ba2str(bdaddr, addr);
> + DBG("hci%u bdaddr %s type %u status 0x%x", adapter->dev_id, addr,
> + addr_type, status);
> +
> + if (status == 0)
> + device = adapter_get_device(adapter, bdaddr, addr_type);
> + else
> + device = adapter_find_device(adapter, bdaddr);
> +
> + if (status == MGMT_STATUS_AUTH_FAILED) {
> +
> + /* On faliure, issue a bonding_retry if possible. */
Remove the empty line before this comment.
> + if (device != NULL) {
> + err = device_bonding_attempt_retry(device);
> + if (err == 0)
> + return;
> + }
This seems to be the only place where err is used inside the function.
Typically you should define variables in the most restrictive scope
possible, but in this case since you're not doing anything special with
it you could just remove it and directly test for the return value of
device_bonding_attempt_retry().
Johan
next prev parent reply other threads:[~2013-04-24 11:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-23 18:03 [PATCH v3 0/8] Autopair plugin Alex Deymo
2013-04-23 18:04 ` [PATCH v3 1/8] core: Convert the pincode callback to an interable list Alex Deymo
2013-04-24 11:24 ` Johan Hedberg
2013-04-24 11:42 ` Johan Hedberg
2013-04-23 18:04 ` [PATCH v3 2/8] plugins: Extend the pin code callback with the call number Alex Deymo
2013-04-23 18:04 ` [PATCH v3 3/8] core: Add support for retrying a bonding Alex Deymo
2013-04-24 11:29 ` Johan Hedberg
2013-04-23 18:04 ` [PATCH v3 4/8] core: retry bonding attempt until the iterator reaches the end Alex Deymo
2013-04-24 11:32 ` Johan Hedberg [this message]
2013-04-23 18:04 ` [PATCH v3 5/8] core: Add device_get_class to the public interface Alex Deymo
2013-04-23 18:04 ` [PATCH v3 6/8] autopair: Add the autopair plugin Alex Deymo
2013-04-23 18:04 ` [PATCH v3 7/8] core: Expose the last bonding attempt timeout on retry Alex Deymo
2013-04-24 11:37 ` Johan Hedberg
2013-04-24 14:03 ` Marcel Holtmann
2013-04-23 18:04 ` [PATCH v3 8/8] autopair: Try a fixed pincode for keyboards rejecting random codes Alex Deymo
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=20130424113209.GC15231@x220.ger.corp.intel.com \
--to=johan.hedberg@gmail.com \
--cc=deymo@chromium.org \
--cc=keybuk@chromium.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox