[PATCH 11/13] staging/hv: use struct storvsc_request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Joe Perches <joe at perches.com>
---
 drivers/staging/hv/StorVsc.c            |   12 ++++++------
 drivers/staging/hv/blkvsc_drv.c         |   18 +++++++++---------
 drivers/staging/hv/include/StorVscApi.h |   11 +++++------
 drivers/staging/hv/storvsc_drv.c        |    6 +++---
 4 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/hv/StorVsc.c b/drivers/staging/hv/StorVsc.c
index 7975d0a..7270c2e 100644
--- a/drivers/staging/hv/StorVsc.c
+++ b/drivers/staging/hv/StorVsc.c
@@ -38,7 +38,7 @@
 typedef struct _STORVSC_REQUEST_EXTENSION {
 	/* LIST_ENTRY                                           ListEntry; */
 
-	STORVSC_REQUEST *Request;
+	struct storvsc_request *Request;
 	struct hv_device *Device;
 
 	/* Synchronize the request/response if needed */
@@ -92,7 +92,7 @@ static int StorVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo);
 static int StorVscOnDeviceRemove(struct hv_device *Device);
 
 static int
-StorVscOnIORequest(struct hv_device *Device, STORVSC_REQUEST * Request);
+StorVscOnIORequest(struct hv_device *Device, struct storvsc_request *Request);
 
 static int StorVscOnHostReset(struct hv_device *Device);
 
@@ -227,8 +227,8 @@ int StorVscInitialize(struct driver_object *Driver)
 	DPRINT_ENTER(STORVSC);
 
 	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(struct storvsc_request)=%zd sizeof(STORVSC_REQUEST_EXTENSION)=%zd sizeof(VSTOR_PACKET)=%zd, sizeof(VMSCSI_REQUEST)=%zd",
+		   sizeof(struct 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 */
@@ -676,7 +676,7 @@ Description:
 	Callback to initiate an I/O request
 
 --*/
-int StorVscOnIORequest(struct hv_device *Device, STORVSC_REQUEST * Request)
+int StorVscOnIORequest(struct hv_device *Device, struct storvsc_request *Request)
 {
 	STORVSC_DEVICE *storDevice;
 	STORVSC_REQUEST_EXTENSION *requestExtension =
@@ -790,7 +790,7 @@ StorVscOnIOCompletion(struct hv_device *Device,
 		      VSTOR_PACKET * VStorPacket,
 		      STORVSC_REQUEST_EXTENSION * RequestExt)
 {
-	STORVSC_REQUEST *request;
+	struct storvsc_request *request;
 	STORVSC_DEVICE *storDevice;
 
 	DPRINT_ENTER(STORVSC);
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index efce2c9..31498ed 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -52,7 +52,7 @@ enum blkvsc_device_type {
 
 /*
  * This request ties the struct request and struct
- * blkvsc_request/STORVSC_REQUEST together A struct request may be
+ * blkvsc_request/struct storvsc_request together A struct request may be
  * represented by 1 or more struct blkvsc_request
  */
 struct blkvsc_request_group {
@@ -82,7 +82,7 @@ struct blkvsc_request {
 	unsigned char cmd_len;
 	unsigned char cmnd[MAX_COMMAND_SIZE];
 
-	STORVSC_REQUEST request;
+	struct storvsc_request request;
 	/* !!!DO NOT ADD ANYTHING BELOW HERE!!! Otherwise, memory can overlap, because - */
 	/* The extension buffer falls right here and is pointed to by request.Extension; */
 };
@@ -129,14 +129,14 @@ static int blkvsc_getgeo(struct block_device *bd, struct hd_geometry *hg);
 static int blkvsc_ioctl(struct block_device *bd, fmode_t mode,
 			unsigned cmd, unsigned long argument);
 static void blkvsc_request(struct request_queue *queue);
-static void blkvsc_request_completion(STORVSC_REQUEST * request);
+static void blkvsc_request_completion(struct storvsc_request *request);
 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
+				 void (*request_completion) (struct storvsc_request
 							     *));
 static void blkvsc_init_rw(struct blkvsc_request *blkvsc_req);
-static void blkvsc_cmd_completion(STORVSC_REQUEST * request);
+static void blkvsc_cmd_completion(struct storvsc_request *request);
 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_capacity16(struct block_device_context *blkdev);
@@ -874,7 +874,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 *))
+				 void (*request_completion) (struct storvsc_request *))
 {
 	struct block_device_context *blkdev = blkvsc_req->dev;
 	struct device_context *device_ctx = blkdev->device_ctx;
@@ -885,7 +885,7 @@ static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req,
 	STORVSC_DRIVER_OBJECT *storvsc_drv_obj = &blkvsc_drv_ctx->drv_obj;
 	int ret = 0;
 
-	STORVSC_REQUEST *storvsc_req;
+	struct 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",
@@ -1118,7 +1118,7 @@ static int blkvsc_do_request(struct block_device_context *blkdev,
 	return pending;
 }
 
-static void blkvsc_cmd_completion(STORVSC_REQUEST * request)
+static void blkvsc_cmd_completion(struct storvsc_request *request)
 {
 	struct blkvsc_request *blkvsc_req =
 	    (struct blkvsc_request *)request->Context;
@@ -1144,7 +1144,7 @@ static void blkvsc_cmd_completion(STORVSC_REQUEST * request)
 	wake_up_interruptible(&blkvsc_req->wevent);
 }
 
-static void blkvsc_request_completion(STORVSC_REQUEST * request)
+static void blkvsc_request_completion(struct storvsc_request *request)
 {
 	struct blkvsc_request *blkvsc_req =
 	    (struct blkvsc_request *)request->Context;
diff --git a/drivers/staging/hv/include/StorVscApi.h b/drivers/staging/hv/include/StorVscApi.h
index f0cfeba..61e2bf1 100644
--- a/drivers/staging/hv/include/StorVscApi.h
+++ b/drivers/staging/hv/include/StorVscApi.h
@@ -46,14 +46,13 @@
 
 /* Fwd decl */
 
-/* struct struct vmbus_channel; */
-typedef struct _STORVSC_REQUEST *PSTORVSC_REQUEST;
+struct storvsc_request;
 
 /* Data types */
 
 typedef int (*PFN_ON_IO_REQUEST) (struct hv_device * Device,
-				  PSTORVSC_REQUEST Request);
-typedef void (*PFN_ON_IO_REQUEST_COMPLTN) (PSTORVSC_REQUEST Request);
+				  struct storvsc_request *Request);
+typedef void (*PFN_ON_IO_REQUEST_COMPLTN) (struct storvsc_request *Request);
 
 typedef int (*PFN_ON_HOST_RESET) (struct hv_device * Device);
 typedef void (*PFN_ON_HOST_RESCAN) (struct hv_device * Device);
@@ -65,7 +64,7 @@ typedef enum _STORVSC_REQUEST_TYPE {
 	UNKNOWN_TYPE,
 } STORVSC_REQUEST_TYPE;
 
-typedef struct _STORVSC_REQUEST {
+struct storvsc_request {
 	STORVSC_REQUEST_TYPE Type;
 	u32 Host;
 	u32 Bus;
@@ -87,7 +86,7 @@ typedef struct _STORVSC_REQUEST {
 	void *Extension;
 
 	struct multipage_buffer DataBuffer;
-} STORVSC_REQUEST;
+};
 
 /* Represents the block vsc driver */
 typedef struct _STORVSC_DRIVER_OBJECT {
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index f25db63..678a2b3 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -61,7 +61,7 @@ struct storvsc_cmd_request {
 	unsigned int bounce_sgl_count;
 	struct scatterlist *bounce_sgl;
 
-	STORVSC_REQUEST request;
+	struct storvsc_request request;
 	/* !!!DO NOT ADD ANYTHING BELOW HERE!!! */
 	/* The extension buffer falls right here and is pointed to by request.Extension; */
 };
@@ -396,7 +396,7 @@ Name:	storvsc_commmand_completion()
 Desc:	Command completion processing
 
 --*/
-static void storvsc_commmand_completion(STORVSC_REQUEST * request)
+static void storvsc_commmand_completion(struct storvsc_request *request)
 {
 	struct storvsc_cmd_request *cmd_request =
 	    (struct storvsc_cmd_request *)request->Context;
@@ -682,7 +682,7 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd,
 	    (struct storvsc_driver_context *)driver_ctx;
 	STORVSC_DRIVER_OBJECT *storvsc_drv_obj = &storvsc_drv_ctx->drv_obj;
 
-	STORVSC_REQUEST *request;
+	struct storvsc_request *request;
 	struct storvsc_cmd_request *cmd_request;
 	unsigned int request_size = 0;
 	int i;
-- 
1.6.3.1.10.g659a0.dirty



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux