Skip to contentSkip to conversation

Staging: hv: Rename vm_device to hyperv_device

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

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

PATCH 2/6 Staging: hv: Rename vm_device to hyperv_device

Rename the vm_device abstraction as hyperv_device.

---
 drivers/staging/hv/blkvsc.c        |    4 +-
 drivers/staging/hv/blkvsc_drv.c    |    8 ++--
 drivers/staging/hv/channel_mgmt.h  |    2 +-
 drivers/staging/hv/netvsc.c        |   56 +++++++++++++++++++----------------
 drivers/staging/hv/netvsc.h        |    2 +-
 drivers/staging/hv/netvsc_api.h    |   12 ++++----
 drivers/staging/hv/netvsc_drv.c    |   14 ++++----
 drivers/staging/hv/rndis_filter.c  |   18 ++++++------
 drivers/staging/hv/storvsc.c       |   36 ++++++++++++-----------
 drivers/staging/hv/storvsc_api.h   |    4 +-
 drivers/staging/hv/storvsc_drv.c   |   10 +++---
 drivers/staging/hv/vmbus.h         |    6 ++--
 drivers/staging/hv/vmbus_api.h     |    8 ++--
 drivers/staging/hv/vmbus_drv.c     |   50 ++++++++++++++++----------------
 drivers/staging/hv/vmbus_private.h |   12 ++++----
 15 files changed, 124 insertions(+), 118 deletions(-)
drivers/staging/hv/blkvsc.c +2 -2
index ecface3..47ccec2 100644
@@ -35,8 +35,8 @@ static const struct hv_guid g_blk_device_type = {
 	}
 };
 
