greybus: uart: properly calculate max buffer size
authorGreg Kroah-Hartman <gregkh@google.com>
Tue, 23 Feb 2016 02:14:46 +0000 (18:14 -0800)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 24 Feb 2016 06:25:08 +0000 (22:25 -0800)
commit7f29aded453e0392391b831c196583c274ec2cfd
tree2eda536314f3d3bd47c2e167237cca7b24a96786
parent737df280a73b9e9d3d24cd8e81637b0496f06dde
greybus: uart: properly calculate max buffer size

We forgot to count the size of the uart send data message header when
calculating the maximum size of the buffer that the uart driver could
send in one chunk.

This fixes the math and makes the variable a size_t to match the return
value of the call to gb_operation_get_payload_size_max();

Reported-by: Axel Haslam <ahaslam@baylibre.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Tested-by: Axel Haslam <ahaslam@baylibre.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/uart.c