Skip to contentSkip to conversation

Staging: hv: Rename driver_context to hyperv_driver

PATCH In review K. Y. Srinivasan 2 participants 2 messages Feb 26, 2011 – Mar 1, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/6 Staging: hv: Rename driver_context to hyperv_driver

The title says it all.

---
 drivers/staging/hv/blkvsc.c       |    2 +-
 drivers/staging/hv/blkvsc_drv.c   |   36 ++++++++++++------------
 drivers/staging/hv/netvsc.c       |    6 ++--
 drivers/staging/hv/netvsc_api.h   |    4 +-
 drivers/staging/hv/netvsc_drv.c   |   36 ++++++++++++------------
 drivers/staging/hv/rndis_filter.c |    4 +-
 drivers/staging/hv/storvsc.c      |    4 +-
 drivers/staging/hv/storvsc_api.h  |    6 ++--
 drivers/staging/hv/storvsc_drv.c  |   36 ++++++++++++------------
 drivers/staging/hv/vmbus.h        |   15 +++++-----
 drivers/staging/hv/vmbus_api.h    |    2 +-
 drivers/staging/hv/vmbus_drv.c    |   54 ++++++++++++++++++------------------
 12 files changed, 103 insertions(+), 102 deletions(-)
drivers/staging/hv/blkvsc.c +1 -1
index d29af4b..51d4dfa 100644
@@ -63,7 +63,7 @@ blk_vsc_on_device_add(struct hyperv_device *device, void *additional_info)
 	return ret;
 }
 
