[PATCH 7/8] staging/hv: remove typedef STORVSC_DEVICE

Bill Pemberton wfp5p at virginia.edu
Fri Aug 7 19:52:20 UTC 2009


The STORVSC_DEVICE typedef is removed.  The struct it defines is now
named hv_storvsc_device

Signed-off-by: Bill Pemberton <wfp5p at virginia.edu>
---
 drivers/staging/hv/StorVsc.c |   54 +++++++++++++++++++++---------------------
 1 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/hv/StorVsc.c b/drivers/staging/hv/StorVsc.c
index 8614a0a..068125d 100644
--- a/drivers/staging/hv/StorVsc.c
+++ b/drivers/staging/hv/StorVsc.c
@@ -54,7 +54,7 @@ struct hv_storvsc_request_ext {
 
 
 /* A storvsc device is a device object that contains a vmbus channel */
-typedef struct _STORVSC_DEVICE{
+struct hv_storvsc_device {
 	struct hv_device *Device;
 
 	atomic_t RefCount; /* 0 indicates the device is being destroyed */
@@ -77,7 +77,7 @@ typedef struct _STORVSC_DEVICE{
 	struct hv_storvsc_request_ext InitRequest;
 	struct hv_storvsc_request_ext ResetRequest;
 
-} STORVSC_DEVICE;
+};
 
 
 
@@ -144,11 +144,11 @@ StorVscConnectToVsp(
 	struct hv_device *Device
 	);
 
-static inline STORVSC_DEVICE* AllocStorDevice(struct hv_device *Device)
+static inline struct hv_storvsc_device *AllocStorDevice(struct hv_device *Device)
 {
-	STORVSC_DEVICE *storDevice;
+	struct hv_storvsc_device *storDevice;
 
-	storDevice = kzalloc(sizeof(STORVSC_DEVICE), GFP_KERNEL);
+	storDevice = kzalloc(sizeof(*storDevice), GFP_KERNEL);
 	if (!storDevice)
 		return NULL;
 
@@ -162,18 +162,18 @@ static inline STORVSC_DEVICE* AllocStorDevice(struct hv_device *Device)
 	return storDevice;
 }
 
-static inline void FreeStorDevice(STORVSC_DEVICE *Device)
+static inline void FreeStorDevice(struct hv_storvsc_device *Device)
 {
 	ASSERT( atomic_read(&Device->RefCount) == 0);
 	kfree(Device);
 }
 
 /* Get the stordevice object iff exists and its refcount > 1 */
-static inline STORVSC_DEVICE* GetStorDevice(struct hv_device *Device)
+static inline struct hv_storvsc_device *GetStorDevice(struct hv_device *Device)
 {
-	STORVSC_DEVICE *storDevice;
+	struct hv_storvsc_device *storDevice;
 
-	storDevice = (STORVSC_DEVICE*)Device->Extension;
+	storDevice = (struct hv_storvsc_device *)Device->Extension;
 	if (storDevice && atomic_read(&storDevice->RefCount) > 1)
 		atomic_inc(&storDevice->RefCount);
 	else
@@ -183,11 +183,11 @@ static inline STORVSC_DEVICE* GetStorDevice(struct hv_device *Device)
 }
 
 /* Get the stordevice object iff exists and its refcount > 0 */
-static inline STORVSC_DEVICE* MustGetStorDevice(struct hv_device *Device)
+static inline struct hv_storvsc_device *MustGetStorDevice(struct hv_device *Device)
 {
-	STORVSC_DEVICE *storDevice;
+	struct hv_storvsc_device *storDevice;
 
-	storDevice = (STORVSC_DEVICE*)Device->Extension;
+	storDevice = (struct hv_storvsc_device *)Device->Extension;
 	if (storDevice && atomic_read(&storDevice->RefCount))
 		atomic_inc(&storDevice->RefCount);
 	else
@@ -198,9 +198,9 @@ static inline STORVSC_DEVICE* MustGetStorDevice(struct hv_device *Device)
 
 static inline void PutStorDevice(struct hv_device *Device)
 {
-	STORVSC_DEVICE *storDevice;
+	struct hv_storvsc_device *storDevice;
 
-	storDevice = (STORVSC_DEVICE*)Device->Extension;
+	storDevice = (struct hv_storvsc_device *)Device->Extension;
 	ASSERT(storDevice);
 
 	atomic_dec(&storDevice->RefCount);
@@ -208,11 +208,11 @@ static inline void PutStorDevice(struct hv_device *Device)
 }
 
 /* Drop ref count to 1 to effectively disable GetStorDevice() */
-static inline STORVSC_DEVICE* ReleaseStorDevice(struct hv_device *Device)
+static inline struct hv_storvsc_device *ReleaseStorDevice(struct hv_device *Device)
 {
-	STORVSC_DEVICE *storDevice;
+	struct hv_storvsc_device *storDevice;
 
-	storDevice = (STORVSC_DEVICE*)Device->Extension;
+	storDevice = (struct hv_storvsc_device *)Device->Extension;
 	ASSERT(storDevice);
 
 	/* Busy wait until the ref drop to 2, then set it to 1 */
@@ -225,11 +225,11 @@ static inline STORVSC_DEVICE* ReleaseStorDevice(struct hv_device *Device)
 }
 
 /* Drop ref count to 0. No one can use StorDevice object. */
-static inline STORVSC_DEVICE* FinalReleaseStorDevice(struct hv_device *Device)
+static inline struct hv_storvsc_device *FinalReleaseStorDevice(struct hv_device *Device)
 {
-	STORVSC_DEVICE *storDevice;
+	struct hv_storvsc_device *storDevice;
 
-	storDevice = (STORVSC_DEVICE*)Device->Extension;
+	storDevice = (struct hv_storvsc_device *)Device->Extension;
 	ASSERT(storDevice);
 
 	/* Busy wait until the ref drop to 1, then set it to 0 */
@@ -313,7 +313,7 @@ StorVscOnDeviceAdd(
 	)
 {
 	int ret=0;
-	STORVSC_DEVICE *storDevice;
+	struct hv_storvsc_device *storDevice;
 	/* struct hv_vmstor_channel *props; */
 	STORVSC_DEVICE_INFO *deviceInfo = (STORVSC_DEVICE_INFO*)AdditionalInfo;
 
@@ -359,7 +359,7 @@ Cleanup:
 static int StorVscChannelInit(struct hv_device *Device)
 {
 	int ret=0;
-	STORVSC_DEVICE *storDevice;
+	struct hv_storvsc_device *storDevice;
 	struct hv_storvsc_request_ext *request;
 	struct hv_vstor_packet *vstorPacket;
 
@@ -568,7 +568,7 @@ StorVscOnDeviceRemove(
 	struct hv_device *Device
 	)
 {
-	STORVSC_DEVICE *storDevice;
+	struct hv_storvsc_device *storDevice;
 	int ret=0;
 
 	DPRINT_ENTER(STORVSC);
@@ -629,7 +629,7 @@ StorVscOnHostReset(
 {
 	int ret=0;
 
-	STORVSC_DEVICE *storDevice;
+	struct hv_storvsc_device *storDevice;
 	struct hv_storvsc_request_ext *request;
 	struct hv_vstor_packet *vstorPacket;
 
@@ -698,7 +698,7 @@ StorVscOnIORequest(
 	struct hv_storvsc_request *Request
 	)
 {
-	STORVSC_DEVICE *storDevice;
+	struct hv_storvsc_device *storDevice;
 	struct hv_storvsc_request_ext *requestExtension = (struct hv_storvsc_request_ext *) Request->Extension;
 	struct hv_vstor_packet *vstorPacket = &requestExtension->VStorPacket;
 	int ret=0;
@@ -814,7 +814,7 @@ StorVscOnIOCompletion(
 	)
 {
 	struct hv_storvsc_request *request;
-	STORVSC_DEVICE *storDevice;
+	struct hv_storvsc_device *storDevice;
 
 	DPRINT_ENTER(STORVSC);
 
@@ -917,7 +917,7 @@ StorVscOnChannelCallback(
 {
 	int ret=0;
 	struct hv_device *device = (struct hv_device*)Context;
-	STORVSC_DEVICE *storDevice;
+	struct hv_storvsc_device *storDevice;
 	u32 bytesRecvd;
 	u64 requestId;
 	unsigned char packet[ALIGN_UP(sizeof(struct hv_vstor_packet),8)];
-- 
1.6.2.5




More information about the devel mailing list