greybus: get rid of gbuf->actual_length
authorAlex Elder <elder@linaro.org>
Thu, 6 Nov 2014 13:01:01 +0000 (07:01 -0600)
committerGreg Kroah-Hartman <greg@kroah.com>
Thu, 6 Nov 2014 16:03:35 +0000 (08:03 -0800)
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>
drivers/staging/greybus/greybus.h
drivers/staging/greybus/operation.c

index 834cbaa..175bd00 100644 (file)
@@ -130,7 +130,6 @@ struct gbuf {
        int status;
        void *transfer_buffer;
        u32 transfer_buffer_length;
-       u32 actual_length;
 
        bool outbound;                  /* AP-relative data direction */
 
index 24707f6..720cc76 100644 (file)
@@ -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);