OSDN Git Service

greybus: enforce max representable message size
authorAlex Elder <elder@linaro.org>
Mon, 1 Dec 2014 13:53:07 +0000 (07:53 -0600)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 2 Dec 2014 04:40:35 +0000 (20:40 -0800)
commitab3cf8dc7db6755d216173b04043b0e0cd24415b
tree3c25fbe1dc61e08524def9be2de5a202ff5888cc
parent94b15d7613e861563b9f06fac2c273ca8e2fc269
greybus: enforce max representable message size

We represent the size of a message using a 16-bit field.  It's
possible for a host driver to advertise a maximum message size
that's bigger than that.  If that happens, reduce the host device's
maximum buffer size to the maximum we can represent the first time
a message is allocated.

This information is actually only used by the Greybus code, but
because we're modifying a value that's "owned" by the host driver,
issue a warning when this limit is being imposed

Ensure (at build time) that our own definition is sane as well.

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