greybus: get rid of gbuf->actual_length
Right now, the actual_length field of a gbuf is only ever assigned, never used. We now fill gbufs only with operation messages, and they encode within them the amount of space "actually used" in a buffer in a request-specific way. As a result, there's no need for the gbuf->actual_length field, so we can remove it. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
parent
7a0eed065d
commit
c69a50f2ce
|
@ -130,7 +130,6 @@ struct gbuf {
|
|||
int status;
|
||||
void *transfer_buffer;
|
||||
u32 transfer_buffer_length;
|
||||
u32 actual_length;
|
||||
|
||||
bool outbound; /* AP-relative data direction */
|
||||
|
||||
|
|
|
@ -351,8 +351,6 @@ struct gb_operation *gb_operation_create(struct gb_connection *connection,
|
|||
goto err_cache;
|
||||
operation->request_payload = operation->request->transfer_buffer +
|
||||
sizeof(struct gb_operation_msg_hdr);
|
||||
/* We always use the full request buffer */
|
||||
operation->request->actual_length = request_size;
|
||||
|
||||
if (outgoing) {
|
||||
type |= GB_OPERATION_TYPE_RESPONSE;
|
||||
|
@ -443,9 +441,6 @@ int gb_operation_request_send(struct gb_operation *operation,
|
|||
*/
|
||||
int gb_operation_response_send(struct gb_operation *operation)
|
||||
{
|
||||
/* XXX
|
||||
* Caller needs to have set operation->response->actual_length
|
||||
*/
|
||||
gb_operation_remove(operation);
|
||||
gb_operation_destroy(operation);
|
||||
|
||||
|
@ -502,7 +497,6 @@ void gb_connection_operation_recv(struct gb_connection *connection,
|
|||
}
|
||||
|
||||
memcpy(gbuf->transfer_buffer, data, msg_size);
|
||||
gbuf->actual_length = msg_size;
|
||||
|
||||
/* The rest will be handled in work queue context */
|
||||
queue_work(gb_operation_recv_workqueue, &operation->recv_work);
|
||||
|
|
Loading…
Reference in New Issue