From 6d05ad3c4226024ad78dfbd2ab683b760ab56389 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Thu, 6 Aug 2015 12:44:54 +0530 Subject: [PATCH] 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 --- drivers/staging/greybus/svc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; -- 2.20.1