From c41f1651c4962e56548a5b580e60f66a724357e7 Mon Sep 17 00:00:00 2001 From: Alex Elder Date: Wed, 19 Nov 2014 12:27:14 -0600 Subject: [PATCH] greybus: tidy up svc_in_callback() and cport_in_callback() The only use of local variable "es1" in in svc_in_callback() and cport_in_callback() is to get at its hd field. But we already have that, so we can get rid of that local variable. Also, rename the "cport" variable "cport_id" in cport_in_callback() is to match the convention used elsewhere, and make it the proper u16 type. Signed-off-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/es1-ap-usb.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/greybus/es1-ap-usb.c b/drivers/staging/greybus/es1-ap-usb.c index 658506df89e5..7745b81c893a 100644 --- a/drivers/staging/greybus/es1-ap-usb.c +++ b/drivers/staging/greybus/es1-ap-usb.c @@ -346,7 +346,6 @@ static void ap_disconnect(struct usb_interface *interface) static void svc_in_callback(struct urb *urb) { struct greybus_host_device *hd = urb->context; - struct es1_ap_dev *es1 = hd_to_es1(hd); struct device *dev = &urb->dev->dev; int status = check_urb_status(urb); int retval; @@ -361,7 +360,7 @@ static void svc_in_callback(struct urb *urb) /* We have a message, create a new message structure, add it to the * list, and wake up our thread that will process the messages. */ - greybus_svc_in(es1->hd, urb->transfer_buffer, urb->actual_length); + greybus_svc_in(hd, urb->transfer_buffer, urb->actual_length); exit: /* resubmit the urb to get more messages */ @@ -373,11 +372,10 @@ exit: static void cport_in_callback(struct urb *urb) { struct greybus_host_device *hd = urb->context; - struct es1_ap_dev *es1 = hd_to_es1(hd); struct device *dev = &urb->dev->dev; int status = check_urb_status(urb); int retval; - u8 cport; + u16 cport_id; u8 *data; if (status) { @@ -398,11 +396,11 @@ static void cport_in_callback(struct urb *urb) * the stream is "real" data */ data = urb->transfer_buffer; - cport = data[0]; + cport_id = (u16)data[0]; data = &data[1]; /* Pass this data to the greybus core */ - greybus_cport_in(es1->hd, cport, data, urb->actual_length - 1); + greybus_cport_in(hd, cport_id, data, urb->actual_length - 1); exit: /* put our urb back in the request pool */ -- 2.39.5