From 87c8eb8d09387de7263a7c2c75536db4aa50e056 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Mon, 22 Jun 2015 16:42:28 +0530 Subject: [PATCH] greybus: hotplug function doesn't need to contain manifest now Manifest is fetched with control protocol now and so we don't need space for it in hotplug data. Reviewed-by: Alex Elder Signed-off-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/ap.c | 6 ++---- drivers/staging/greybus/svc_msg.h | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/greybus/ap.c b/drivers/staging/greybus/ap.c index 113fd87..869f934 100644 --- a/drivers/staging/greybus/ap.c +++ b/drivers/staging/greybus/ap.c @@ -167,8 +167,7 @@ static void svc_hotplug(struct svc_function_hotplug *hotplug, switch (hotplug->hotplug_event) { case SVC_HOTPLUG_EVENT: /* Add a new interface to the system */ - if (payload_length < 0x03) { - /* Hotplug message is at least 3 bytes big */ + if (payload_length != sizeof(*hotplug)) { dev_err(hd->parent, "Illegal size of svc hotplug message %d\n", payload_length); @@ -180,8 +179,7 @@ static void svc_hotplug(struct svc_function_hotplug *hotplug, case SVC_HOTUNPLUG_EVENT: /* Remove a interface from the system */ - if (payload_length != 0x02) { - /* Hotunplug message is only 2 bytes big */ + if (payload_length != sizeof(*hotplug)) { dev_err(hd->parent, "Illegal size of svc hotunplug message %d\n", payload_length); diff --git a/drivers/staging/greybus/svc_msg.h b/drivers/staging/greybus/svc_msg.h index fadc1d7..3c628c5 100644 --- a/drivers/staging/greybus/svc_msg.h +++ b/drivers/staging/greybus/svc_msg.h @@ -82,7 +82,6 @@ enum svc_function_hotplug_event { struct svc_function_hotplug { __u8 hotplug_event; /* enum svc_function_hotplug_event */ __u8 interface_id; /* Interface id within the Endo */ - __u8 data[0]; } __packed; enum svc_function_power_type { -- 2.7.4