From: "K. Y. Srinivasan" <kys@microsoft.com>
To: gregkh@suse.de, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org, virtualization@lists.osdl.org
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Subject: [PATCH 089/117] Staging: hv: netvsc: Cleanup alloc_net_device()
Date: Fri, 15 Jul 2011 10:47:17 -0700 [thread overview]
Message-ID: <1310752065-27895-89-git-send-email-kys@microsoft.com> (raw)
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>
Cleanup alloc_net_device(); we can directly set the refcnt.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/netvsc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 75c6ed7..7722102 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -41,7 +41,7 @@ static struct netvsc_device *alloc_net_device(struct hv_device *device)
return NULL;
/* Set to 2 to allow both inbound and outbound traffic */
- atomic_cmpxchg(&net_device->refcnt, 0, 2);
+ atomic_set(&net_device->refcnt, 2);
net_device->dev = device;
device->ext = net_device;
--
1.7.4.1
next prev parent reply other threads:[~2011-07-15 17:47 UTC|newest]
Thread overview: 175+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-15 17:47 [PATCH 0000/0117] Staging: hv: Driver cleanup K. Y. Srinivasan
2011-07-15 17:45 ` [PATCH 001/117] Staging: hv: vmbus: VMBUS is an ACPI enumerated device, get rid of the PCI signature K. Y. Srinivasan
2011-07-15 17:45 ` [PATCH 002/117] Staging: hv: Replace struct hv_guid with the uuid type already defined in Linux K. Y. Srinivasan
2011-07-15 17:45 ` [PATCH 003/117] Staging: hv: Add struct hv_vmbus_device_id to mod_devicetable.h K. Y. Srinivasan
2011-08-23 22:41 ` Greg KH
2011-08-24 0:44 ` KY Srinivasan
2011-08-24 2:59 ` Greg KH
2011-08-24 16:46 ` KY Srinivasan
2011-08-24 20:11 ` Greg KH
2011-08-24 21:51 ` KY Srinivasan
2011-08-25 2:27 ` KY Srinivasan
2011-08-25 2:40 ` Greg KH
2011-08-25 14:14 ` KY Srinivasan
2011-08-25 2:38 ` Greg KH
2011-07-15 17:45 ` [PATCH 004/117] Staging: hv: Add code to parse struct hv_vmbus_device_id table K. Y. Srinivasan
2011-07-15 17:45 ` [PATCH 005/117] Staging: hv: vmbus: Introduce vmbus ID space in struct hv_driver K. Y. Srinivasan
2011-07-15 17:45 ` [PATCH 006/117] Staging: hv: blkvsc: Use the newly introduced vmbus ID in the blockvsc driver K. Y. Srinivasan
2011-08-23 22:45 ` Greg KH
2011-07-15 17:45 ` [PATCH 007/117] Staging: hv: storvsc: Use the newly introduced vmbus ID in storvsc driver K. Y. Srinivasan
2011-07-15 17:45 ` [PATCH 008/117] Staging: hv: netvsc: Use the newly introduced vmbus ID in netvsc driver K. Y. Srinivasan
2011-07-15 17:45 ` [PATCH 009/117] Staging: hv: mousevsc: Use the newly introduced vmbus ID in mouse driver K. Y. Srinivasan
2011-07-15 17:45 ` [PATCH 010/117] Staging: hv: util: Make hv_utils a vmbus device driver K. Y. Srinivasan
2011-07-15 17:45 ` [PATCH 011/117] Staging: hv: util: Use the newly introduced vmbus ID in util driver K. Y. Srinivasan
2011-08-23 22:46 ` Greg KH
2011-07-15 17:46 ` [PATCH 012/117] Staging: hv: blkvsc: Add the MODULE_DEVICE_TABLE() line K. Y. Srinivasan
2011-08-23 22:46 ` Greg KH
2011-07-15 17:46 ` [PATCH 013/117] Staging: hv: storvsc: Add " K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 014/117] Staging: hv: netvsc: Add the " K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 015/117] Staging: hv: util: " K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 016/117] Staging: hv: mouse: " K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 017/117] Staging: hv: mouse: Do not auto-load the mouse driver K. Y. Srinivasan
2011-08-23 22:47 ` Greg KH
2011-07-15 17:46 ` [PATCH 018/117] Staging: hv: vmbus: Cleanup vmbus_match() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 019/117] Staging: hv: vmbus: Cleanup vmbus_uevent() code K. Y. Srinivasan
2011-08-23 22:49 ` Greg KH
2011-08-24 0:38 ` KY Srinivasan
2011-08-24 3:00 ` Greg KH
2011-08-24 14:12 ` KY Srinivasan
2011-07-15 17:46 ` [PATCH 020/117] Staging: hv: vmbus: Support the notion of id tables in vmbus_match() K. Y. Srinivasan
2011-07-16 2:02 ` Christoph Hellwig
2011-07-16 12:54 ` KY Srinivasan
2011-07-16 18:24 ` Christoph Hellwig
2011-08-23 22:51 ` Greg KH
2011-07-15 17:46 ` [PATCH 021/117] Staging: hv: vmbus: Get rid of an unnecessary include line in vmbus_drv.c K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 022/117] Staging: hv: storvsc: Get rid of the DMI signature K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 023/117] Staging: hv: netvsc: Get rid of the PCI signature K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 024/117] Staging: hv: netvsc: Get rid of the DMI signature in netvsc_drv.c K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 025/117] Staging: hv: util: Get rid of the DMI signature in hv_util.c K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 026/117] Staging: hv: util: Get rid of the PCI " K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 027/117] Staging: hv: blkvsc: Get rid of the dev_type guid from blkvsc_drv.c K. Y. Srinivasan
2011-08-23 22:52 ` Greg KH
2011-07-15 17:46 ` [PATCH 028/117] Staging: hv: storvsc: Get rid of the device type guid from storvsc_drv.c K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 029/117] Staging: hv: netvsc: Get rid of the dev_type guid from netvsc.c K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 030/117] Staging: hv: netvsc: Initialize the driver name directly K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 031/117] Staging: hv: netvsc: Get rid of the driver name initialization in netvsc.c K. Y. Srinivasan
2011-08-23 22:56 ` Greg KH
2011-07-15 17:46 ` [PATCH 032/117] Staging: hv: netvsc: Get rid of the empty function netvsc_initialize() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 033/117] Staging: hv: vmbus: Get rid of the unused name field in struct hv_driver K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 034/117] Staging: hv: mouse: Get rid of the dev_type guid in hv_mouse.c K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 035/117] Staging: hv: vmbus: Introduce a function to map the dev_type guid to a name K. Y. Srinivasan
2011-08-23 23:01 ` Greg KH
2011-07-15 17:46 ` [PATCH 036/117] Staging: hv: vmbus: Make class_id attribute a human readable string K. Y. Srinivasan
2011-08-23 23:02 ` Greg KH
2011-07-15 17:46 ` [PATCH 037/117] Staging: hv: vmbus: Get rid of the device_id attribute K. Y. Srinivasan
2011-08-23 23:03 ` Greg KH
2011-07-15 17:46 ` [PATCH 038/117] Staging: hv: vmbus: Get rid of some unnecessary comments K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 039/117] Staging: hv: vmbus: Cleanup unnecessary comments in hv.c K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 040/117] Staging: hv: vmbus: Cleanup error handling in hv_init() K. Y. Srinivasan
2011-08-23 23:04 ` Greg KH
2011-07-15 17:46 ` [PATCH 041/117] Staging: hv: vmbus: Get rid of unnecessay comments in connection.c K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 042/117] Staging: hv: vmbus: Get rid of the function dump_gpadl_body() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 043/117] Staging: hv: vmbus: Get rid of the function dump_gpadl_header() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 044/117] Staging: hv: vmbus: Rename openMsg to open_msg in channel.c K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 045/117] Staging: hv: vmbus: Get rid of unnecessary comments " K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 046/117] Staging: hv: vmbus: Change the variable name openInfo to open_info " K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 047/117] Staging: hv: vmbus: Cleanup error values in ringbuffer.c K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 048/117] Staging: hv: vmbus: Cleanup the error return value in vmbus_recvpacket_raw() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 049/117] Staging: hv: netvsc: Get rid of an unnecessary print statement in netvsc_probe() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 050/117] Staging: hv: vmbus: Retry vmbus_post_msg() before giving up K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 051/117] Staging: hv: storvsc: Cleanup error handling in storvsc_dev_add() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 052/117] Staging: hv: storvsc: Cleanup error handling in storvsc_channel_init() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 053/117] Staging: hv: storvsc: Cleanup error handling in storvsc_connect_to_vsp() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 054/117] Staging: hv: storvsc: Cleanup error handling in storvsc_do_io() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 055/117] Storage: hv: storvsc: Get rid of some unnecessary DPRINTs from storvsc.c K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 056/117] Staging: hv: storvsc: Fix/cleanup some dated comments in storvsc.c K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 057/117] Staging: hv: storvsc: Cleanup returned error code in storvsc_host_reset() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 058/117] Staging: hv: storvsc: Cleanup error code returned in storvsc_probe() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 059/117] Staging: hv: storvsc: Cleanup returned error code in storvsc_drv_init() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 060/117] Staging: hv: netvsc: Cleanup the returned error code in netvsc_probe() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 061/117] Staging: hv: netvsc: Cleanup error return codes in netvsc_destroy_recv_buf() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 062/117] Staging: hv: netvsc: Cleanup error return values in netvsc_init_recv_buf() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 063/117] Staging: hv: netvsc: Cleanup error returns in netvsc_connect_vsp() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 064/117] Staging: hv: netvsc: Cleanup error return values in netvsc_send() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 065/117] Staging: hv: netvsc: Cleanup error return codes in netvsc_device_add() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 066/117] Staging: hv: netvsc: Cleanup error codes in rndis_filter_receive() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 067/117] Staging: hv: netvsc: Cleanup error code in rndis_filter_query_device() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 068/117] Staging: hv: netvsc: Cleanup error return values in rndis_filter_set_packet_filter() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 069/117] Staging: hv: netvsc: Cleanup error returns in rndis_filter_init_device() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 070/117] Staging: hv: netvsc: Cleanup error code in rndis_filter_device_add() K. Y. Srinivasan
2011-07-15 17:46 ` [PATCH 071/117] Staging: hv: mouse: Change the jump label Cleanup to cleanup K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 072/117] Staging: hv: mouse: Get rid of the unused PCI signature K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 073/117] Staging: hv: netvsc: Change the jump label Cleanup to cleanup K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 074/117] Staging: hv: netvsc: Change the jump label Exit to exit K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 075/117] Staging: hv: storvsc: Inline free_stor_device() K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 076/117] Staging: hv: storvsc: Do not aquire an unnecessary reference on stor_device K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 077/117] Staging: hv: storvsc: Rename must_get_stor_device() K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 078/117] Staging: hv: storvsc: Rename get_stor_device() K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 079/117] Staging: hv: storvsc: Cleanup alloc_stor_device() K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 080/117] Staging: hv: storvsc: Introduce state to manage the lifecycle of stor device K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 081/117] Staging: hv: vmbus: Introduce a lock to protect the ext field in hv_device K. Y. Srinivasan
2011-08-23 23:08 ` Greg KH
2011-08-24 0:55 ` KY Srinivasan
2011-08-24 2:58 ` Greg KH
2011-08-24 14:29 ` KY Srinivasan
2011-07-15 17:47 ` [PATCH 082/117] Staging: hv: storvsc: Use the newly introduced lock in accessing ext field K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 083/117] Staging: hv: storvsc: Prevent outgoing traffic when stor dev is destroyed K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 084/117] Staging: hv: storvsc: Get rid of release_stor_device() by inlining the code K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 085/117] Staging: hv: storvsc: Get rid of final_release_stor_device() by inlining code K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 086/117] Staging: hv: storvsc: Leverage the spinlock to manage ref_cnt K. Y. Srinivasan
2011-08-23 23:10 ` Greg KH
2011-08-24 0:58 ` KY Srinivasan
2011-08-24 2:57 ` Greg KH
2011-08-24 16:25 ` KY Srinivasan
2011-08-24 20:17 ` Greg KH
2011-08-24 22:57 ` KY Srinivasan
2011-08-25 2:45 ` Greg KH
2011-07-15 17:47 ` [PATCH 087/117] Staging: hv: storvsc: Further cleanup reference counting of stor_device K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 088/117] Staging: hv: netvsc: Inline the code for free_net_device() K. Y. Srinivasan
2011-07-16 10:33 ` Dan Carpenter
2011-07-16 13:09 ` KY Srinivasan
2011-07-15 17:47 ` K. Y. Srinivasan [this message]
2011-07-15 17:47 ` [PATCH 090/117] Staging: hv: netvsc: Introduce state to manage the lifecycle of net device K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 091/117] Staging: hv: netvsc: Use the newly introduced lock in accessing ext field K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 092/117] Staging: hv: netvsc: Prevent outgoing traffic when netvsc dev is destroyed K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 093/117] Staging: hv: netvsc: Get rid of release_outbound_net_device() by inlining the code K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 094/117] Staging: hv: netvsc: Get rid of release_inbound_net_device() " K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 095/117] Staging: hv: netvsc: Leverage the spinlock to manage refcnt K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 096/117] Staging: hv: netvsc: Further cleanup reference counting of netvsc_device K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 097/117] Staging: hv: storvsc: Add code to handle IDE devices using the storvsc driver K. Y. Srinivasan
2011-07-16 2:04 ` Christoph Hellwig
2011-07-16 12:57 ` KY Srinivasan
2011-07-16 13:01 ` Sasha Levin
2011-07-16 13:12 ` KY Srinivasan
2011-07-16 18:27 ` Christoph Hellwig
2011-07-15 17:47 ` [PATCH 098/117] Staging: hv: storvsc: Handle " K. Y. Srinivasan
2011-07-16 2:05 ` Christoph Hellwig
2011-07-15 17:47 ` [PATCH 099/117] Staging: hv: storvsc: Optimize bounce buffer handling for the "write" case K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 100/117] Staging: hv: storvsc: Optimize the bounce buffer handling in the "read" case K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 101/117] Staging: hv: storvsc: Include storvsc.c in storvsc_drv.c K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 102/117] Staging: hv: storvsc: Cleanup storvsc_drv.c after adding the contents of storvsc.c K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 103/117] Staging: hv: storvsc: Add the contents of hyperv_storage.h to storvsc_drv.c K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 104/117] Staging: hv: storvsc: Cleanup storvsc_drv.c after adding the contents of hyperv_storage.h K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 105/117] Staging: hv: storvsc: Make some non static functions, static functions K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 106/117] Staging: hv: storvsc: Fixup srb and scsi status for INQUIRY and MODE_SENSE K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 107/117] Staging: hv: storvsc: Fix a typo K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 108/117] Staging: hv: storvsc: In case of scsi errors offline the device K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 109/117] Staging: hv: storvsc: No need to copy from bounce buffer in case of a failure K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 110/117] Staging: hv: vmbus: Change the signature of vmbus_child_driver_register() K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 111/117] Staging: hv: vmbus: Change the signature of vmbus_child_driver_unregister() K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 112/117] Staging: hv: util: Forcefully shutdown when shutdown is requested K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 113/117] Staging: hv: util: Adjust guest time in a process context K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 114/117] Staging: hv: vmbus: Check before invoking the channel callback K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 115/117] Staging: hv: vmbus: Properly deal with de-registering " K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 116/117] Staging: hv: vmbus: Add code to display modalias attribute K. Y. Srinivasan
2011-07-15 17:47 ` [PATCH 117/117] Staging: hv: blkvsc: Get rid of blkvsc_drv.c as this code is not used K. Y. Srinivasan
2011-07-15 18:25 ` Large Patch Series in Email (was Re: [PATCH 0000/0117] Staging: hv: Driver cleanup) Michael Witten
2011-07-15 18:50 ` KY Srinivasan
2011-07-15 21:09 ` Dan Carpenter
2011-07-15 22:55 ` Michael Witten
2011-07-15 23:22 ` Large Patch Series in Email David Miller
2011-07-15 23:07 ` Large Patch Series in Email (was Re: [PATCH 0000/0117] Staging: hv: Driver cleanup) Alan Cox
2011-07-17 10:47 ` Florian Mickler
2011-08-23 23:11 ` [PATCH 0000/0117] Staging: hv: Driver cleanup Greg KH
2011-08-24 1:01 ` KY Srinivasan
2011-08-24 3:08 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1310752065-27895-89-git-send-email-kys@microsoft.com \
--to=kys@microsoft.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@suse.de \
--cc=haiyangz@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=virtualization@lists.osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).