From c69a50f2ce2eaec8ee9f50081a88589d1231ef3b Mon Sep 17 00:00:00 2001 From: Alex Elder Date: Thu, 6 Nov 2014 07:01:01 -0600 Subject: [PATCH] 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/greybus.h | 1 - drivers/staging/greybus/operation.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h index 834cbaa6fade..175bd00381c7 100644 --- a/drivers/staging/greybus/greybus.h +++ b/drivers/staging/greybus/greybus.h @@ -130,7 +130,6 @@ struct gbuf { int status; void *transfer_buffer; u32 transfer_buffer_length; - u32 actual_length; bool outbound; /* AP-relative data direction */ diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c index 24707f67622c..720cc76f629c 100644 --- a/drivers/staging/greybus/operation.c +++ b/drivers/staging/greybus/operation.c @@ -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); -- 2.39.2