Re: [PATCH v3 4/8] core: retry bonding attempt until the iterator reaches the end.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux