RE: [PATCH v4 2/6] Sim Access Profile Server

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

 



>Use shorter define names (since they really are quite long), 
>move the checks into separate functions, e.g. 
>validate_set_transport_protocol_req(),
>or redo the if-statement to something like:
>
>	if (msg->nparam != 0x01)
>		return -EBADMSG;
>	if (msg->param->id != SAP_PARAM_ID_TRANSPORT_PROTOCOL)
>		return -EBADMSG;
>	if (ntohs(msg->param->len) != 
>SAP_PARAM_ID_TRANSPORT_PROTOCOL_LEN)
>		return -EBADMSG;
>        ...
>	return 0;
>
>It becomes much easier for a human to parse it that way since 
>you get to process the individual conditions clearly one at a time.
>

Thanks.  I will rearrange if-statements now. I agree, however, defines are to long and will change it in a separate patch not to introduce a mess. The defines are used in already upstream code.
Will send v5 in a while.

Waldek


--
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