-static int blk_vsc_on_device_add(struct vm_device *device,
-				void *additional_info)
+static int
+blk_vsc_on_device_add(struct hyperv_device *device, void *additional_info)
 {
 	struct storvsc_device_info *device_info;
 	int ret = 0;
drivers/staging/hv/blkvsc_drv.c +4 -4
index 6d1a783..58ab0e8 100644
@@ -95,7 +95,7 @@ struct blkvsc_request {
 /* Per device structure */
 struct block_device_context {
 	/* point back to our device context */
-	struct vm_device *device_ctx;
+	struct hyperv_device *device_ctx;
 	struct kmem_cache *request_pool;
 	spinlock_t lock;
 	struct gendisk *gd;
@@ -249,7 +249,7 @@ static int blkvsc_probe(struct device *device)
 				(struct blkvsc_driver_context *)driver_ctx;
 	struct storvsc_driver_object *storvsc_drv_obj =
 				&blkvsc_drv_ctx->drv_obj;
-	struct vm_device *device_obj = device_to_vm_device(device);
+	struct hyperv_device *device_obj = device_to_hyperv_device(device);
 
 	struct block_device_context *blkdev = NULL;
 	struct storvsc_device_info device_info;
@@ -733,7 +733,7 @@ static int blkvsc_remove(struct device *device)
 				(struct blkvsc_driver_context *)driver_ctx;
 	struct storvsc_driver_object *storvsc_drv_obj =
 				&blkvsc_drv_ctx->drv_obj;
-	struct vm_device *device_obj = device_to_vm_device(device);
+	struct hyperv_device *device_obj = device_to_hyperv_device(device);
 	struct block_device_context *blkdev = dev_get_drvdata(device);
 	unsigned long flags;
 	int ret;
@@ -848,7 +848,7 @@ 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 vm_device *device_ctx = blkdev->device_ctx;
+	struct hyperv_device *device_ctx = blkdev->device_ctx;
 	struct driver_context *driver_ctx =
 			driver_to_driver_context(device_ctx->device.driver);
 	struct blkvsc_driver_context *blkvsc_drv_ctx =
drivers/staging/hv/channel_mgmt.h +1 -1
index b3a9214..7b42883 100644
@@ -228,7 +228,7 @@ enum vmbus_channel_state {
 struct vmbus_channel {
 	struct list_head listentry;
 
-	struct vm_device *device_obj;
+	struct hyperv_device *device_obj;
 
 	struct timer_list poll_timer; /* SA-111 workaround */
 	struct work_struct work;
drivers/staging/hv/netvsc.c +30 -26

182 lines not on this page · raw message

drivers/staging/hv/netvsc.h +1 -1
index b2709eb..ea3a05f 100644
@@ -293,7 +293,7 @@ struct nvsp_message {
 
 /* Per netvsc channel-specific */
 struct netvsc_device {
-	struct vm_device *dev;
+	struct hyperv_device *dev;
 
 	atomic_t refcnt;
 	atomic_t num_outstanding_sends;
drivers/staging/hv/netvsc_api.h +6 -6
index a9cfeff..e43ff7b 100644
@@ -49,7 +49,7 @@ struct hv_netvsc_packet {
 	/* Bookkeeping stuff */
 	struct list_head list_ent;
 
-	struct vm_device *device;
+	struct hyperv_device *device;
 	bool is_data_pkt;
 
 	/*
@@ -93,12 +93,12 @@ struct netvsc_driver {
 	 * This is set by the caller to allow us to callback when we
 	 * receive a packet from the "wire"
 	 */
-	int (*recv_cb)(struct vm_device *dev,
+	int (*recv_cb)(struct hyperv_device *dev,
 				 struct hv_netvsc_packet *packet);
-	void (*link_status_change)(struct vm_device *dev, u32 status);
+	void (*link_status_change)(struct hyperv_device *dev, u32 status);
 
 	/* Specific to this driver */
-	int (*send)(struct vm_device *dev, struct hv_netvsc_packet *packet);
+	int (*send)(struct hyperv_device *dev, struct hv_netvsc_packet *packet);
 
 	void *ctx;
 };
@@ -110,7 +110,7 @@ struct netvsc_device_info {
 
 /* Interface */
 int netvsc_initialize(struct hv_driver *drv);
-int rndis_filter_open(struct vm_device *dev);
-int rndis_filter_close(struct vm_device *dev);
+int rndis_filter_open(struct hyperv_device *dev);
+int rndis_filter_close(struct hyperv_device *dev);
 
 #endif /* _NETVSC_API_H_ */
drivers/staging/hv/netvsc_drv.c +7 -7
index 055986f..31cbbab 100644
@@ -44,7 +44,7 @@
 
 struct net_device_context {
 	/* point back to our device context */
-	struct vm_device *device_ctx;
+	struct hyperv_device *device_ctx;
 	unsigned long avail;
 };
 
@@ -76,7 +76,7 @@ static void netvsc_set_multicast_list(struct net_device *net)
 static int netvsc_open(struct net_device *net)
 {
 	struct net_device_context *net_device_ctx = netdev_priv(net);
-	struct vm_device *device_obj = net_device_ctx->device_ctx;
+	struct hyperv_device *device_obj = net_device_ctx->device_ctx;
 	int ret = 0;
 
 	if (netif_carrier_ok(net)) {
@@ -99,7 +99,7 @@ static int netvsc_open(struct net_device *net)
 static int netvsc_close(struct net_device *net)
 {
 	struct net_device_context *net_device_ctx = netdev_priv(net);
-	struct vm_device *device_obj = net_device_ctx->device_ctx;
+	struct hyperv_device *device_obj = net_device_ctx->device_ctx;
 	int ret;
 
 	netif_stop_queue(net);
@@ -223,7 +223,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
 /*
  * netvsc_linkstatus_callback - Link up/down notification
  */
-static void netvsc_linkstatus_callback(struct vm_device *device_obj,
+static void netvsc_linkstatus_callback(struct hyperv_device *device_obj,
 				       unsigned int status)
 {
 	struct net_device *net = dev_get_drvdata(&device_obj->device);
@@ -248,7 +248,7 @@ static void netvsc_linkstatus_callback(struct vm_device *device_obj,
  * netvsc_recv_callback -  Callback when we receive a packet from the
  * "wire" on the specified device.
  */
-static int netvsc_recv_callback(struct vm_device *device_obj,
+static int netvsc_recv_callback(struct hyperv_device *device_obj,
 				struct hv_netvsc_packet *packet)
 {
 	struct net_device *net = dev_get_drvdata(&device_obj->device);
@@ -343,7 +343,7 @@ static int netvsc_probe(struct device *device)
 	struct netvsc_driver_context *net_drv_ctx =
 		(struct netvsc_driver_context *)driver_ctx;
 	struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
-	struct vm_device *device_obj = device_to_vm_device(device);
+	struct hyperv_device *device_obj = device_to_hyperv_device(device);
 	struct net_device *net = NULL;
 	struct net_device_context *net_device_ctx;
 	struct netvsc_device_info device_info;
@@ -414,7 +414,7 @@ static int netvsc_remove(struct device *device)
 	struct netvsc_driver_context *net_drv_ctx =
 		(struct netvsc_driver_context *)driver_ctx;
 	struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
-	struct vm_device *device_obj = device_to_vm_device(device);
+	struct hyperv_device *device_obj = device_to_hyperv_device(device);
 	struct net_device *net = dev_get_drvdata(&device_obj->device);
 	int ret;
 
drivers/staging/hv/rndis_filter.c +9 -9
index e0b1b44..b718fa9 100644
@@ -85,14 +85,14 @@ struct rndis_filter_packet {
 };
 
 
-static int rndis_filte_device_add(struct vm_device *dev,
+static int rndis_filte_device_add(struct hyperv_device *dev,
 				  void *additional_info);
 
-static int rndis_filter_device_remove(struct vm_device *dev);
+static int rndis_filter_device_remove(struct hyperv_device *dev);
 
 static void rndis_filter_cleanup(struct hv_driver *drv);
 
-static int rndis_filter_send(struct vm_device *dev,
+static int rndis_filter_send(struct hyperv_device *dev,
 			     struct hv_netvsc_packet *pkt);
 
 static void rndis_filter_send_completion(void *ctx);
@@ -376,7 +376,7 @@ static void rndis_filter_receive_data(struct rndis_device *dev,
 						   pkt);
 }
 
-static int rndis_filter_receive(struct vm_device *dev,
+static int rndis_filter_receive(struct hyperv_device *dev,
 				struct hv_netvsc_packet	*pkt)
 {
 	struct netvsc_device *net_dev = dev->ext;
@@ -754,7 +754,7 @@ static int rndis_filter_close_device(struct rndis_device *dev)
 	return ret;
 }
 
-static int rndis_filte_device_add(struct vm_device *dev,
+static int rndis_filte_device_add(struct hyperv_device *dev,
 				  void *additional_info)
 {
 	int ret;
@@ -817,7 +817,7 @@ static int rndis_filte_device_add(struct vm_device *dev,
 	return ret;
 }
 
-static int rndis_filter_device_remove(struct vm_device *dev)
+static int rndis_filter_device_remove(struct hyperv_device *dev)
 {
 	struct netvsc_device *net_dev = dev->ext;
 	struct rndis_device *rndis_dev = net_dev->extension;
@@ -838,7 +838,7 @@ static void rndis_filter_cleanup(struct hv_driver *drv)
 {
 }
 
-int rndis_filter_open(struct vm_device *dev)
+int rndis_filter_open(struct hyperv_device *dev)
 {
 	struct netvsc_device *netDevice = dev->ext;
 
@@ -848,7 +848,7 @@ int rndis_filter_open(struct vm_device *dev)
 	return rndis_filter_open_device(netDevice->extension);
 }
 
-int rndis_filter_close(struct vm_device *dev)
+int rndis_filter_close(struct hyperv_device *dev)
 {
 	struct netvsc_device *netDevice = dev->ext;
 
@@ -858,7 +858,7 @@ int rndis_filter_close(struct vm_device *dev)
 	return rndis_filter_close_device(netDevice->extension);
 }
 
-static int rndis_filter_send(struct vm_device *dev,
+static int rndis_filter_send(struct hyperv_device *dev,
 			     struct hv_netvsc_packet *pkt)
 {
 	int ret;
drivers/staging/hv/storvsc.c +19 -17
index 7b75ab5..6000b0d 100644
@@ -38,7 +38,7 @@ struct storvsc_request_extension {
 	/* LIST_ENTRY ListEntry; */
 
 	struct hv_storvsc_request *request;
-	struct vm_device *device;
+	struct hyperv_device *device;
 
 	/* Synchronize the request/response if needed */
 	int wait_condition;
@@ -49,7 +49,7 @@ struct storvsc_request_extension {
 
 /* A storvsc device is a device object that contains a vmbus channel */
 struct storvsc_device {
-	struct vm_device *device;
+	struct hyperv_device *device;
 
 	/* 0 indicates the device is being destroyed */
 	atomic_t ref_count;
@@ -85,7 +85,8 @@ static const struct hv_guid gStorVscDeviceType = {
 };
 
 
-static inline struct storvsc_device *alloc_stor_device(struct vm_device *device)
+static inline struct storvsc_device *
+alloc_stor_device(struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 
@@ -110,7 +111,8 @@ static inline void free_stor_device(struct storvsc_device *device)
 }
 
 /* Get the stordevice object iff exists and its refcount > 1 */
-static inline struct storvsc_device *get_stor_device(struct vm_device *device)
+static inline struct storvsc_device *
+get_stor_device(struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 
@@ -125,7 +127,7 @@ static inline struct storvsc_device *get_stor_device(struct vm_device *device)
 
 /* Get the stordevice object iff exists and its refcount > 0 */
 static inline struct storvsc_device *must_get_stor_device(
-					struct vm_device *device)
+					struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 
@@ -138,7 +140,7 @@ static inline struct storvsc_device *must_get_stor_device(
 	return stor_device;
 }
 
-static inline void put_stor_device(struct vm_device *device)
+static inline void put_stor_device(struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 
@@ -151,7 +153,7 @@ static inline void put_stor_device(struct vm_device *device)
 
 /* Drop ref count to 1 to effectively disable get_stor_device() */
 static inline struct storvsc_device *release_stor_device(
-					struct vm_device *device)
+					struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 
@@ -167,7 +169,7 @@ static inline struct storvsc_device *release_stor_device(
 
 /* Drop ref count to 0. No one can use stor_device object. */
 static inline struct storvsc_device *final_release_stor_device(
-			struct vm_device *device)
+			struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 
@@ -182,7 +184,7 @@ static inline struct storvsc_device *final_release_stor_device(
 	return stor_device;
 }
 
-static int stor_vsc_channel_init(struct vm_device *device)
+static int stor_vsc_channel_init(struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 	struct storvsc_request_extension *request;
@@ -363,7 +365,7 @@ cleanup:
 	return ret;
 }
 
-static void stor_vsc_on_io_completion(struct vm_device *device,
+static void stor_vsc_on_io_completion(struct hyperv_device *device,
 				  struct vstor_packet *vstor_packet,
 				  struct storvsc_request_extension *request_ext)
 {
@@ -427,7 +429,7 @@ static void stor_vsc_on_io_completion(struct vm_device *device,
 	put_stor_device(device);
 }
 
-static void stor_vsc_on_receive(struct vm_device *device,
+static void stor_vsc_on_receive(struct hyperv_device *device,
 			     struct vstor_packet *vstor_packet,
 			     struct storvsc_request_extension *request_ext)
 {
@@ -450,7 +452,7 @@ static void stor_vsc_on_receive(struct vm_device *device,
 
 static void stor_vsc_on_channel_callback(void *context)
 {
-	struct vm_device *device = (struct vm_device *)context;
+	struct hyperv_device *device = (struct hyperv_device *)context;
 	struct storvsc_device *stor_device;
 	u32 bytes_recvd;
 	u64 request_id;
@@ -510,7 +512,7 @@ static void stor_vsc_on_channel_callback(void *context)
 	return;
 }
 
-static int stor_vsc_connect_to_vsp(struct vm_device *device)
+static int stor_vsc_connect_to_vsp(struct hyperv_device *device)
 {
 	struct vmstorage_channel_properties props;
 	struct storvsc_driver_object *stor_driver;
@@ -544,7 +546,7 @@ static int stor_vsc_connect_to_vsp(struct vm_device *device)
  * stor_vsc_on_device_add - Callback when the device belonging to this driver
  * is added
  */
-static int stor_vsc_on_device_add(struct vm_device *device,
+static int stor_vsc_on_device_add(struct hyperv_device *device,
 					void *additional_info)
 {
 	struct storvsc_device *stor_device;
@@ -593,7 +595,7 @@ cleanup:
 /*
  * stor_vsc_on_device_remove - Callback when the our device is being removed
  */
-static int stor_vsc_on_device_remove(struct vm_device *device)
+static int stor_vsc_on_device_remove(struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 
@@ -627,7 +629,7 @@ static int stor_vsc_on_device_remove(struct vm_device *device)
 	return 0;
 }
 
-int stor_vsc_on_host_reset(struct vm_device *device)
+int stor_vsc_on_host_reset(struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 	struct storvsc_request_extension *request;
@@ -686,7 +688,7 @@ cleanup:
 /*
  * stor_vsc_on_io_request - Callback to initiate an I/O request
  */
-static int stor_vsc_on_io_request(struct vm_device *device,
+static int stor_vsc_on_io_request(struct hyperv_device *device,
 			      struct hv_storvsc_request *request)
 {
 	struct storvsc_device *stor_device;
drivers/staging/hv/storvsc_api.h +2 -2
index 8bed6f5..c2915b4 100644
@@ -92,7 +92,7 @@ struct storvsc_driver_object {
 	u32 max_outstanding_req_per_channel;
 
 	/* Specific to this driver */
-	int (*on_io_request)(struct vm_device *device,
+	int (*on_io_request)(struct hyperv_device *device,
 			   struct hv_storvsc_request *request);
 };
 
@@ -104,7 +104,7 @@ struct storvsc_device_info {
 
 /* Interface */
 int stor_vsc_initialize(struct hv_driver *driver);
-int stor_vsc_on_host_reset(struct vm_device *device);
+int stor_vsc_on_host_reset(struct hyperv_device *device);
 int blk_vsc_initialize(struct hv_driver *driver);
 
 #endif /* _STORVSC_API_H_ */
drivers/staging/hv/storvsc_drv.c +5 -5
index 216d8ff..2b9a097 100644
@@ -43,7 +43,7 @@ struct host_device_context {
 	/* must be 1st field
 	 * FIXME this is a bug */
 	/* point back to our device context */
-	struct vm_device *device_ctx;
+	struct hyperv_device *device_ctx;
 	struct kmem_cache *request_pool;
 	unsigned int port;
 	unsigned char path;
@@ -226,7 +226,7 @@ static int storvsc_probe(struct device *device)
 				(struct storvsc_driver_context *)driver_ctx;
 	struct storvsc_driver_object *storvsc_drv_obj =
 				&storvsc_drv_ctx->drv_obj;
-	struct vm_device *device_obj = device_to_vm_device(device);
+	struct hyperv_device *device_obj = device_to_hyperv_device(device);
 	struct Scsi_Host *host;
 	struct host_device_context *host_device_ctx;
 	struct storvsc_device_info device_info;
@@ -310,7 +310,7 @@ static int storvsc_remove(struct device *device)
 			(struct storvsc_driver_context *)driver_ctx;
 	struct storvsc_driver_object *storvsc_drv_obj =
 			&storvsc_drv_ctx->drv_obj;
-	struct vm_device *device_obj = device_to_vm_device(device);
+	struct hyperv_device *device_obj = device_to_hyperv_device(device);
 	struct Scsi_Host *host = dev_get_drvdata(device);
 	struct host_device_context *host_device_ctx =
 			(struct host_device_context *)host->hostdata;
@@ -600,7 +600,7 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd,
 	int ret;
 	struct host_device_context *host_device_ctx =
 		(struct host_device_context *)scmnd->device->host->hostdata;
-	struct vm_device *device_ctx = host_device_ctx->device_ctx;
+	struct hyperv_device *device_ctx = host_device_ctx->device_ctx;
 	struct driver_context *driver_ctx =
 		driver_to_driver_context(device_ctx->device.driver);
 	struct storvsc_driver_context *storvsc_drv_ctx =
@@ -838,7 +838,7 @@ static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd)
 	int ret;
 	struct host_device_context *host_device_ctx =
 		(struct host_device_context *)scmnd->device->host->hostdata;
-	struct vm_device *device_ctx = host_device_ctx->device_ctx;
+	struct hyperv_device *device_ctx = host_device_ctx->device_ctx;
 
 	DPRINT_INFO(STORVSC_DRV, "sdev (%p) dev obj (%p) - host resetting...",
 		    scmnd->device, device_ctx);
drivers/staging/hv/vmbus.h +3 -3
index e56e61a..1ac7e56 100644
@@ -43,7 +43,7 @@ struct driver_context {
 	void (*shutdown)(struct device *);
 };
 
-struct vm_device {
+struct hyperv_device {
 	char name[64];
 	struct work_struct probe_failed_work_item;
 	struct hv_guid class_id; /* device type id */
@@ -56,9 +56,9 @@ struct vm_device {
 };
 
 
-static inline struct vm_device *device_to_vm_device(struct device *d)
+static inline struct hyperv_device *device_to_hyperv_device(struct device *d)
 {
-	return container_of(d, struct vm_device, device);
+	return container_of(d, struct hyperv_device, device);
 }
 
 static inline struct driver_context *driver_to_driver_context(struct device_driver *d)
drivers/staging/hv/vmbus_api.h +4 -4
index bf84fb0..260086f 100644
@@ -56,7 +56,7 @@ struct hv_multipage_buffer {
 #pragma pack(pop)
 
 struct hv_driver;
-struct vm_device;
+struct hyperv_device;
 
 struct hv_dev_port_info {
 	u32 int_mask;
@@ -66,7 +66,7 @@ struct hv_dev_port_info {
 	u32 bytes_avail_towrite;
 };
 
-struct vm_device_info {
+struct hyperv_device_info {
 	u32 chn_id;
 	u32 chn_state;
 	struct hv_guid chn_type;
@@ -91,8 +91,8 @@ struct hv_driver {
 	/* the device type supported by this driver */
 	struct hv_guid class_id;
 
-	int (*dev_add)(struct vm_device *device, void *data);
-	int (*dev_rm)(struct vm_device *device);
+	int (*dev_add)(struct hyperv_device *device, void *data);
+	int (*dev_rm)(struct hyperv_device *device);
 	void (*cleanup)(struct hv_driver *driver);
 };
 
drivers/staging/hv/vmbus_drv.c +25 -25

162 lines not on this page · raw message

drivers/staging/hv/vmbus_private.h +6 -6
index 206218c..4a8f2e8 100644
@@ -103,18 +103,18 @@ extern struct vmbus_connection vmbus_connection;
 
 /* General vmbus interface */
 
-struct vm_device *vmbus_child_device_create(struct hv_guid *type,
+struct hyperv_device *vmbus_child_device_create(struct hv_guid *type,
 					 struct hv_guid *instance,
 					 struct vmbus_channel *channel);
 
-int vmbus_child_dev_add(struct vm_device *device);
-int vmbus_child_device_register(struct vm_device *root_device_obj,
-				struct vm_device *child_device_obj);
-void vmbus_child_device_unregister(struct vm_device *device_obj);
+int vmbus_child_dev_add(struct hyperv_device *device);
+int vmbus_child_device_register(struct hyperv_device *root_device_obj,
+				struct hyperv_device *child_device_obj);
+void vmbus_child_device_unregister(struct hyperv_device *device_obj);
 
 /* static void */
 /* VmbusChildDeviceDestroy( */
-/* struct vm_device *); */
+/* struct hyperv_device *); */
 
 struct vmbus_channel *relid2channel(u32 relid);
 
Signature · 1 line
1.5.5.6
#1 lore raw
Quoted 1 line · K. Y. Srinivasan

Rename the vm_device abstraction as hyperv_device.

That's a nice name, but it's the first one with a "hyperv_" prefix in this subsystem. Ok, second, but hyperv_service_context doesn't really count as it's not really used.

Everything else is named "hv_" here. Which is it going to be, "hv_" or "hyperv_"?

Either is fine, just be aware of the work involved if you pick "hyperv_"...

You also rename vm_device_info to hyperv_device_info here, doing more than one thing in a single patch.

Please don't do that, this should be 2 patches.

Quoted 28 lines
---
 drivers/staging/hv/blkvsc.c        |    4 +-
 drivers/staging/hv/blkvsc_drv.c    |    8 ++--
 drivers/staging/hv/channel_mgmt.h  |    2 +-
 drivers/staging/hv/netvsc.c        |   56 +++++++++++++++++++----------------
 drivers/staging/hv/netvsc.h        |    2 +-
 drivers/staging/hv/netvsc_api.h    |   12 ++++----
 drivers/staging/hv/netvsc_drv.c    |   14 ++++----
 drivers/staging/hv/rndis_filter.c  |   18 ++++++------
 drivers/staging/hv/storvsc.c       |   36 ++++++++++++-----------
 drivers/staging/hv/storvsc_api.h   |    4 +-
 drivers/staging/hv/storvsc_drv.c   |   10 +++---
 drivers/staging/hv/vmbus.h         |    6 ++--
 drivers/staging/hv/vmbus_api.h     |    8 ++--
 drivers/staging/hv/vmbus_drv.c     |   50 ++++++++++++++++----------------
 drivers/staging/hv/vmbus_private.h |   12 ++++----
 15 files changed, 124 insertions(+), 118 deletions(-)
drivers/staging/hv/blkvsc.c +0 -0
index ecface3..47ccec2 100644

drivers/staging/hv/blkvsc.c static const struct hv_guid g_blk_device_type = { · line 39

Quoted 7 lines
drivers/staging/hv/blkvsc.c +2 -2
@@ -35,8 +35,8 @@ static const struct hv_guid g_blk_device_type = {
 	}
 };
 
-static int blk_vsc_on_device_add(struct vm_device *device,
-				void *additional_info)
+static int
+blk_vsc_on_device_add(struct hyperv_device *device, void *additional_info)

Ick, why break the formatting like this? Please keep the return type on the same line as the function name.

You do that in a number of places, please don't.

thanks,

greg k-h

#2 lore raw
Quoted 18 lines

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Monday, February 28, 2011 9:33 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Haiyang Zhang; Hank Janssen
Subject: Re: [PATCH 2/6] Staging: hv: Rename vm_device to hyperv_device

Quoted 1 line · K. Y. Srinivasan

Rename the vm_device abstraction as hyperv_device.

That's a nice name, but it's the first one with a "hyperv_" prefix in this subsystem. Ok, second, but hyperv_service_context doesn't really count as it's not really used.

Quoted 5 lines

Everything else is named "hv_" here. Which is it going to be, "hv_" or "hyperv_"?

Either is fine, just be aware of the work involved if you pick "hyperv_"...

As far as the device state and driver state in this subsystem is concerned; I thought the consensus was to name them hyperv_*

Quoted 5 lines

You also rename vm_device_info to hyperv_device_info here, doing more than one thing in a single patch.

Please don't do that, this should be 2 patches.

I changed all device related state to be consistently named. However, I will break it up into 2 patches.

Quoted 46 lines
Quoted 30 lines
---
 drivers/staging/hv/blkvsc.c        |    4 +-
 drivers/staging/hv/blkvsc_drv.c    |    8 ++--
 drivers/staging/hv/channel_mgmt.h  |    2 +-
 drivers/staging/hv/netvsc.c        |   56 +++++++++++++++++++----------------
 drivers/staging/hv/netvsc.h        |    2 +-
 drivers/staging/hv/netvsc_api.h    |   12 ++++----
 drivers/staging/hv/netvsc_drv.c    |   14 ++++----
 drivers/staging/hv/rndis_filter.c  |   18 ++++++------
 drivers/staging/hv/storvsc.c       |   36 ++++++++++++-----------
 drivers/staging/hv/storvsc_api.h   |    4 +-
 drivers/staging/hv/storvsc_drv.c   |   10 +++---
 drivers/staging/hv/vmbus.h         |    6 ++--
 drivers/staging/hv/vmbus_api.h     |    8 ++--
 drivers/staging/hv/vmbus_drv.c     |   50 ++++++++++++++++----------------
 drivers/staging/hv/vmbus_private.h |   12 ++++----
 15 files changed, 124 insertions(+), 118 deletions(-)
drivers/staging/hv/blkvsc.c +0 -0
index ecface3..47ccec2 100644

drivers/staging/hv/blkvsc.c static const struct hv_guid g_blk_device_type = { · line 39

Quoted 7 lines
drivers/staging/hv/blkvsc.c +2 -2
@@ -35,8 +35,8 @@ static const struct hv_guid g_blk_device_type = {
 	}
 };
 
-static int blk_vsc_on_device_add(struct vm_device *device,
-				void *additional_info)
+static int
+blk_vsc_on_device_add(struct hyperv_device *device, void *additional_info)

Ick, why break the formatting like this? Please keep the return type on the same line as the function name.

You do that in a number of places, please don't.

thanks,

greg k-h