Commit c69a50f2 authored by Alex Elder's avatar Alex Elder Committed by Greg Kroah-Hartman

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: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 7a0eed06
...@@ -130,7 +130,6 @@ struct gbuf { ...@@ -130,7 +130,6 @@ struct gbuf {
int status; int status;
void *transfer_buffer; void *transfer_buffer;
u32 transfer_buffer_length; u32 transfer_buffer_length;
u32 actual_length;
bool outbound; /* AP-relative data direction */ bool outbound; /* AP-relative data direction */
......
...@@ -351,8 +351,6 @@ struct gb_operation *gb_operation_create(struct gb_connection *connection, ...@@ -351,8 +351,6 @@ struct gb_operation *gb_operation_create(struct gb_connection *connection,
goto err_cache; goto err_cache;
operation->request_payload = operation->request->transfer_buffer + operation->request_payload = operation->request->transfer_buffer +
sizeof(struct gb_operation_msg_hdr); sizeof(struct gb_operation_msg_hdr);
/* We always use the full request buffer */
operation->request->actual_length = request_size;
if (outgoing) { if (outgoing) {
type |= GB_OPERATION_TYPE_RESPONSE; type |= GB_OPERATION_TYPE_RESPONSE;
...@@ -443,9 +441,6 @@ int gb_operation_request_send(struct gb_operation *operation, ...@@ -443,9 +441,6 @@ int gb_operation_request_send(struct gb_operation *operation,
*/ */
int gb_operation_response_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_remove(operation);
gb_operation_destroy(operation); gb_operation_destroy(operation);
...@@ -502,7 +497,6 @@ void gb_connection_operation_recv(struct gb_connection *connection, ...@@ -502,7 +497,6 @@ void gb_connection_operation_recv(struct gb_connection *connection,
} }
memcpy(gbuf->transfer_buffer, data, msg_size); memcpy(gbuf->transfer_buffer, data, msg_size);
gbuf->actual_length = msg_size;
/* The rest will be handled in work queue context */ /* The rest will be handled in work queue context */
queue_work(gb_operation_recv_workqueue, &operation->recv_work); queue_work(gb_operation_recv_workqueue, &operation->recv_work);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment