Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281024
b: refs/heads/master
c: dba8e1a
h: refs/heads/master
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Nov 27, 2011
1 parent 33fb845 commit 33d15e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f72a1cc74f9f9f239938cbdc309c66dd87ceaf94
refs/heads/master: dba8e1ad957e19ab42c39808a502803dc5b2dee7
16 changes: 6 additions & 10 deletions trunk/drivers/staging/hv/hv_mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ struct synthhid_input_report {
#define INPUTVSC_SEND_RING_BUFFER_SIZE (10*PAGE_SIZE)
#define INPUTVSC_RECV_RING_BUFFER_SIZE (10*PAGE_SIZE)

#define NBITS(x) (((x)/BITS_PER_LONG)+1)

enum pipe_prot_msg_type {
PIPE_MESSAGE_INVALID,
Expand Down Expand Up @@ -146,6 +145,7 @@ struct mousevsc_prt_msg {
struct mousevsc_dev {
struct hv_device *device;
bool init_complete;
bool connected;
struct mousevsc_prt_msg protocol_req;
struct mousevsc_prt_msg protocol_resp;
/* Synchronize the request/response if needed */
Expand All @@ -156,7 +156,6 @@ struct mousevsc_dev {
unsigned char *report_desc;
u32 report_desc_size;
struct hv_input_dev_info hid_dev_info;
bool connected;
struct hid_device *hid_device;
};

Expand Down Expand Up @@ -359,9 +358,9 @@ static void mousevsc_on_channel_callback(void *context)
bufferlen = bytes_recvd;
buffer = kmalloc(bytes_recvd, GFP_ATOMIC);

if (buffer == NULL) {
if (!buffer)
return;
}

break;
}
} while (1);
Expand All @@ -376,7 +375,6 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
struct mousevsc_prt_msg *request;
struct mousevsc_prt_msg *response;


request = &input_dev->protocol_req;

memset(request, 0, sizeof(struct mousevsc_prt_msg));
Expand All @@ -388,19 +386,18 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
request->request.header.size = sizeof(unsigned int);
request->request.version_requested.version = SYNTHHID_INPUT_VERSION;


ret = vmbus_sendpacket(device->channel, request,
sizeof(struct pipe_prt_msg) -
sizeof(unsigned char) +
sizeof(struct synthhid_protocol_request),
(unsigned long)request,
VM_PKT_DATA_INBAND,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
if (ret != 0)
if (ret)
goto cleanup;

t = wait_for_completion_timeout(&input_dev->wait_event, 5*HZ);
if (t == 0) {
if (!t) {
ret = -ETIMEDOUT;
goto cleanup;
}
Expand All @@ -415,7 +412,7 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
}

t = wait_for_completion_timeout(&input_dev->wait_event, 5*HZ);
if (t == 0) {
if (!t) {
ret = -ETIMEDOUT;
goto cleanup;
}
Expand Down Expand Up @@ -487,7 +484,6 @@ static int mousevsc_probe(struct hv_device *device,
return ret;
}


ret = mousevsc_connect_to_vsp(device);

if (ret != 0)
Expand Down

0 comments on commit 33d15e9

Please sign in to comment.