Commit bfd9a94d authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

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: default avatarJohan Hovold <johan@hovoldconsulting.com>
Reviewed-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 79940cf8
...@@ -132,7 +132,7 @@ static void hd_buffer_constraints(struct greybus_host_device *hd) ...@@ -132,7 +132,7 @@ static void hd_buffer_constraints(struct greybus_host_device *hd)
* that's better aligned for the user. * that's better aligned for the user.
*/ */
hd->buffer_headroom = sizeof(u32); /* For cport id */ 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); BUILD_BUG_ON(hd->buffer_headroom > GB_BUFFER_HEADROOM_MAX);
} }
......
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