greybus: gpio: Print expected/actual payload size on mismatch
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 6 Aug 2015 07:14:51 +0000 (12:44 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 11 Aug 2015 00:28:30 +0000 (17:28 -0700)
Print (expected-payload-size actual-payload-size), when the size doesn't
match for requests received by the module. This gives more details
required for debugging the issue.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/gpio.c

index 6539530a178c86dba4aa2f687bad26bcbb2ac220..caee9d19d723565eeeed33e9c710a0cb91a0becd 100644 (file)
@@ -366,7 +366,8 @@ static int gb_gpio_request_recv(u8 type, struct gb_operation *op)
        request = op->request;
 
        if (request->payload_size < sizeof(*event)) {
-               dev_err(ggc->chip.dev, "short event received\n");
+               dev_err(ggc->chip.dev, "short event received (%zu < %zu)\n",
+                       request->payload_size, sizeof(*event));
                return -EINVAL;
        }