summaryrefslogtreecommitdiff
path: root/drivers/staging/hv/StorVsc.c
diff options
context:
space:
mode:
authorNicolas Palix <npalix@diku.dk>2009-07-28 15:32:53 (GMT)
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 19:01:51 (GMT)
commit3d3b5518a35fa3c31b74224d944cbc83302c5ab4 (patch)
treeb58f07d29492df39332ad60c4a3dff055dbf5609 /drivers/staging/hv/StorVsc.c
parentdf8d9b1f6deb468dd6752f0cd1029157c15248fd (diff)
downloadlinux-fsl-qoriq-3d3b5518a35fa3c31b74224d944cbc83302c5ab4.tar.xz
Staging: hv: Transform PDEVICE_OBJECT and DEVICE_OBJECT typedefs into their corresponding structs
Remove typedef DEVICE_OBJECT and use a struct named hv_device instead. Remove typedef PDEVICE_OBJECT which aliases a pointer and use struct hv_device * instead. Here is the semantic patch to perform this transformation: (http://coccinelle.lip6.fr/) //<smpl> @rm_PDEVICE_OBJECT@ @@ -typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT; @rm_DEVICE_OBJECT@ @@ -typedef struct _DEVICE_OBJECT +struct hv_device {...} -DEVICE_OBJECT ; @fixtypedef_PDEVICE_OBJECT@ typedef PDEVICE_OBJECT; @@ -PDEVICE_OBJECT +struct hv_device* @fixtypedef_DEVICE_OBJECT@ typedef DEVICE_OBJECT; @@ -DEVICE_OBJECT +struct hv_device @fixstruct__DEVICE_OBJECT@ @@ struct -_DEVICE_OBJECT +hv_device //</smpl> Signed-off-by: Nicolas Palix <npalix@diku.dk> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/hv/StorVsc.c')
-rw-r--r--drivers/staging/hv/StorVsc.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/drivers/staging/hv/StorVsc.c b/drivers/staging/hv/StorVsc.c
index 50057e6..26d3f14 100644
--- a/drivers/staging/hv/StorVsc.c
+++ b/drivers/staging/hv/StorVsc.c
@@ -44,7 +44,7 @@ typedef struct _STORVSC_REQUEST_EXTENSION {
/* LIST_ENTRY ListEntry; */
STORVSC_REQUEST *Request;
- DEVICE_OBJECT *Device;
+ struct hv_device *Device;
/* Synchronize the request/response if needed */
HANDLE WaitEvent;
@@ -55,7 +55,7 @@ typedef struct _STORVSC_REQUEST_EXTENSION {
/* A storvsc device is a device object that contains a vmbus channel */
typedef struct _STORVSC_DEVICE{
- DEVICE_OBJECT *Device;
+ struct hv_device *Device;
int RefCount; /* 0 indicates the device is being destroyed */
@@ -96,24 +96,24 @@ static const GUID gStorVscDeviceType={
static int
StorVscOnDeviceAdd(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
void *AdditionalInfo
);
static int
StorVscOnDeviceRemove(
- DEVICE_OBJECT *Device
+ struct hv_device *Device
);
static int
StorVscOnIORequest(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
STORVSC_REQUEST *Request
);
static int
StorVscOnHostReset(
- DEVICE_OBJECT *Device
+ struct hv_device *Device
);
static void
@@ -128,24 +128,24 @@ StorVscOnChannelCallback(
static void
StorVscOnIOCompletion(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
VSTOR_PACKET *VStorPacket,
STORVSC_REQUEST_EXTENSION *RequestExt
);
static void
StorVscOnReceive(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
VSTOR_PACKET *VStorPacket,
STORVSC_REQUEST_EXTENSION *RequestExt
);
static int
StorVscConnectToVsp(
- DEVICE_OBJECT *Device
+ struct hv_device *Device
);
-static inline STORVSC_DEVICE* AllocStorDevice(DEVICE_OBJECT *Device)
+static inline STORVSC_DEVICE* AllocStorDevice(struct hv_device *Device)
{
STORVSC_DEVICE *storDevice;
@@ -170,7 +170,7 @@ static inline void FreeStorDevice(STORVSC_DEVICE *Device)
}
/* Get the stordevice object iff exists and its refcount > 1 */
-static inline STORVSC_DEVICE* GetStorDevice(DEVICE_OBJECT *Device)
+static inline STORVSC_DEVICE* GetStorDevice(struct hv_device *Device)
{
STORVSC_DEVICE *storDevice;
@@ -188,7 +188,7 @@ static inline STORVSC_DEVICE* GetStorDevice(DEVICE_OBJECT *Device)
}
/* Get the stordevice object iff exists and its refcount > 0 */
-static inline STORVSC_DEVICE* MustGetStorDevice(DEVICE_OBJECT *Device)
+static inline STORVSC_DEVICE* MustGetStorDevice(struct hv_device *Device)
{
STORVSC_DEVICE *storDevice;
@@ -205,7 +205,7 @@ static inline STORVSC_DEVICE* MustGetStorDevice(DEVICE_OBJECT *Device)
return storDevice;
}
-static inline void PutStorDevice(DEVICE_OBJECT *Device)
+static inline void PutStorDevice(struct hv_device *Device)
{
STORVSC_DEVICE *storDevice;
@@ -217,7 +217,7 @@ static inline void PutStorDevice(DEVICE_OBJECT *Device)
}
/* Drop ref count to 1 to effectively disable GetStorDevice() */
-static inline STORVSC_DEVICE* ReleaseStorDevice(DEVICE_OBJECT *Device)
+static inline STORVSC_DEVICE* ReleaseStorDevice(struct hv_device *Device)
{
STORVSC_DEVICE *storDevice;
@@ -234,7 +234,7 @@ static inline STORVSC_DEVICE* ReleaseStorDevice(DEVICE_OBJECT *Device)
}
/* Drop ref count to 0. No one can use StorDevice object. */
-static inline STORVSC_DEVICE* FinalReleaseStorDevice(DEVICE_OBJECT *Device)
+static inline STORVSC_DEVICE* FinalReleaseStorDevice(struct hv_device *Device)
{
STORVSC_DEVICE *storDevice;
@@ -317,7 +317,7 @@ Description:
--*/
int
StorVscOnDeviceAdd(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
void *AdditionalInfo
)
{
@@ -365,7 +365,7 @@ Cleanup:
return ret;
}
-static int StorVscChannelInit(DEVICE_OBJECT *Device)
+static int StorVscChannelInit(struct hv_device *Device)
{
int ret=0;
STORVSC_DEVICE *storDevice;
@@ -529,7 +529,7 @@ Cleanup:
int
StorVscConnectToVsp(
- DEVICE_OBJECT *Device
+ struct hv_device *Device
)
{
int ret=0;
@@ -574,7 +574,7 @@ Description:
--*/
int
StorVscOnDeviceRemove(
- DEVICE_OBJECT *Device
+ struct hv_device *Device
)
{
STORVSC_DEVICE *storDevice;
@@ -619,7 +619,7 @@ StorVscOnTargetRescan(
void *Context
)
{
-DEVICE_OBJECT *device=(DEVICE_OBJECT*)Context;
+struct hv_device *device=(struct hv_device *)Context;
STORVSC_DRIVER_OBJECT *storDriver;
DPRINT_ENTER(STORVSC);
@@ -633,7 +633,7 @@ DPRINT_EXIT(STORVSC);
int
StorVscOnHostReset(
- DEVICE_OBJECT *Device
+ struct hv_device *Device
)
{
int ret=0;
@@ -703,7 +703,7 @@ Description:
--*/
int
StorVscOnIORequest(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
STORVSC_REQUEST *Request
)
{
@@ -817,7 +817,7 @@ StorVscOnCleanup(
static void
StorVscOnIOCompletion(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
VSTOR_PACKET *VStorPacket,
STORVSC_REQUEST_EXTENSION *RequestExt
)
@@ -887,7 +887,7 @@ StorVscOnIOCompletion(
static void
StorVscOnReceive(
- DEVICE_OBJECT *Device,
+ struct hv_device *Device,
VSTOR_PACKET *VStorPacket,
STORVSC_REQUEST_EXTENSION *RequestExt
)
@@ -925,7 +925,7 @@ StorVscOnChannelCallback(
)
{
int ret=0;
- DEVICE_OBJECT *device = (DEVICE_OBJECT*)Context;
+ struct hv_device *device = (struct hv_device*)Context;
STORVSC_DEVICE *storDevice;
u32 bytesRecvd;
u64 requestId;