Commit 0b3f6834 authored by Nicolas Palix's avatar Nicolas Palix Committed by Greg Kroah-Hartman

Staging: hv: Remove typedef STORVSC_REQUEST and PSTORVSC_REQUEST

typedef STORVSC_REQUEST and PSTORVSC_REQUEST are removed and their
usages are replace by the use of struct hv_storvsc_request and
struct hv_storvsc_request * respectively.

Here is the semantic patch generated to perform this transformation:
(http://coccinelle.lip6.fr/)

//<smpl>
@rm_STORVSC_REQUEST@
@@
-typedef struct _STORVSC_REQUEST
+struct hv_storvsc_request
{...}
-STORVSC_REQUEST
;

@rm_PSTORVSC_REQUEST@
@@
-typedef struct _STORVSC_REQUEST *PSTORVSC_REQUEST;
+struct hv_storvsc_request;

@fixtypedef_STORVSC_REQUEST@
typedef STORVSC_REQUEST;
@@
-STORVSC_REQUEST
+struct hv_storvsc_request

@fixstruct__STORVSC_REQUEST@
@@
struct
-_STORVSC_REQUEST
+hv_storvsc_request

@fixtypedef_PSTORVSC_REQUEST@
typedef PSTORVSC_REQUEST;
@@
-PSTORVSC_REQUEST
+struct hv_storvsc_request*
//</smpl>
Signed-off-by: default avatarNicolas Palix <npalix@diku.dk>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4193d4f4
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
typedef struct _STORVSC_REQUEST_EXTENSION { typedef struct _STORVSC_REQUEST_EXTENSION {
/* LIST_ENTRY ListEntry; */ /* LIST_ENTRY ListEntry; */
STORVSC_REQUEST *Request; struct hv_storvsc_request *Request;
struct hv_device *Device; struct hv_device *Device;
/* Synchronize the request/response if needed */ /* Synchronize the request/response if needed */
...@@ -108,7 +108,7 @@ StorVscOnDeviceRemove( ...@@ -108,7 +108,7 @@ StorVscOnDeviceRemove(
static int static int
StorVscOnIORequest( StorVscOnIORequest(
struct hv_device *Device, struct hv_device *Device,
STORVSC_REQUEST *Request struct hv_storvsc_request *Request
); );
static int static int
...@@ -272,7 +272,7 @@ StorVscInitialize( ...@@ -272,7 +272,7 @@ StorVscInitialize(
DPRINT_ENTER(STORVSC); DPRINT_ENTER(STORVSC);
DPRINT_DBG(STORVSC, "sizeof(STORVSC_REQUEST)=%zd sizeof(STORVSC_REQUEST_EXTENSION)=%zd sizeof(VSTOR_PACKET)=%zd, sizeof(VMSCSI_REQUEST)=%zd", DPRINT_DBG(STORVSC, "sizeof(STORVSC_REQUEST)=%zd sizeof(STORVSC_REQUEST_EXTENSION)=%zd sizeof(VSTOR_PACKET)=%zd, sizeof(VMSCSI_REQUEST)=%zd",
sizeof(STORVSC_REQUEST), sizeof(STORVSC_REQUEST_EXTENSION), sizeof(VSTOR_PACKET), sizeof(VMSCSI_REQUEST)); sizeof(struct hv_storvsc_request), sizeof(STORVSC_REQUEST_EXTENSION), sizeof(VSTOR_PACKET), sizeof(VMSCSI_REQUEST));
/* Make sure we are at least 2 pages since 1 page is used for control */ /* Make sure we are at least 2 pages since 1 page is used for control */
ASSERT(storDriver->RingBufferSize >= (PAGE_SIZE << 1)); ASSERT(storDriver->RingBufferSize >= (PAGE_SIZE << 1));
...@@ -704,7 +704,7 @@ StorVscOnHostReset( ...@@ -704,7 +704,7 @@ StorVscOnHostReset(
int int
StorVscOnIORequest( StorVscOnIORequest(
struct hv_device *Device, struct hv_device *Device,
STORVSC_REQUEST *Request struct hv_storvsc_request *Request
) )
{ {
STORVSC_DEVICE *storDevice; STORVSC_DEVICE *storDevice;
...@@ -822,7 +822,7 @@ StorVscOnIOCompletion( ...@@ -822,7 +822,7 @@ StorVscOnIOCompletion(
STORVSC_REQUEST_EXTENSION *RequestExt STORVSC_REQUEST_EXTENSION *RequestExt
) )
{ {
STORVSC_REQUEST *request; struct hv_storvsc_request *request;
STORVSC_DEVICE *storDevice; STORVSC_DEVICE *storDevice;
DPRINT_ENTER(STORVSC); DPRINT_ENTER(STORVSC);
......
...@@ -54,7 +54,7 @@ enum blkvsc_device_type { ...@@ -54,7 +54,7 @@ enum blkvsc_device_type {
/* /*
* This request ties the struct request and struct * This request ties the struct request and struct
* blkvsc_request/STORVSC_REQUEST together A struct request may be * blkvsc_request/hv_storvsc_request together A struct request may be
* represented by 1 or more struct blkvsc_request * represented by 1 or more struct blkvsc_request
*/ */
struct blkvsc_request_group { struct blkvsc_request_group {
...@@ -85,7 +85,7 @@ struct blkvsc_request { ...@@ -85,7 +85,7 @@ struct blkvsc_request {
unsigned char cmd_len; unsigned char cmd_len;
unsigned char cmnd[MAX_COMMAND_SIZE]; unsigned char cmnd[MAX_COMMAND_SIZE];
STORVSC_REQUEST request; struct hv_storvsc_request request;
/* !!!DO NOT ADD ANYTHING BELOW HERE!!! Otherwise, memory can overlap, because - */ /* !!!DO NOT ADD ANYTHING BELOW HERE!!! Otherwise, memory can overlap, because - */
/* The extension buffer falls right here and is pointed to by request.Extension; */ /* The extension buffer falls right here and is pointed to by request.Extension; */
}; };
...@@ -132,11 +132,11 @@ static int blkvsc_getgeo(struct block_device *bd, struct hd_geometry *hg); ...@@ -132,11 +132,11 @@ static int blkvsc_getgeo(struct block_device *bd, struct hd_geometry *hg);
static int blkvsc_ioctl(struct block_device *bd, fmode_t mode, static int blkvsc_ioctl(struct block_device *bd, fmode_t mode,
unsigned cmd, unsigned long argument); unsigned cmd, unsigned long argument);
static void blkvsc_request(struct request_queue *queue); static void blkvsc_request(struct request_queue *queue);
static void blkvsc_request_completion(STORVSC_REQUEST* request); static void blkvsc_request_completion(struct hv_storvsc_request *request);
static int blkvsc_do_request(struct block_device_context *blkdev, struct request *req); static int blkvsc_do_request(struct block_device_context *blkdev, struct request *req);
static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req, void (*request_completion)(STORVSC_REQUEST*) ); static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req, void (*request_completion)(struct hv_storvsc_request*) );
static void blkvsc_init_rw(struct blkvsc_request *blkvsc_req); static void blkvsc_init_rw(struct blkvsc_request *blkvsc_req);
static void blkvsc_cmd_completion(STORVSC_REQUEST* request); static void blkvsc_cmd_completion(struct hv_storvsc_request *request);
static int blkvsc_do_inquiry(struct block_device_context *blkdev); static int blkvsc_do_inquiry(struct block_device_context *blkdev);
static int blkvsc_do_read_capacity(struct block_device_context *blkdev); static int blkvsc_do_read_capacity(struct block_device_context *blkdev);
static int blkvsc_do_read_capacity16(struct block_device_context *blkdev); static int blkvsc_do_read_capacity16(struct block_device_context *blkdev);
...@@ -900,7 +900,7 @@ static void blkvsc_init_rw(struct blkvsc_request *blkvsc_req) ...@@ -900,7 +900,7 @@ static void blkvsc_init_rw(struct blkvsc_request *blkvsc_req)
} }
} }
static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req, void (*request_completion)(STORVSC_REQUEST*) ) static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req, void (*request_completion)(struct hv_storvsc_request*) )
{ {
struct block_device_context *blkdev = blkvsc_req->dev; struct block_device_context *blkdev = blkvsc_req->dev;
struct device_context *device_ctx=blkdev->device_ctx; struct device_context *device_ctx=blkdev->device_ctx;
...@@ -909,7 +909,7 @@ static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req, void (*reque ...@@ -909,7 +909,7 @@ static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req, void (*reque
STORVSC_DRIVER_OBJECT* storvsc_drv_obj = &blkvsc_drv_ctx->drv_obj; STORVSC_DRIVER_OBJECT* storvsc_drv_obj = &blkvsc_drv_ctx->drv_obj;
int ret =0; int ret =0;
STORVSC_REQUEST *storvsc_req; struct hv_storvsc_request *storvsc_req;
DPRINT_DBG(BLKVSC_DRV, "blkvsc_submit_request() - req %p type %s start_sector %lu count %ld offset %d len %d\n", DPRINT_DBG(BLKVSC_DRV, "blkvsc_submit_request() - req %p type %s start_sector %lu count %ld offset %d len %d\n",
blkvsc_req, blkvsc_req,
...@@ -1104,7 +1104,7 @@ static int blkvsc_do_request(struct block_device_context *blkdev, struct request ...@@ -1104,7 +1104,7 @@ static int blkvsc_do_request(struct block_device_context *blkdev, struct request
return pending; return pending;
} }
static void blkvsc_cmd_completion(STORVSC_REQUEST* request) static void blkvsc_cmd_completion(struct hv_storvsc_request *request)
{ {
struct blkvsc_request *blkvsc_req=(struct blkvsc_request*)request->Context; struct blkvsc_request *blkvsc_req=(struct blkvsc_request*)request->Context;
struct block_device_context *blkdev = (struct block_device_context*)blkvsc_req->dev; struct block_device_context *blkdev = (struct block_device_context*)blkvsc_req->dev;
...@@ -1127,7 +1127,7 @@ static void blkvsc_cmd_completion(STORVSC_REQUEST* request) ...@@ -1127,7 +1127,7 @@ static void blkvsc_cmd_completion(STORVSC_REQUEST* request)
wake_up_interruptible(&blkvsc_req->wevent); wake_up_interruptible(&blkvsc_req->wevent);
} }
static void blkvsc_request_completion(STORVSC_REQUEST* request) static void blkvsc_request_completion(struct hv_storvsc_request *request)
{ {
struct blkvsc_request *blkvsc_req=(struct blkvsc_request*)request->Context; struct blkvsc_request *blkvsc_req=(struct blkvsc_request*)request->Context;
struct block_device_context *blkdev = (struct block_device_context*)blkvsc_req->dev; struct block_device_context *blkdev = (struct block_device_context*)blkvsc_req->dev;
......
...@@ -51,13 +51,13 @@ ...@@ -51,13 +51,13 @@
/* Fwd decl */ /* Fwd decl */
/* struct VMBUS_CHANNEL; */ /* struct VMBUS_CHANNEL; */
typedef struct _STORVSC_REQUEST* PSTORVSC_REQUEST; struct hv_storvsc_request;
/* Data types */ /* Data types */
typedef int (*PFN_ON_IO_REQUEST)(struct hv_device *Device, PSTORVSC_REQUEST Request); typedef int (*PFN_ON_IO_REQUEST)(struct hv_device *Device, struct hv_storvsc_request *Request);
typedef void (*PFN_ON_IO_REQUEST_COMPLTN)(PSTORVSC_REQUEST Request); typedef void (*PFN_ON_IO_REQUEST_COMPLTN)(struct hv_storvsc_request *Request);
typedef int (*PFN_ON_HOST_RESET)(struct hv_device *Device); typedef int (*PFN_ON_HOST_RESET)(struct hv_device *Device);
typedef void (*PFN_ON_HOST_RESCAN)(struct hv_device *Device); typedef void (*PFN_ON_HOST_RESCAN)(struct hv_device *Device);
...@@ -71,7 +71,7 @@ typedef enum _STORVSC_REQUEST_TYPE{ ...@@ -71,7 +71,7 @@ typedef enum _STORVSC_REQUEST_TYPE{
} STORVSC_REQUEST_TYPE; } STORVSC_REQUEST_TYPE;
typedef struct _STORVSC_REQUEST { struct hv_storvsc_request {
STORVSC_REQUEST_TYPE Type; STORVSC_REQUEST_TYPE Type;
u32 Host; u32 Host;
u32 Bus; u32 Bus;
...@@ -93,7 +93,7 @@ typedef struct _STORVSC_REQUEST { ...@@ -93,7 +93,7 @@ typedef struct _STORVSC_REQUEST {
void * Extension; void * Extension;
MULTIPAGE_BUFFER DataBuffer; MULTIPAGE_BUFFER DataBuffer;
} STORVSC_REQUEST; };
/* Represents the block vsc driver */ /* Represents the block vsc driver */
......
...@@ -64,7 +64,7 @@ struct storvsc_cmd_request { ...@@ -64,7 +64,7 @@ struct storvsc_cmd_request {
unsigned int bounce_sgl_count; unsigned int bounce_sgl_count;
struct scatterlist *bounce_sgl; struct scatterlist *bounce_sgl;
STORVSC_REQUEST request; struct hv_storvsc_request request;
/* !!!DO NOT ADD ANYTHING BELOW HERE!!! */ /* !!!DO NOT ADD ANYTHING BELOW HERE!!! */
/* The extension buffer falls right here and is pointed to by request.Extension; */ /* The extension buffer falls right here and is pointed to by request.Extension; */
}; };
...@@ -388,7 +388,7 @@ Name: storvsc_commmand_completion() ...@@ -388,7 +388,7 @@ Name: storvsc_commmand_completion()
Desc: Command completion processing Desc: Command completion processing
--*/ --*/
static void storvsc_commmand_completion(STORVSC_REQUEST* request) static void storvsc_commmand_completion(struct hv_storvsc_request *request)
{ {
struct storvsc_cmd_request *cmd_request = (struct storvsc_cmd_request*)request->Context; struct storvsc_cmd_request *cmd_request = (struct storvsc_cmd_request*)request->Context;
struct scsi_cmnd *scmnd = cmd_request->cmd; struct scsi_cmnd *scmnd = cmd_request->cmd;
...@@ -667,7 +667,7 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd, void (*done)(struct scs ...@@ -667,7 +667,7 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd, void (*done)(struct scs
struct storvsc_driver_context *storvsc_drv_ctx = (struct storvsc_driver_context*)driver_ctx; struct storvsc_driver_context *storvsc_drv_ctx = (struct storvsc_driver_context*)driver_ctx;
STORVSC_DRIVER_OBJECT* storvsc_drv_obj = &storvsc_drv_ctx->drv_obj; STORVSC_DRIVER_OBJECT* storvsc_drv_obj = &storvsc_drv_ctx->drv_obj;
STORVSC_REQUEST *request; struct hv_storvsc_request *request;
struct storvsc_cmd_request *cmd_request; struct storvsc_cmd_request *cmd_request;
unsigned int request_size=0; unsigned int request_size=0;
int i; int i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment