* [PATCH 075/117] Staging: hv: storvsc: Inline free_stor_device()
From: K. Y. Srinivasan @ 2011-07-15 17:47 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Inline the code for free_stor_device() and get rid of the function.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/storvsc.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index 827b6a3..8c62829 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -51,10 +51,6 @@ static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
return stor_device;
}
-static inline void free_stor_device(struct storvsc_device *device)
-{
- kfree(device);
-}
/* Get the stordevice object iff exists and its refcount > 0 */
static inline struct storvsc_device *must_get_stor_device(
@@ -394,7 +390,7 @@ int storvsc_dev_add(struct hv_device *device,
/* Send it back up */
ret = storvsc_connect_to_vsp(device, device_info->ring_buffer_size);
if (ret) {
- free_stor_device(stor_device);
+ kfree(stor_device);
return ret;
}
device_info->path_id = stor_device->path_id;
@@ -422,7 +418,7 @@ int storvsc_dev_remove(struct hv_device *device)
/* Close the channel */
vmbus_close(device->channel);
- free_stor_device(stor_device);
+ kfree(stor_device);
return 0;
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 074/117] Staging: hv: netvsc: Change the jump label Exit to exit
From: K. Y. Srinivasan @ 2011-07-15 17:47 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Change the jump lable "Exit" to "exit".
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/rndis_filter.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index 79dfe78..6db48b9 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -537,7 +537,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
* We can't deallocate the request since we may still receive a
* send completion for it.
*/
- goto Exit;
+ goto exit;
} else {
set_complete = &request->response_msg.msg.set_complete;
status = set_complete->status;
@@ -546,7 +546,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
cleanup:
if (request)
put_rndis_request(dev, request);
-Exit:
+exit:
return ret;
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 073/117] Staging: hv: netvsc: Change the jump label Cleanup to cleanup
From: K. Y. Srinivasan @ 2011-07-15 17:47 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Change the jump label "Cleanup" to "cleanup".
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/rndis_filter.c | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index f0d1362..79dfe78 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -438,7 +438,7 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
RNDIS_MESSAGE_SIZE(struct rndis_query_request));
if (!request) {
ret = -ENOMEM;
- goto Cleanup;
+ goto cleanup;
}
/* Setup the rndis query */
@@ -450,12 +450,12 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
ret = rndis_filter_send_request(dev, request);
if (ret != 0)
- goto Cleanup;
+ goto cleanup;
t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
if (t == 0) {
ret = -ETIMEDOUT;
- goto Cleanup;
+ goto cleanup;
}
/* Copy the response back */
@@ -463,7 +463,7 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
if (query_complete->info_buflen > inresult_size) {
ret = -1;
- goto Cleanup;
+ goto cleanup;
}
memcpy(result,
@@ -473,7 +473,7 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
*result_size = query_complete->info_buflen;
-Cleanup:
+cleanup:
if (request)
put_rndis_request(dev, request);
@@ -512,7 +512,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
sizeof(u32));
if (!request) {
ret = -ENOMEM;
- goto Cleanup;
+ goto cleanup;
}
/* Setup the rndis set */
@@ -526,7 +526,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
ret = rndis_filter_send_request(dev, request);
if (ret != 0)
- goto Cleanup;
+ goto cleanup;
t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
@@ -543,7 +543,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
status = set_complete->status;
}
-Cleanup:
+cleanup:
if (request)
put_rndis_request(dev, request);
Exit:
@@ -563,7 +563,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
RNDIS_MESSAGE_SIZE(struct rndis_initialize_request));
if (!request) {
ret = -ENOMEM;
- goto Cleanup;
+ goto cleanup;
}
/* Setup the rndis set */
@@ -578,7 +578,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
ret = rndis_filter_send_request(dev, request);
if (ret != 0) {
dev->state = RNDIS_DEV_UNINITIALIZED;
- goto Cleanup;
+ goto cleanup;
}
@@ -586,7 +586,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
if (t == 0) {
ret = -ETIMEDOUT;
- goto Cleanup;
+ goto cleanup;
}
init_complete = &request->response_msg.msg.init_complete;
@@ -599,7 +599,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
ret = -EINVAL;
}
-Cleanup:
+cleanup:
if (request)
put_rndis_request(dev, request);
@@ -615,7 +615,7 @@ static void rndis_filter_halt_device(struct rndis_device *dev)
request = get_rndis_request(dev, REMOTE_NDIS_HALT_MSG,
RNDIS_MESSAGE_SIZE(struct rndis_halt_request));
if (!request)
- goto Cleanup;
+ goto cleanup;
/* Setup the rndis set */
halt = &request->request_msg.msg.halt_req;
@@ -626,7 +626,7 @@ static void rndis_filter_halt_device(struct rndis_device *dev)
dev->state = RNDIS_DEV_UNINITIALIZED;
-Cleanup:
+cleanup:
if (request)
put_rndis_request(dev, request);
return;
--
1.7.4.1
^ permalink raw reply related
* [PATCH 072/117] Staging: hv: mouse: Get rid of the unused PCI signature
From: K. Y. Srinivasan @ 2011-07-15 17:47 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Get rid of the unused PCI signature.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/hv_mouse.c | 21 ---------------------
1 files changed, 0 insertions(+), 21 deletions(-)
diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
index 1c17658..6e1c4ce 100644
--- a/drivers/staging/hv/hv_mouse.c
+++ b/drivers/staging/hv/hv_mouse.c
@@ -22,8 +22,6 @@
#include <linux/input.h>
#include <linux/hid.h>
#include <linux/hiddev.h>
-#include <linux/pci.h>
-#include <linux/dmi.h>
#include <linux/delay.h>
#include "hyperv.h"
@@ -960,25 +958,6 @@ static void __exit mousevsc_exit(void)
mousevsc_drv_exit();
}
-/*
- * We don't want to automatically load this driver just yet, it's quite
- * broken. It's safe if you want to load it yourself manually, but
- * don't inflict it on unsuspecting users, that's just mean.
- */
-#if 0
-
-/*
- * We use a PCI table to determine if we should autoload this driver This is
- * needed by distro tools to determine if the hyperv drivers should be
- * installed and/or configured. We don't do anything else with the table, but
- * it needs to be present.
- */
-const static struct pci_device_id microsoft_hv_pci_table[] = {
- { PCI_DEVICE(0x1414, 0x5353) }, /* VGA compatible controller */
- { 0 }
-};
-MODULE_DEVICE_TABLE(pci, microsoft_hv_pci_table);
-#endif
MODULE_LICENSE("GPL");
MODULE_VERSION(HV_DRV_VERSION);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 071/117] Staging: hv: mouse: Change the jump label Cleanup to cleanup
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Change the jump label "Cleanup" to "cleanup".
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/hv_mouse.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
index 30aa709..1c17658 100644
--- a/drivers/staging/hv/hv_mouse.c
+++ b/drivers/staging/hv/hv_mouse.c
@@ -339,7 +339,7 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
if (!input_device->hid_desc) {
pr_err("unable to allocate hid descriptor - size %d", desc->bLength);
- goto Cleanup;
+ goto cleanup;
}
memcpy(input_device->hid_desc, desc, desc->bLength);
@@ -352,7 +352,7 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
if (!input_device->report_desc) {
pr_err("unable to allocate report descriptor - size %d",
input_device->report_desc_size);
- goto Cleanup;
+ goto cleanup;
}
memcpy(input_device->report_desc,
@@ -379,7 +379,7 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
if (ret != 0) {
pr_err("unable to send synthhid device info ack - ret %d",
ret);
- goto Cleanup;
+ goto cleanup;
}
input_device->device_wait_condition = 1;
@@ -387,7 +387,7 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
return;
-Cleanup:
+cleanup:
kfree(input_device->hid_desc);
input_device->hid_desc = NULL;
@@ -606,7 +606,7 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
if (ret != 0) {
pr_err("unable to send synthhid protocol request.");
- goto Cleanup;
+ goto cleanup;
}
input_dev->protocol_wait_condition = 0;
@@ -614,7 +614,7 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
input_dev->protocol_wait_condition, msecs_to_jiffies(1000));
if (input_dev->protocol_wait_condition == 0) {
ret = -ETIMEDOUT;
- goto Cleanup;
+ goto cleanup;
}
response = &input_dev->protocol_resp;
@@ -623,7 +623,7 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
pr_err("synthhid protocol request failed (version %d)",
SYNTHHID_INPUT_VERSION);
ret = -1;
- goto Cleanup;
+ goto cleanup;
}
input_dev->device_wait_condition = 0;
@@ -631,7 +631,7 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
input_dev->device_wait_condition, msecs_to_jiffies(1000));
if (input_dev->device_wait_condition == 0) {
ret = -ETIMEDOUT;
- goto Cleanup;
+ goto cleanup;
}
/*
@@ -643,7 +643,7 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
else
ret = -1;
-Cleanup:
+cleanup:
put_input_device(device);
return ret;
@@ -661,7 +661,7 @@ static int mousevsc_on_device_add(struct hv_device *device,
if (!input_dev) {
ret = -1;
- goto Cleanup;
+ goto cleanup;
}
input_dev->init_complete = false;
@@ -714,7 +714,7 @@ static int mousevsc_on_device_add(struct hv_device *device,
input_dev->init_complete = true;
-Cleanup:
+cleanup:
return ret;
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 070/117] Staging: hv: netvsc: Cleanup error code in rndis_filter_device_add()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Use standard Linux error codes.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/rndis_filter.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index a71f29d..f0d1362 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -673,7 +673,7 @@ int rndis_filter_device_add(struct hv_device *dev,
rndisDevice = get_rndis_device();
if (!rndisDevice)
- return -1;
+ return -ENODEV;
/*
* Let the inner driver handle this first to create the netvsc channel
--
1.7.4.1
^ permalink raw reply related
* [PATCH 069/117] Staging: hv: netvsc: Cleanup error returns in rndis_filter_init_device()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Use standard Linux error codes.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/rndis_filter.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index f5f3052..a71f29d 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -562,7 +562,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
request = get_rndis_request(dev, REMOTE_NDIS_INITIALIZE_MSG,
RNDIS_MESSAGE_SIZE(struct rndis_initialize_request));
if (!request) {
- ret = -1;
+ ret = -ENOMEM;
goto Cleanup;
}
@@ -596,7 +596,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
ret = 0;
} else {
dev->state = RNDIS_DEV_UNINITIALIZED;
- ret = -1;
+ ret = -EINVAL;
}
Cleanup:
--
1.7.4.1
^ permalink raw reply related
* [PATCH 068/117] Staging: hv: netvsc: Cleanup error return values in rndis_filter_set_packet_filter()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Use standard Linux error codes and cleanup some error paths.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/rndis_filter.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index f26886d..f5f3052 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -511,7 +511,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
RNDIS_MESSAGE_SIZE(struct rndis_set_request) +
sizeof(u32));
if (!request) {
- ret = -1;
+ ret = -ENOMEM;
goto Cleanup;
}
@@ -531,7 +531,6 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
if (t == 0) {
- ret = -1;
dev_err(&dev->net_dev->dev->device,
"timeout before we got a set response...\n");
/*
@@ -540,8 +539,6 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
*/
goto Exit;
} else {
- if (ret > 0)
- ret = 0;
set_complete = &request->response_msg.msg.set_complete;
status = set_complete->status;
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 067/117] Staging: hv: netvsc: Cleanup error code in rndis_filter_query_device()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Use standard Linux error codes.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/rndis_filter.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index 8e1ef00..f26886d 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -437,7 +437,7 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
request = get_rndis_request(dev, REMOTE_NDIS_QUERY_MSG,
RNDIS_MESSAGE_SIZE(struct rndis_query_request));
if (!request) {
- ret = -1;
+ ret = -ENOMEM;
goto Cleanup;
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 066/117] Staging: hv: netvsc: Cleanup error codes in rndis_filter_receive()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Use standard Linux error codes.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/rndis_filter.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index dbb5201..8e1ef00 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -358,14 +358,14 @@ int rndis_filter_receive(struct hv_device *dev,
if (!net_dev->extension) {
dev_err(&dev->device, "got rndis message but no rndis device - "
"dropping this message!\n");
- return -1;
+ return -ENODEV;
}
rndis_dev = (struct rndis_device *)net_dev->extension;
if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) {
dev_err(&dev->device, "got rndis message but rndis device "
"uninitialized...dropping this message!\n");
- return -1;
+ return -ENODEV;
}
rndis_hdr = (struct rndis_message *)kmap_atomic(
--
1.7.4.1
^ permalink raw reply related
* [PATCH 065/117] Staging: hv: netvsc: Cleanup error return codes in netvsc_device_add()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Use standard Linux error codes.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/netvsc.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index f7f4957..b6e1fb9 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -918,7 +918,7 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
net_device = alloc_net_device(device);
if (!net_device) {
- ret = -1;
+ ret = -ENOMEM;
goto cleanup;
}
@@ -947,7 +947,6 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
if (ret != 0) {
dev_err(&device->device, "unable to open channel: %d", ret);
- ret = -1;
goto cleanup;
}
@@ -959,7 +958,6 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
if (ret != 0) {
dev_err(&device->device,
"unable to connect to NetVSP - %d", ret);
- ret = -1;
goto close;
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 064/117] Staging: hv: netvsc: Cleanup error return values in netvsc_send()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Use standard Linux error codes.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/netvsc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 9cc126b..f7f4957 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -409,7 +409,7 @@ int netvsc_device_remove(struct hv_device *device)
net_device = release_outbound_net_device(device);
if (!net_device) {
dev_err(&device->device, "No net device present!!");
- return -1;
+ return -ENODEV;
}
/* Wait for all send completions */
@@ -499,7 +499,7 @@ int netvsc_send(struct hv_device *device,
if (!net_device) {
dev_err(&device->device, "net device (%p) shutting down..."
"ignoring outbound packets", net_device);
- return -2;
+ return -ENODEV;
}
sendMessage.hdr.msg_type = NVSP_MSG1_TYPE_SEND_RNDIS_PKT;
--
1.7.4.1
^ permalink raw reply related
* [PATCH 063/117] Staging: hv: netvsc: Cleanup error returns in netvsc_connect_vsp()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Use standard Linux error codes.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/netvsc.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 5703fd7..9cc126b 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -323,7 +323,7 @@ static int netvsc_connect_vsp(struct hv_device *device)
if (!net_device) {
dev_err(&device->device, "unable to get net device..."
"device being destroyed?");
- return -1;
+ return -ENODEV;
}
init_packet = &net_device->channel_init_pkt;
@@ -354,13 +354,13 @@ static int netvsc_connect_vsp(struct hv_device *device)
if (init_packet->msg.init_msg.init_complete.status !=
NVSP_STAT_SUCCESS) {
- ret = -1;
+ ret = -EINVAL;
goto cleanup;
}
if (init_packet->msg.init_msg.init_complete.
negotiated_protocol_ver != NVSP_PROTOCOL_VERSION_1) {
- ret = -1;
+ ret = -EPROTO;
goto cleanup;
}
/* Send the ndis version */
@@ -381,10 +381,8 @@ static int netvsc_connect_vsp(struct hv_device *device)
sizeof(struct nvsp_message),
(unsigned long)init_packet,
VM_PKT_DATA_INBAND, 0);
- if (ret != 0) {
- ret = -1;
+ if (ret != 0)
goto cleanup;
- }
/* Post the big receive buffer to NetVSP */
ret = netvsc_init_recv_buf(device);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 062/117] Staging: hv: netvsc: Cleanup error return values in netvsc_init_recv_buf()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Use standard Linux error codes.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/netvsc.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index baa0c8d..5703fd7 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -207,7 +207,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
if (!net_device) {
dev_err(&device->device, "unable to get net device..."
"device being destroyed?");
- return -1;
+ return -ENODEV;
}
net_device->recv_buf =
@@ -216,7 +216,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
if (!net_device->recv_buf) {
dev_err(&device->device, "unable to allocate receive "
"buffer of size %d", net_device->recv_buf_size);
- ret = -1;
+ ret = -ENOMEM;
goto cleanup;
}
@@ -269,7 +269,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
"initialzation with NetVsp - status %d",
init_packet->msg.v1_msg.
send_recv_buf_complete.status);
- ret = -1;
+ ret = -EINVAL;
goto cleanup;
}
@@ -281,7 +281,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
net_device->recv_section = kmalloc(net_device->recv_section_cnt
* sizeof(struct nvsp_1_receive_buffer_section), GFP_KERNEL);
if (net_device->recv_section == NULL) {
- ret = -1;
+ ret = -EINVAL;
goto cleanup;
}
@@ -297,7 +297,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
*/
if (net_device->recv_section_cnt != 1 ||
net_device->recv_section->offset != 0) {
- ret = -1;
+ ret = -EINVAL;
goto cleanup;
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 061/117] Staging: hv: netvsc: Cleanup error return codes in netvsc_destroy_recv_buf()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Cleanup error return codes in netvsc_destroy_recv_buf().
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/netvsc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index b89ac7e..baa0c8d 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -160,7 +160,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
if (ret != 0) {
dev_err(&net_device->dev->device, "unable to send "
"revoke receive buffer to netvsp");
- return -1;
+ return ret;
}
}
@@ -175,7 +175,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
if (ret != 0) {
dev_err(&net_device->dev->device,
"unable to teardown receive buffer's gpadl");
- return -1;
+ return -ret;
}
net_device->recv_buf_gpadl_handle = 0;
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 060/117] Staging: hv: netvsc: Cleanup the returned error code in netvsc_probe()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Use standard Linux error codes.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/netvsc_drv.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 542be65..94c5abc 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -340,7 +340,7 @@ static int netvsc_probe(struct hv_device *dev)
net = alloc_etherdev(sizeof(struct net_device_context));
if (!net)
- return -1;
+ return -ENOMEM;
/* Set initial state */
netif_carrier_off(net);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 059/117] Staging: hv: storvsc: Cleanup returned error code in storvsc_drv_init()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Use standard Linux error codes.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/storvsc_drv.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index 9640630..bc71024 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -753,7 +753,7 @@ static int __init storvsc_drv_init(void)
if (max_outstanding_req_per_channel <
STORVSC_MAX_IO_REQUESTS)
- return -1;
+ return -EINVAL;
drv->driver.name = driver_name;
--
1.7.4.1
^ permalink raw reply related
* [PATCH 058/117] Staging: hv: storvsc: Cleanup error code returned in storvsc_probe()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Use standard Linux error codes.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/storvsc_drv.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index f85ebb0..9640630 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -696,7 +696,7 @@ static int storvsc_probe(struct hv_device *device)
if (ret != 0) {
kmem_cache_destroy(host_dev->request_pool);
scsi_host_put(host);
- return -1;
+ return -ENODEV;
}
host_dev->path = device_info.path_id;
@@ -717,7 +717,7 @@ static int storvsc_probe(struct hv_device *device)
kmem_cache_destroy(host_dev->request_pool);
scsi_host_put(host);
- return -1;
+ return -ENODEV;
}
scsi_scan_host(host);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 057/117] Staging: hv: storvsc: Cleanup returned error code in storvsc_host_reset()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Use standard Linux error codes.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/storvsc_drv.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index 7efde7c..f85ebb0 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -348,7 +348,7 @@ static int storvsc_host_reset(struct hv_device *device)
stor_device = get_stor_device(device);
if (!stor_device)
- return -1;
+ return -ENODEV;
request = &stor_device->reset_request;
vstor_packet = &request->vstor_packet;
--
1.7.4.1
^ permalink raw reply related
* [PATCH 056/117] Staging: hv: storvsc: Fix/cleanup some dated comments in storvsc.c
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Fix/cleanup some dated comments in storvsc.c.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/storvsc.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index 3730f3f..827b6a3 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -166,7 +166,6 @@ static int storvsc_channel_init(struct hv_device *device)
goto cleanup;
}
- /* TODO: Check returned version */
if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
vstor_packet->status != 0)
goto cleanup;
@@ -193,7 +192,6 @@ static int storvsc_channel_init(struct hv_device *device)
goto cleanup;
}
- /* TODO: Check returned version */
if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
vstor_packet->status != 0)
goto cleanup;
@@ -384,11 +382,12 @@ int storvsc_dev_add(struct hv_device *device,
/* Save the channel properties to our storvsc channel */
- /* FIXME: */
/*
* If we support more than 1 scsi channel, we need to set the
* port number here to the scsi channel but how do we get the
- * scsi channel prior to the bus scan
+ * scsi channel prior to the bus scan.
+ *
+ * The host does not support this.
*/
stor_device->port_number = device_info->port_number;
@@ -545,4 +544,3 @@ int storvsc_get_major_info(struct storvsc_device_info *device_info,
return -ENODEV;
}
-
--
1.7.4.1
^ permalink raw reply related
* [PATCH 055/117] Storage: hv: storvsc: Get rid of some unnecessary DPRINTs from storvsc.c
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Get rid of some unnecessary DPRINTs from storvsc.c.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/storvsc.c | 16 ----------------
1 files changed, 0 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index 2b914e4..3730f3f 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -125,8 +125,6 @@ static int storvsc_channel_init(struct hv_device *device)
vstor_packet->operation = VSTOR_OPERATION_BEGIN_INITIALIZATION;
vstor_packet->flags = REQUEST_COMPLETION_FLAG;
- DPRINT_INFO(STORVSC, "BEGIN_INITIALIZATION_OPERATION...");
-
ret = vmbus_sendpacket(device->channel, vstor_packet,
sizeof(struct vstor_packet),
(unsigned long)request,
@@ -145,7 +143,6 @@ static int storvsc_channel_init(struct hv_device *device)
vstor_packet->status != 0)
goto cleanup;
- DPRINT_INFO(STORVSC, "QUERY_PROTOCOL_VERSION_OPERATION...");
/* reuse the packet for version range supported */
memset(vstor_packet, 0, sizeof(struct vstor_packet));
@@ -174,8 +171,6 @@ static int storvsc_channel_init(struct hv_device *device)
vstor_packet->status != 0)
goto cleanup;
- /* Query channel properties */
- DPRINT_INFO(STORVSC, "QUERY_PROPERTIES_OPERATION...");
memset(vstor_packet, 0, sizeof(struct vstor_packet));
vstor_packet->operation = VSTOR_OPERATION_QUERY_PROPERTIES;
@@ -207,8 +202,6 @@ static int storvsc_channel_init(struct hv_device *device)
stor_device->target_id
= vstor_packet->storage_channel_properties.target_id;
- DPRINT_INFO(STORVSC, "END_INITIALIZATION_OPERATION...");
-
memset(vstor_packet, 0, sizeof(struct vstor_packet));
vstor_packet->operation = VSTOR_OPERATION_END_INITIALIZATION;
vstor_packet->flags = REQUEST_COMPLETION_FLAG;
@@ -232,7 +225,6 @@ static int storvsc_channel_init(struct hv_device *device)
vstor_packet->status != 0)
goto cleanup;
- DPRINT_INFO(STORVSC, "**** storage channel up and running!! ****");
cleanup:
put_stor_device(device);
@@ -305,13 +297,8 @@ static void storvsc_on_receive(struct hv_device *device,
storvsc_on_io_completion(device, vstor_packet, request);
break;
case VSTOR_OPERATION_REMOVE_DEVICE:
- DPRINT_INFO(STORVSC, "REMOVE_DEVICE_OPERATION");
- /* TODO: */
- break;
default:
- DPRINT_INFO(STORVSC, "Unknown operation received - %d",
- vstor_packet->operation);
break;
}
}
@@ -421,9 +408,6 @@ int storvsc_dev_remove(struct hv_device *device)
{
struct storvsc_device *stor_device;
- DPRINT_INFO(STORVSC, "disabling storage device (%p)...",
- device->ext);
-
stor_device = release_stor_device(device);
/*
--
1.7.4.1
^ permalink raw reply related
* [PATCH 054/117] Staging: hv: storvsc: Cleanup error handling in storvsc_do_io()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Use standard Linux error codes.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/storvsc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index 2b73f72..2b914e4 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -454,7 +454,7 @@ int storvsc_do_io(struct hv_device *device,
stor_device = get_stor_device(device);
if (!stor_device)
- return -2;
+ return -ENODEV;
request->device = device;
--
1.7.4.1
^ permalink raw reply related
* [PATCH 053/117] Staging: hv: storvsc: Cleanup error handling in storvsc_connect_to_vsp()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Cleanup error handling in storvsc_connect_to_vsp().
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/storvsc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index 22ac6f2..2b73f72 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -376,7 +376,7 @@ static int storvsc_connect_to_vsp(struct hv_device *device, u32 ring_size)
storvsc_on_channel_callback, device);
if (ret != 0)
- return -1;
+ return ret;
ret = storvsc_channel_init(device);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 052/117] Staging: hv: storvsc: Cleanup error handling in storvsc_channel_init()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Use standard Linux error codes.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/storvsc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index 915aeee..22ac6f2 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -111,7 +111,7 @@ static int storvsc_channel_init(struct hv_device *device)
stor_device = get_stor_device(device);
if (!stor_device)
- return -1;
+ return -ENODEV;
request = &stor_device->init_request;
vstor_packet = &request->vstor_packet;
--
1.7.4.1
^ permalink raw reply related
* [PATCH 051/117] Staging: hv: storvsc: Cleanup error handling in storvsc_dev_add()
From: K. Y. Srinivasan @ 2011-07-15 17:46 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Use standard Linux error values and cleanup error handling. I would like
to acknowledge Andre Bartke (andre.bartke@gmail.com) for highlighting this
problem.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/storvsc.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index 3029786..915aeee 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -392,10 +392,8 @@ int storvsc_dev_add(struct hv_device *device,
device_info = (struct storvsc_device_info *)additional_info;
stor_device = alloc_stor_device(device);
- if (!stor_device) {
- ret = -1;
- goto cleanup;
- }
+ if (!stor_device)
+ return -ENOMEM;
/* Save the channel properties to our storvsc channel */
@@ -409,11 +407,13 @@ int storvsc_dev_add(struct hv_device *device,
stor_device->port_number = device_info->port_number;
/* Send it back up */
ret = storvsc_connect_to_vsp(device, device_info->ring_buffer_size);
-
+ if (ret) {
+ free_stor_device(stor_device);
+ return ret;
+ }
device_info->path_id = stor_device->path_id;
device_info->target_id = stor_device->target_id;
-cleanup:
return ret;
}
--
1.7.4.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox