Re: [PATCH BlueZ 2/3 v2] AVRCP: Subscribe for VolumeChanged Notification

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

 



Hi Luiz,

I think the following loop can be simplified a bit:

> +	for (l = session->handlers; l; l = l->next) {
> +		struct avctp_rsp_handler *handler = l->data;
> +
> +		if (handler->id == avctp->transaction) {

Avoid unnecessary indentation by using != and continue;

> +			gboolean ret = FALSE;
> +
> +			if (handler->func)
> +				ret = handler->func(session, avc->code,
> +						avc->subunit_type,
> +						operands, operand_count,
> +						handler->user_data);
> +
> +			if (ret)
> +				return;

Once you've reduced the indentation by the above trick you could even
just do:

	if (handler->func && handler->func(...))
		return;

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