Re: [PATCH v2 04/10] emulator: Add handling inquiry number of responses

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

 



Hi Lukasz,

On Mon, Mar 10, 2014, Lukasz Rymanowski wrote:
> @@ -769,17 +772,22 @@ static bool inquiry_callback(void *user_data)
>  		}
>  	}
>  
> -	if (i == MAX_BTDEV_ENTRIES) {
> -		struct bt_hci_evt_inquiry_complete ic;
> -
> -		ic.status = BT_HCI_ERR_SUCCESS;
> -		send_event(btdev, BT_HCI_EVT_INQUIRY_COMPLETE, &ic, sizeof(ic));
> +	/* Check if we sent already required amount of responses*/
> +	if (data->num_resp && data->sent_count == data->num_resp)
> +		goto finish;
>  
> -		btdev->inquiry_id = 0;
> -		return false;
> -	}
> +	if (i == MAX_BTDEV_ENTRIES)
> +		goto finish;
>  
>  	return true;
> +
> +finish:
> +	/* Note that destroy will be called */
> +	ic.status = BT_HCI_ERR_SUCCESS;
> +	send_event(btdev, BT_HCI_EVT_INQUIRY_COMPLETE, &ic, sizeof(ic));
> +
> +	btdev->inquiry_id = 0;
> +	return false;
>  }

I know you're just moving it around from the first patch but isn't the
btdev->inquiry_id = unnecessary here since you're doing the same in the
destroy function which gets called as soon as you return false?

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