greybus: raw: Print expected/actual payload size on mismatch
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 6 Aug 2015 07:14:52 +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/raw.c

index 3be96db2588ba97e500cb6d0cd4392f3acf34a6d..a17a9868a08e772ffb261ea427592ff6d7e9d9e1 100644 (file)
@@ -121,7 +121,8 @@ static int gb_raw_receive(u8 type, struct gb_operation *op)
 
        /* Verify size of payload */
        if (op->request->payload_size < sizeof(*receive)) {
-               dev_err(raw->device, "raw receive request too small\n");
+               dev_err(raw->device, "raw receive request too small (%zu < %zu)\n",
+                       op->request->payload_size, sizeof(*receive));
                return -EINVAL;
        }
        receive = op->request->payload;