-int blk_vsc_initialize(struct driver_context *driver)
+int blk_vsc_initialize(struct hyperv_driver *driver)
 {
 	struct storvsc_driver_object *stor_driver;
 	int ret = 0;
drivers/staging/hv/blkvsc_drv.c +18 -18
index a280f83..ceba20c 100644
@@ -116,10 +116,10 @@ struct block_device_context {
 };
 
 /* Per driver */
-struct blkvsc_driver_context {
+struct blkvsc_hyperv_driver {
 	/* !! These must be the first 2 fields !! */
 	/* FIXME this is a bug! */
-	struct driver_context drv_ctx;
+	struct hyperv_driver drv_ctx;
 	struct storvsc_driver_object drv_obj;
 };
 
@@ -156,7 +156,7 @@ module_param(blkvsc_ringbuffer_size, int, S_IRUGO);
 MODULE_PARM_DESC(ring_size, "Ring buffer size (in bytes)");
 
 /* The one and only one */
-static struct blkvsc_driver_context g_blkvsc_drv;
+static struct blkvsc_hyperv_driver g_blkvsc_drv;
 
 static const struct block_device_operations block_ops = {
 	.owner = THIS_MODULE,
@@ -171,10 +171,10 @@ static const struct block_device_operations block_ops = {
 /*
  * blkvsc_drv_init -  BlkVsc driver initialization.
  */
-static int blkvsc_drv_init(int (*drv_init)(struct driver_context *drv))
+static int blkvsc_drv_init(int (*drv_init)(struct hyperv_driver *drv))
 {
 	struct storvsc_driver_object *storvsc_drv_obj = &g_blkvsc_drv.drv_obj;
-	struct driver_context *drv_ctx = &g_blkvsc_drv.drv_ctx;
+	struct hyperv_driver *drv_ctx = &g_blkvsc_drv.drv_ctx;
 	int ret;
 
 	storvsc_drv_obj->ring_buffer_size = blkvsc_ringbuffer_size;
@@ -206,7 +206,7 @@ static int blkvsc_drv_exit_cb(struct device *dev, void *data)
 static void blkvsc_drv_exit(void)
 {
 	struct storvsc_driver_object *storvsc_drv_obj = &g_blkvsc_drv.drv_obj;
-	struct driver_context *drv_ctx = &g_blkvsc_drv.drv_ctx;
+	struct hyperv_driver *drv_ctx = &g_blkvsc_drv.drv_ctx;
 	struct device *current_dev;
 	int ret;
 
@@ -243,10 +243,10 @@ static void blkvsc_drv_exit(void)
  */
 static int blkvsc_probe(struct device *device)
 {
-	struct driver_context *driver_ctx =
-				driver_to_driver_context(device->driver);
-	struct blkvsc_driver_context *blkvsc_drv_ctx =
-				(struct blkvsc_driver_context *)driver_ctx;
+	struct hyperv_driver *driver_ctx =
+				driver_to_hyperv_driver(device->driver);
+	struct blkvsc_hyperv_driver *blkvsc_drv_ctx =
+				(struct blkvsc_hyperv_driver *)driver_ctx;
 	struct storvsc_driver_object *storvsc_drv_obj =
 				&blkvsc_drv_ctx->drv_obj;
 	struct hyperv_device *device_obj = device_to_hyperv_device(device);
@@ -727,10 +727,10 @@ static int blkvsc_do_read_capacity16(struct block_device_context *blkdev)
  */
 static int blkvsc_remove(struct device *device)
 {
-	struct driver_context *driver_ctx =
-				driver_to_driver_context(device->driver);
-	struct blkvsc_driver_context *blkvsc_drv_ctx =
-				(struct blkvsc_driver_context *)driver_ctx;
+	struct hyperv_driver *driver_ctx =
+				driver_to_hyperv_driver(device->driver);
+	struct blkvsc_hyperv_driver *blkvsc_drv_ctx =
+				(struct blkvsc_hyperv_driver *)driver_ctx;
 	struct storvsc_driver_object *storvsc_drv_obj =
 				&blkvsc_drv_ctx->drv_obj;
 	struct hyperv_device *device_obj = device_to_hyperv_device(device);
@@ -849,10 +849,10 @@ static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req,
 {
 	struct block_device_context *blkdev = blkvsc_req->dev;
 	struct hyperv_device *device_obj = blkdev->device_obj;
-	struct driver_context *driver_ctx =
-			driver_to_driver_context(device_obj->device.driver);
-	struct blkvsc_driver_context *blkvsc_drv_ctx =
-			(struct blkvsc_driver_context *)driver_ctx;
+	struct hyperv_driver *driver_ctx =
+			driver_to_hyperv_driver(device_obj->device.driver);
+	struct blkvsc_hyperv_driver *blkvsc_drv_ctx =
+			(struct blkvsc_hyperv_driver *)driver_ctx;
 	struct storvsc_driver_object *storvsc_drv_obj =
 			&blkvsc_drv_ctx->drv_obj;
 	struct hv_storvsc_request *storvsc_req;
drivers/staging/hv/netvsc.c +3 -3
index 6d8d0a3..5d41bdf 100644
@@ -49,7 +49,7 @@ netvsc_device_add(struct hyperv_device *device, void *additional_info);
 
 static int netvsc_device_remove(struct hyperv_device *device);
 
-static void netvsc_cleanup(struct driver_context *driver);
+static void netvsc_cleanup(struct hyperv_driver *driver);
 
 static void netvsc_channel_cb(void *context);
 
@@ -178,7 +178,7 @@ static struct netvsc_device *release_inbound_net_device(
 /*
  * netvsc_initialize - Main entry point
  */
-int netvsc_initialize(struct driver_context *drv)
+int netvsc_initialize(struct hyperv_driver *drv)
 {
 	struct netvsc_driver *driver = (struct netvsc_driver *)drv;
 
@@ -837,7 +837,7 @@ static int netvsc_device_remove(struct hyperv_device *device)
 /*
  * netvsc_cleanup - Perform any cleanup when the driver is removed
  */
-static void netvsc_cleanup(struct driver_context *drv)
+static void netvsc_cleanup(struct hyperv_driver *drv)
 {
 }
 
drivers/staging/hv/netvsc_api.h +2 -2
index 842f542..a96cce4 100644
@@ -84,7 +84,7 @@ struct hv_netvsc_packet {
 struct netvsc_driver {
 	/* Must be the first field */
 	/* Which is a bug FIXME! */
-	struct driver_context base;
+	struct hyperv_driver base;
 
 	u32 ring_buf_size;
 	u32 req_ext_size;
@@ -109,7 +109,7 @@ struct netvsc_device_info {
 };
 
 /* Interface */
-int netvsc_initialize(struct driver_context *drv);
+int netvsc_initialize(struct hyperv_driver *drv);
 int rndis_filter_open(struct hyperv_device *dev);
 int rndis_filter_close(struct hyperv_device *dev);
 
drivers/staging/hv/netvsc_drv.c +18 -18
index fbb32f7..359d596 100644
@@ -48,10 +48,10 @@ struct net_device_context {
 	unsigned long avail;
 };
 
-struct netvsc_driver_context {
+struct netvsc_hyperv_driver {
 	/* !! These must be the first 2 fields !! */
 	/* Which is a bug FIXME! */
-	struct driver_context drv_ctx;
+	struct hyperv_driver drv_ctx;
 	struct netvsc_driver drv_obj;
 };
 
@@ -64,7 +64,7 @@ module_param(ring_size, int, S_IRUGO);
 MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
 
 /* The one and only one */
-static struct netvsc_driver_context g_netvsc_drv;
+static struct netvsc_hyperv_driver g_netvsc_drv;
 
 /* no-op so the netdev core doesn't return -EINVAL when modifying the the
  * multicast address list in SIOCADDMULTI. hv is setup to get all multicast
@@ -135,10 +135,10 @@ static void netvsc_xmit_completion(void *context)
 static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
 {
 	struct net_device_context *net_device_obj = netdev_priv(net);
-	struct driver_context *driver_ctx =
-	    driver_to_driver_context(net_device_obj->device_obj->device.driver);
-	struct netvsc_driver_context *net_drv_ctx =
-		(struct netvsc_driver_context *)driver_ctx;
+	struct hyperv_driver *driver_ctx =
+	    driver_to_hyperv_driver(net_device_obj->device_obj->device.driver);
+	struct netvsc_hyperv_driver *net_drv_ctx =
+		(struct netvsc_hyperv_driver *)driver_ctx;
 	struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
 	struct hv_netvsc_packet *packet;
 	int ret;
@@ -338,10 +338,10 @@ static const struct net_device_ops device_ops = {
 
 static int netvsc_probe(struct device *device)
 {
-	struct driver_context *driver_ctx =
-		driver_to_driver_context(device->driver);
-	struct netvsc_driver_context *net_drv_ctx =
-		(struct netvsc_driver_context *)driver_ctx;
+	struct hyperv_driver *driver_ctx =
+		driver_to_hyperv_driver(device->driver);
+	struct netvsc_hyperv_driver *net_drv_ctx =
+		(struct netvsc_hyperv_driver *)driver_ctx;
 	struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
 	struct hyperv_device *device_obj = device_to_hyperv_device(device);
 	struct net_device *net = NULL;
@@ -409,10 +409,10 @@ static int netvsc_probe(struct device *device)
 
 static int netvsc_remove(struct device *device)
 {
-	struct driver_context *driver_ctx =
-		driver_to_driver_context(device->driver);
-	struct netvsc_driver_context *net_drv_ctx =
-		(struct netvsc_driver_context *)driver_ctx;
+	struct hyperv_driver *driver_ctx =
+		driver_to_hyperv_driver(device->driver);
+	struct netvsc_hyperv_driver *net_drv_ctx =
+		(struct netvsc_hyperv_driver *)driver_ctx;
 	struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
 	struct hyperv_device *device_obj = device_to_hyperv_device(device);
 	struct net_device *net = dev_get_drvdata(&device_obj->device);
@@ -458,7 +458,7 @@ static int netvsc_drv_exit_cb(struct device *dev, void *data)
 static void netvsc_drv_exit(void)
 {
 	struct netvsc_driver *netvsc_drv_obj = &g_netvsc_drv.drv_obj;
-	struct driver_context *drv_ctx = &g_netvsc_drv.drv_ctx;
+	struct hyperv_driver *drv_ctx = &g_netvsc_drv.drv_ctx;
 	struct device *current_dev;
 	int ret;
 
@@ -490,10 +490,10 @@ static void netvsc_drv_exit(void)
 	return;
 }
 
-static int netvsc_drv_init(int (*drv_init)(struct driver_context *drv))
+static int netvsc_drv_init(int (*drv_init)(struct hyperv_driver *drv))
 {
 	struct netvsc_driver *net_drv_obj = &g_netvsc_drv.drv_obj;
-	struct driver_context *drv_ctx = &g_netvsc_drv.drv_ctx;
+	struct hyperv_driver *drv_ctx = &g_netvsc_drv.drv_ctx;
 	int ret;
 
 	net_drv_obj->ring_buf_size = ring_size * PAGE_SIZE;
drivers/staging/hv/rndis_filter.c +2 -2
index a2b5f4d..a8f7927 100644
@@ -90,7 +90,7 @@ static int rndis_filte_device_add(struct hyperv_device *dev,
 
 static int rndis_filter_device_remove(struct hyperv_device *dev);
 
-static void rndis_filter_cleanup(struct driver_context *drv);
+static void rndis_filter_cleanup(struct hyperv_driver *drv);
 
 static int rndis_filter_send(struct hyperv_device *dev,
 			     struct hv_netvsc_packet *pkt);
@@ -834,7 +834,7 @@ static int rndis_filter_device_remove(struct hyperv_device *dev)
 	return 0;
 }
 
-static void rndis_filter_cleanup(struct driver_context *drv)
+static void rndis_filter_cleanup(struct hyperv_driver *drv)
 {
 }
 
drivers/staging/hv/storvsc.c +2 -2
index c86bc68..d17df6a 100644
@@ -781,14 +781,14 @@ static int stor_vsc_on_io_request(struct hyperv_device *device,
 /*
  * stor_vsc_on_cleanup - Perform any cleanup when the driver is removed
  */
-static void stor_vsc_on_cleanup(struct driver_context *driver)
+static void stor_vsc_on_cleanup(struct hyperv_driver *driver)
 {
 }
 
 /*
  * stor_vsc_initialize - Main entry point
  */
-int stor_vsc_initialize(struct driver_context *driver)
+int stor_vsc_initialize(struct hyperv_driver *driver)
 {
 	struct storvsc_driver_object *stor_driver;
 
drivers/staging/hv/storvsc_api.h +3 -3
index b488d75..e105929 100644
@@ -80,7 +80,7 @@ struct hv_storvsc_request {
 struct storvsc_driver_object {
 	/* Must be the first field */
 	/* Which is a bug FIXME! */
-	struct driver_context base;
+	struct hyperv_driver base;
 
 	/* Set by caller (in bytes) */
 	u32 ring_buffer_size;
@@ -103,8 +103,8 @@ struct storvsc_device_info {
 };
 
 /* Interface */
-int stor_vsc_initialize(struct driver_context *driver);
+int stor_vsc_initialize(struct hyperv_driver *driver);
 int stor_vsc_on_host_reset(struct hyperv_device *device);
-int blk_vsc_initialize(struct driver_context *driver);
+int blk_vsc_initialize(struct hyperv_driver *driver);
 
 #endif /* _STORVSC_API_H_ */
drivers/staging/hv/storvsc_drv.c +18 -18
index 282bd66..659d385 100644
@@ -64,10 +64,10 @@ struct storvsc_cmd_request {
 	 * Which sounds like a very bad design... */
 };
 
-struct storvsc_driver_context {
+struct storvsc_hyperv_driver {
 	/* !! These must be the first 2 fields !! */
 	/* FIXME this is a bug... */
-	struct driver_context drv_ctx;
+	struct hyperv_driver drv_ctx;
 	struct storvsc_driver_object drv_obj;
 };
 
@@ -101,7 +101,7 @@ module_param(storvsc_ringbuffer_size, int, S_IRUGO);
 MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size (bytes)");
 
 /* The one and only one */
-static struct storvsc_driver_context g_storvsc_drv;
+static struct storvsc_hyperv_driver g_storvsc_drv;
 
 /* Scsi driver */
 static struct scsi_host_template scsi_driver = {
@@ -135,11 +135,11 @@ static struct scsi_host_template scsi_driver = {
 /*
  * storvsc_drv_init - StorVsc driver initialization.
  */
-static int storvsc_drv_init(int (*drv_init)(struct driver_context *drv))
+static int storvsc_drv_init(int (*drv_init)(struct hyperv_driver *drv))
 {
 	int ret;
 	struct storvsc_driver_object *storvsc_drv_obj = &g_storvsc_drv.drv_obj;
-	struct driver_context *drv_ctx = &g_storvsc_drv.drv_ctx;
+	struct hyperv_driver *drv_ctx = &g_storvsc_drv.drv_ctx;
 
 	storvsc_drv_obj->ring_buffer_size = storvsc_ringbuffer_size;
 
@@ -184,7 +184,7 @@ static int storvsc_drv_exit_cb(struct device *dev, void *data)
 static void storvsc_drv_exit(void)
 {
 	struct storvsc_driver_object *storvsc_drv_obj = &g_storvsc_drv.drv_obj;
-	struct driver_context *drv_ctx = &g_storvsc_drv.drv_ctx;
+	struct hyperv_driver *drv_ctx = &g_storvsc_drv.drv_ctx;
 	struct device *current_dev = NULL;
 	int ret;
 
@@ -220,10 +220,10 @@ static void storvsc_drv_exit(void)
 static int storvsc_probe(struct device *device)
 {
 	int ret;
-	struct driver_context *driver_ctx =
-				driver_to_driver_context(device->driver);
-	struct storvsc_driver_context *storvsc_drv_ctx =
-				(struct storvsc_driver_context *)driver_ctx;
+	struct hyperv_driver *driver_ctx =
+				driver_to_hyperv_driver(device->driver);
+	struct storvsc_hyperv_driver *storvsc_drv_ctx =
+				(struct storvsc_hyperv_driver *)driver_ctx;
 	struct storvsc_driver_object *storvsc_drv_obj =
 				&storvsc_drv_ctx->drv_obj;
 	struct hyperv_device *device_obj = device_to_hyperv_device(device);
@@ -304,10 +304,10 @@ static int storvsc_probe(struct device *device)
 static int storvsc_remove(struct device *device)
 {
 	int ret;
-	struct driver_context *driver_ctx =
-			driver_to_driver_context(device->driver);
-	struct storvsc_driver_context *storvsc_drv_ctx =
-			(struct storvsc_driver_context *)driver_ctx;
+	struct hyperv_driver *driver_ctx =
+			driver_to_hyperv_driver(device->driver);
+	struct storvsc_hyperv_driver *storvsc_drv_ctx =
+			(struct storvsc_hyperv_driver *)driver_ctx;
 	struct storvsc_driver_object *storvsc_drv_obj =
 			&storvsc_drv_ctx->drv_obj;
 	struct hyperv_device *device_obj = device_to_hyperv_device(device);
@@ -601,10 +601,10 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd,
 	struct host_device_context *host_device_obj =
 		(struct host_device_context *)scmnd->device->host->hostdata;
 	struct hyperv_device *device_obj = host_device_obj->device_obj;
-	struct driver_context *driver_ctx =
-		driver_to_driver_context(device_obj->device.driver);
-	struct storvsc_driver_context *storvsc_drv_ctx =
-		(struct storvsc_driver_context *)driver_ctx;
+	struct hyperv_driver *driver_ctx =
+		driver_to_hyperv_driver(device_obj->device.driver);
+	struct storvsc_hyperv_driver *storvsc_drv_ctx =
+		(struct storvsc_hyperv_driver *)driver_ctx;
 	struct storvsc_driver_object *storvsc_drv_obj =
 		&storvsc_drv_ctx->drv_obj;
 	struct hv_storvsc_request *request;
drivers/staging/hv/vmbus.h +8 -7
index cad8b4c..617c3ed 100644
@@ -28,7 +28,7 @@
 #include <linux/device.h>
 #include "vmbus_api.h"
 
-struct driver_context {
+struct hyperv_driver {
 	const char *name;
 
 	struct hv_guid class_id;
@@ -37,7 +37,7 @@ struct driver_context {
 
 	int (*dev_rm)(struct hyperv_device *device);
 
-	void (*cleanup)(struct driver_context *driver);
+	void (*cleanup)(struct hyperv_driver *driver);
 
 	struct device_driver driver;
 
@@ -56,7 +56,7 @@ struct hyperv_device {
 	struct work_struct probe_failed_work_item;
 	struct hv_guid class_id; /* device type id */
 	struct hv_guid device_id; /* device instance id */
-	struct driver_context *drv;
+	struct hyperv_driver *drv;
 	int probe_error;
 	struct vmbus_channel *channel; /* associated channel to host*/
 	void    *ext;
@@ -69,15 +69,16 @@ static inline struct hyperv_device *device_to_hyperv_device(struct device *d)
 	return container_of(d, struct hyperv_device, device);
 }
 
-static inline struct driver_context *driver_to_driver_context(struct device_driver *d)
+static inline struct hyperv_driver *
+driver_to_hyperv_driver(struct device_driver *d)
 {
-	return container_of(d, struct driver_context, driver);
+	return container_of(d, struct hyperv_driver, driver);
 }
 
 
 /* Vmbus interface */
-int vmbus_child_driver_register(struct driver_context *driver_ctx);
-void vmbus_child_driver_unregister(struct driver_context *driver_ctx);
+int vmbus_child_driver_register(struct hyperv_driver *driver_ctx);
+void vmbus_child_driver_unregister(struct hyperv_driver *driver_ctx);
 
 extern struct completion hv_channel_ready;
 
drivers/staging/hv/vmbus_api.h +1 -1
index 0d8232e..6e3e1a8 100644
@@ -55,7 +55,7 @@ struct hv_multipage_buffer {
 
 #pragma pack(pop)
 
-struct driver_context;
+struct hyperv_driver;
 struct hyperv_device;
 
 struct hv_dev_port_info {
drivers/staging/hv/vmbus_drv.c +27 -27

179 lines not on this page · raw message

Signature · 1 line
1.5.5.6
#1 lore raw
Quoted 1 line · K. Y. Srinivasan

The title says it all.

No it doesn't. You should have done this on the last patch to keep me from complaining about that name.

Oh, and the extra space, drop it please.

Quoted 5 lines
drivers/staging/hv/blkvsc_drv.c +0 -0
@@ -116,10 +116,10 @@ struct block_device_context {
 };
 

drivers/staging/hv/blkvsc_drv.c struct block_device_context { · line 125

Quoted 10 lines
drivers/staging/hv/blkvsc_drv.c +2 -2
 /* Per driver */
-struct blkvsc_driver_context {
+struct blkvsc_hyperv_driver {
 	/* !! These must be the first 2 fields !! */
 	/* FIXME this is a bug! */
-	struct driver_context drv_ctx;
+	struct hyperv_driver drv_ctx;
 	struct storvsc_driver_object drv_obj;
 };
 

Hey look, that Subject: and changelog body actually lied. It didn't say it all. In fact, it didn't say enough, or you just renamed a different structure because it felt nice.

{sigh}

One thing per patch, with full description. I'm getting tired of repeating Documentation/CodingStyle for this subsystem when patches are submitted.

It's as if no one even listens to me...

{sniff}

greg k-h