Commit 6e56f27c authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: mousevsc: Get rid of mousevsc_on_receive_input_report() by inlining

Get rid of mousevsc_on_receive_input_report() by inlining the code.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 517812b4
...@@ -270,28 +270,13 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device, ...@@ -270,28 +270,13 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
complete(&input_device->wait_event); complete(&input_device->wait_event);
} }
static void mousevsc_on_receive_input_report(struct mousevsc_dev *input_device,
struct synthhid_input_report *input_report)
{
struct hv_driver *input_drv;
if (!input_device->init_complete)
return;
input_drv = drv_to_hv_drv(input_device->device->device.driver);
hid_input_report(input_device->hid_device,
HID_INPUT_REPORT, input_report->buffer, input_report->header.size, 1);
}
static void mousevsc_on_receive(struct hv_device *device, static void mousevsc_on_receive(struct hv_device *device,
struct vmpacket_descriptor *packet) struct vmpacket_descriptor *packet)
{ {
struct pipe_prt_msg *pipe_msg; struct pipe_prt_msg *pipe_msg;
struct synthhid_msg *hid_msg; struct synthhid_msg *hid_msg;
struct mousevsc_dev *input_dev = hv_get_drvdata(device); struct mousevsc_dev *input_dev = hv_get_drvdata(device);
struct synthhid_input_report *input_report;
pipe_msg = (struct pipe_prt_msg *)((unsigned long)packet + pipe_msg = (struct pipe_prt_msg *)((unsigned long)packet +
(packet->offset8 << 3)); (packet->offset8 << 3));
...@@ -320,9 +305,13 @@ static void mousevsc_on_receive(struct hv_device *device, ...@@ -320,9 +305,13 @@ static void mousevsc_on_receive(struct hv_device *device,
(struct synthhid_device_info *)&pipe_msg->data[0]); (struct synthhid_device_info *)&pipe_msg->data[0]);
break; break;
case SYNTH_HID_INPUT_REPORT: case SYNTH_HID_INPUT_REPORT:
mousevsc_on_receive_input_report(input_dev, input_report =
(struct synthhid_input_report *)&pipe_msg->data[0]); (struct synthhid_input_report *)&pipe_msg->data[0];
if (!input_dev->init_complete)
break;
hid_input_report(input_dev->hid_device,
HID_INPUT_REPORT, input_report->buffer,
input_report->header.size, 1);
break; break;
default: default:
pr_err("unsupported hid msg type - type %d len %d", pr_err("unsupported hid msg type - type %d len %d",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment