greybus: gbuf: have caller set actual_length
authorAlex Elder <elder@linaro.org>
Fri, 3 Oct 2014 20:05:19 +0000 (15:05 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Sat, 4 Oct 2014 02:02:22 +0000 (19:02 -0700)
commit652433f3fe97e3609acd9afcb9b50ec62f7a8d05
treeed6acd5f29b223de806202a18dea68ff2b93e150
parent937d0da83ffde769f24b5124d66f793045c5da10
greybus: gbuf: have caller set actual_length

A Greybus buffer has both a transfer_buffer_size field, which is the
size in bytes of the transfer buffer, and an actual_length field,
which is the number of bytes in that buffer that are actually
consumed.  The user of the buffer--and not the buffer allocation
method--should be setting the actual_length field.

Stop setting the actual length on the es1-ap-usb alloc_gbuf_data
method.  And *do* set it in gb_operation_create(), where we can
presume the operation being allocated will consume all the bytes
requested.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/es1-ap-usb.c
drivers/staging/greybus/operation.c