From: Viresh Kumar Date: Thu, 6 Aug 2015 07:14:54 +0000 (+0530) Subject: greybus: svc: Print expected/actual payload size on mismatch X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6d05ad3c4226024ad78dfbd2ab683b760ab56389;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git greybus: svc: Print expected/actual payload size on mismatch 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 Reviewed-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c index b89e88952a30..4d59cbb0b337 100644 --- a/drivers/staging/greybus/svc.c +++ b/drivers/staging/greybus/svc.c @@ -269,7 +269,8 @@ static int gb_svc_intf_hotplug_recv(struct gb_operation *op) int ret; if (request->payload_size < sizeof(*hotplug)) { - dev_err(dev, "%s: short hotplug request received\n", __func__); + dev_err(dev, "%s: short hotplug request received (%zu < %zu)\n", + __func__, request->payload_size, sizeof(*hotplug)); return -EINVAL; } @@ -372,7 +373,8 @@ static int gb_svc_intf_hot_unplug_recv(struct gb_operation *op) if (request->payload_size < sizeof(*hot_unplug)) { dev_err(&op->connection->dev, - "short hot unplug request received\n"); + "short hot unplug request received (%zu < %zu)\n", + request->payload_size, sizeof(*hot_unplug)); return -EINVAL; } @@ -400,7 +402,8 @@ static int gb_svc_intf_reset_recv(struct gb_operation *op) if (request->payload_size < sizeof(*reset)) { dev_err(&op->connection->dev, - "short reset request received\n"); + "short reset request received (%zu < %zu)\n", + request->payload_size, sizeof(*reset)); return -EINVAL; } reset = request->payload;