>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