greybus: es1: fix buffer-size limit

The maximum buffer size does not include the headroom, so subtract the
headroom size from the actual buffer size.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Johan Hovold 2015-04-07 11:27:11 +02:00 коммит произвёл Greg Kroah-Hartman
Родитель 79940cf875
Коммит bfd9a94d1a
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -132,7 +132,7 @@ static void hd_buffer_constraints(struct greybus_host_device *hd)
* that's better aligned for the user.
*/
hd->buffer_headroom = sizeof(u32); /* For cport id */
hd->buffer_size_max = ES1_GBUF_MSG_SIZE_MAX;
hd->buffer_size_max = ES1_GBUF_MSG_SIZE_MAX - hd->buffer_headroom;
BUILD_BUG_ON(hd->buffer_headroom > GB_BUFFER_HEADROOM_MAX);
}