Staging: hv: Cleanup hyperv_device variable names
Subsystems (2)
PATCH 3/6 Staging: hv: Cleanup hyperv_device variable names
Cleanup the names of variables that refer to the hyperv_device abstraction.
--- drivers/staging/hv/blkvsc_drv.c | 12 ++-- drivers/staging/hv/netvsc.c | 4 +- drivers/staging/hv/netvsc_drv.c | 36 ++++---- drivers/staging/hv/storvsc_drv.c | 44 +++++----- drivers/staging/hv/vmbus_drv.c | 164 +++++++++++++++++++------------------- 5 files changed, 130 insertions(+), 130 deletions(-)
drivers/staging/hv/blkvsc_drv.c +6 -6
@@ -95,7 +95,7 @@ struct blkvsc_request {/* Per device structure */ struct block_device_context {/* point back to our device context */ -struct hyperv_device *device_ctx; +struct hyperv_device *device_obj;struct kmem_cache *request_pool;spinlock_t lock;struct gendisk *gd;
@@ -298,7 +298,7 @@ static int blkvsc_probe(struct device *device) goto Cleanup; } - blkdev->device_ctx = device_obj; + blkdev->device_obj = device_obj;/* this identified the device 0 or 1 */ blkdev->target = device_info.target_id;/* this identified the ide ctrl 0 or 1 */
@@ -367,7 +367,7 @@ static int blkvsc_probe(struct device *device) blkdev->gd->first_minor =0 ; blkdev->gd->fops = &block_ops; blkdev->gd->private_data = blkdev; - blkdev->gd->driverfs_dev = &(blkdev->device_ctx->device); + blkdev->gd->driverfs_dev = &(blkdev->device_obj->device);sprintf (blkdev->gd->disk_name,"hd%c" ,'a' + devnum);blkvsc_do_inquiry (blkdev);
@@ -848,9 +848,9 @@ 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 hyperv_device *device_ctx = blkdev->device_ctx; +struct hyperv_device *device_obj = blkdev->device_obj;struct driver_context *driver_ctx = -driver_to_driver_context (device_ctx->device.driver); +driver_to_driver_context (device_obj->device.driver);struct blkvsc_driver_context *blkvsc_drv_ctx = (struct blkvsc_driver_context *)driver_ctx; struct storvsc_driver_object *storvsc_drv_obj =
@@ -895,7 +895,7 @@ static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req, storvsc_req->sense_buffer = blkvsc_req->sense_buffer; storvsc_req->sense_buffer_size =SCSI_SENSE_BUFFERSIZE ; - ret = storvsc_drv_obj->on_io_request (blkdev->device_ctx, + ret = storvsc_drv_obj->on_io_request (blkdev->device_obj, &blkvsc_req->request);if (ret ==0 ) blkdev->num_outstanding_reqs++;
drivers/staging/hv/netvsc.c +2 -2
@@ -44,8 +44,8 @@ static const struct hv_guid netvsc_device_type = { } }; -static int netvsc_device_add (struct hyperv_device *device, -void *additional_info); +static int +netvsc_device_add (struct hyperv_device *device,void *additional_info);static int netvsc_device_remove (struct hyperv_device *device);
drivers/staging/hv/netvsc_drv.c +18 -18
@@ -44,7 +44,7 @@struct net_device_context {/* point back to our device context */ -struct hyperv_device *device_ctx; +struct hyperv_device *device_obj;unsigned long avail; };
@@ -75,8 +75,8 @@ 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 hyperv_device *device_obj = net_device_ctx->device_ctx; +struct net_device_context *net_device_obj =netdev_priv (net); +struct hyperv_device *device_obj = net_device_obj->device_obj;int ret =0 ;if (netif_carrier_ok (net)) {
@@ -98,8 +98,8 @@ 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 hyperv_device *device_obj = net_device_ctx->device_ctx; +struct net_device_context *net_device_obj =netdev_priv (net); +struct hyperv_device *device_obj = net_device_obj->device_obj;int ret;netif_stop_queue (net);
@@ -121,22 +121,22 @@ static void netvsc_xmit_completion(void *context)if (skb) {struct net_device *net = skb->dev; -struct net_device_context *net_device_ctx =netdev_priv (net); +struct net_device_context *net_device_obj =netdev_priv (net);unsigned int num_pages =skb_shinfo (skb)->nr_frags +2 ;dev_kfree_skb_any (skb); - net_device_ctx->avail += num_pages; -if (net_device_ctx->avail >=PACKET_PAGES_HIWATER ) + net_device_obj->avail += num_pages; +if (net_device_obj->avail >=PACKET_PAGES_HIWATER )netif_wake_queue (net); } }static int netvsc_start_xmit (struct sk_buff *skb,struct net_device *net) { -struct net_device_context *net_device_ctx =netdev_priv (net); +struct net_device_context *net_device_obj =netdev_priv (net);struct driver_context *driver_ctx = -driver_to_driver_context (net_device_ctx->device_ctx->device.driver); +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 netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
@@ -149,7 +149,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)/* Add 1 for skb->data and additional one for RNDIS */ num_pages =skb_shinfo (skb)->nr_frags +1 +1 ; -if (num_pages > net_device_ctx->avail) +if (num_pages > net_device_obj->avail)return NETDEV_TX_BUSY ;/* Allocate a netvsc packet based on # of frags. */
@@ -198,7 +198,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) packet->completion.send.send_completion_ctx = packet; packet->completion.send.send_completion_tid = (unsigned long )skb; - ret = net_drv_obj->send (net_device_ctx->device_ctx, + ret = net_drv_obj->send (net_device_obj->device_obj, packet);if (ret ==0 ) { net->stats.tx_bytes += skb->len;
@@ -208,8 +208,8 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) net->stats.tx_packets, net->stats.tx_bytes); - net_device_ctx->avail -= num_pages; -if (net_device_ctx->avail <PACKET_PAGES_LOWATER ) + net_device_obj->avail -= num_pages; +if (net_device_obj->avail <PACKET_PAGES_LOWATER )netif_stop_queue (net); }else {/* we are shutting down or bus overloaded, just drop packet */
@@ -345,7 +345,7 @@ static int netvsc_probe(struct device *device)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 ; -struct net_device_context *net_device_ctx; +struct net_device_context *net_device_obj;struct netvsc_device_info device_info;int ret;
@@ -359,9 +359,9 @@ static int netvsc_probe(struct device *device)/* Set initial state */ netif_carrier_off (net); - net_device_ctx =netdev_priv (net); - net_device_ctx->device_ctx = device_obj; - net_device_ctx->avail = ring_size; + net_device_obj =netdev_priv (net); + net_device_obj->device_obj = device_obj; + net_device_obj->avail = ring_size;dev_set_drvdata (device, net);/* Notify the netvsc driver of the new device */
drivers/staging/hv/storvsc_drv.c +22 -22
139 lines not on this page · raw message
drivers/staging/hv/vmbus_drv.c +82 -82
316 lines not on this page · raw message
Signature · 1 line
1.5.5.6
Quoted 3 lines · K. Y. Srinivasan
Cleanup the names of variables that refer to the
hyperv_deviceabstraction.
I have a script I run on rename patches. For this patch the command would be:
rename_rev.pl -nc -e 's/device_ctx/device_obj/g' -e 's/\bdev_ctx/dev/g'
It show one variable was missed in storvsc_probe().
Quoted 9 lines
drivers/staging/hv/storvsc_drv.c +1
-1memset (host_device_ctx,0 ,sizeof (struct host_device_context )); host_device_ctx->port = host->host_no; - host_device_ctx->device_ctx = device_obj; + host_device_ctx->device_obj = device_obj; host_device_ctx->request_pool = kmem_cache_create(dev_name(&device_obj->device),
drivers/staging/hv/storvsc_drv.c static int storvsc_probe(struct device *device) · line 277
Quoted 8 lines
drivers/staging/hv/storvsc_drv.c +1
-1@@ -271,7 +271,7 @@ static int storvsc_probe(struct device *device)return -1 ; } -/* host_device_ctx->port = device_info.PortNumber; */ +/* host_hyperv_dev->port = device_info.PortNumber; */ host_device_ctx->path = device_info.path_id; host_device_ctx->target = device_info.target_id;
All the other host_device_ctx variables were renamed to host_device_obj.
regards,
dan carpenter
Quoted 35 lines
-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: Friday, February 25, 2011 10:33 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 3/6] Staging: hv: Cleanuphyperv_devicevariable namesQuoted 3 lines · K. Y. Srinivasan
Cleanup the names of variables that refer to the
hyperv_deviceabstraction.I have a script I run on rename patches. For this patch the command would be:
rename_rev.pl -nc -e 's/device_ctx/device_obj/g' -e 's/\bdev_ctx/dev/g'
It show one variable was missed in
storvsc_probe().Quoted 13 lines
drivers/staging/hv/storvsc_drv.c +1
-1memset (host_device_ctx,0 ,sizeof (struct host_device_context )); host_device_ctx->port = host->host_no; - host_device_ctx->device_ctx = device_obj; + host_device_ctx->device_obj = device_obj; host_device_ctx->request_pool = kmem_cache_create(dev_name(&device_obj-device),
drivers/staging/hv/storvsc_drv.c +0
-0@@ -271,7 +271,7 @@ static int storvsc_probe(struct device *device)return -1 ; }
Quoted 7 lines
drivers/staging/hv/storvsc_drv.c static int storvsc_probe(struct device *device) · line 277
Quoted 5 lines
drivers/staging/hv/storvsc_drv.c +1
-1-/* host_device_ctx->port = device_info.PortNumber; */ +/* host_hyperv_dev->port = device_info.PortNumber; */ host_device_ctx->path = device_info.path_id; host_device_ctx->target = device_info.target_id;All the other
host_device_ctxvariables were renamed tohost_device_obj.
host_device_ctx is a scsi abstraction built on top of the hyperv_device abstraction. My goal was not to change the names of higher level scsi abstractions.
Regards,
K. Y
Quoted 3 lines
regards,
dan carpenter
Quoted 2 lines · K. Y. Srinivasan
Cleanup the names of variables that refer to the
hyperv_deviceabstraction.
Clean them up to be what? Shorter? Nice? Full of rounded edges so that when we bump into them in the dark they don't poke us and cause us to shreak in pain?
Quoted 4 lines
Signed-off-by K. Y. Srinivasan <[email protected]>Signed-off-by K. Y. Srinivasan <[email protected]>
Sweet, you cloned yourself, I thought only Alan Cox had achieved that goal...
Quoted 16 lines
Signed-off-by Haiyang Zhang <[email protected]>Signed-off-by Hank Janssen <[email protected]>--- drivers/staging/hv/blkvsc_drv.c | 12 ++-- drivers/staging/hv/netvsc.c | 4 +- drivers/staging/hv/netvsc_drv.c | 36 ++++---- drivers/staging/hv/storvsc_drv.c | 44 +++++----- drivers/staging/hv/vmbus_drv.c | 164 +++++++++++++++++++------------------- 5 files changed, 130 insertions(+), 130 deletions(-)drivers/staging/hv/blkvsc_drv.c +0
-0
drivers/staging/hv/blkvsc_drv.c struct blkvsc_request { · line 98
Quoted 5 lines
drivers/staging/hv/blkvsc_drv.c +1
-1@@ -95,7 +95,7 @@ struct blkvsc_request {/* Per device structure */ struct block_device_context {/* point back to our device context */ -struct hyperv_device *device_ctx; +struct hyperv_device *device_obj;
Hey, I was right, it does have more rounded edges, nicely done.
drivers/staging/hv/blkvsc_drv.c struct blkvsc_request { · line 100
Quoted 4 lines
drivers/staging/hv/blkvsc_drv.c +2
-2-static int netvsc_device_add (struct hyperv_device *device, -void *additional_info); +static int +netvsc_device_add (struct hyperv_device *device,void *additional_info);
Again with the function return value hiding. Please don't.
drivers/staging/hv/storvsc_drv.c struct host_device_context { · line 46
Quoted 8 lines
drivers/staging/hv/storvsc_drv.c +1
-1@@ -43,7 +43,7 @@ struct host_device_context {/* must be 1st field * FIXME this is a bug */ /* point back to our device context */ -struct hyperv_device *device_ctx; +struct hyperv_device *device_obj;
I really don't understand this change at all. "obj" is just as vapid and clueless as "ctx" is, and it seems very gratuitous to change this. And I should know, I have made a lot of gratuitous renames in my time in the kernel...
Quoted 21 lines
drivers/staging/hv/storvsc_drv.c +1
-1static int vmbus_uevent (struct device *device,struct kobj_uevent_env *env) { -struct hyperv_device *device_ctx =device_to_hyperv_device (device); +struct hyperv_device *device_obj =device_to_hyperv_device (device);drivers/staging/hv/storvsc_drv.c +1
-11int ret; DPRINT_INFO(VMBUS_DRV, "generating uevent - VMBUS_DEVICE_CLASS_GUID={" "%02x%02x%02x%02x-%02x%02x-%02x%02x-" "%02x%02x%02x%02x%02x%02x%02x%02x}", - device_ctx->class_id.data[3 ], device_ctx->class_id.data[2 ], - device_ctx->class_id.data[1 ], device_ctx->class_id.data[0 ], - device_ctx->class_id.data[5 ], device_ctx->class_id.data[4 ], - device_ctx->class_id.data[7 ], device_ctx->class_id.data[6 ], - device_ctx->class_id.data[8 ], device_ctx->class_id.data[9 ], - device_ctx->class_id.data[10 ], - device_ctx->class_id.data[11 ], - device_ctx->class_id.data[12 ], - device_ctx->class_id.data[13 ], - device_ctx->class_id.data[14 ], - device_ctx->class_id.data[15 ]); + device_obj->class_id.data[3], device_obj->class_id.data[2],
drivers/staging/hv/storvsc_drv.c
Quoted 10 lines
drivers/staging/hv/storvsc_drv.c +10
-0+ device_obj->class_id.data[1 ], device_obj->class_id.data[0 ], + device_obj->class_id.data[5 ], device_obj->class_id.data[4 ], + device_obj->class_id.data[7 ], device_obj->class_id.data[6 ], + device_obj->class_id.data[8 ], device_obj->class_id.data[9 ], + device_obj->class_id.data[10 ], + device_obj->class_id.data[11 ], + device_obj->class_id.data[12 ], + device_obj->class_id.data[13 ], + device_obj->class_id.data[14 ], + device_obj->class_id.data[15]);
After seeing this stuff so many times I'm waiting for a helper function to be added for it in this subsystem. I'm sure you really don't want to edit GUID printk-like functions ever again, right?
drivers/staging/hv/storvsc_drv.c
Quoted 11 lines
static void
vmbus_device_release(struct device *device){drivers/staging/hv/storvsc_drv.c +3
-3-struct hyperv_device *device_ctx =device_to_hyperv_device (device); +struct hyperv_device *device_obj =device_to_hyperv_device (device); -kfree (device_ctx); +kfree (device_obj); -/* !!DO NOT REFERENCE device_ctx anymore at this point!! */ +/* !!DO NOT REFERENCE device_obj anymore at this point!! */ }
I think by virtue of the kfree() right above this comment, it should be deleted. Especially as it is at the end of the function, making it pretty much impossible to make any sense here...
Come on, global search-and-replace needs to be done in a sane manner, other wise you can just send me a vi macro to run on the code, it would be the same thing in the end (hint, don't do that, only one person has ever gotten away with doing that in the history of the kernel, in an act never to be ever repeated again.)
thanks,
greg k-h
Quoted 60 lines
-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Monday, February 28, 2011 9:44 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Haiyang Zhang; Hank Janssen
Subject: Re: [PATCH 3/6] Staging: hv: Cleanuphyperv_devicevariable namesQuoted 2 lines · K. Y. Srinivasan
Cleanup the names of variables that refer to the
hyperv_deviceabstraction.Clean them up to be what? Shorter? Nice? Full of rounded edges so that when we bump into them in the dark they don't poke us and cause us to shreak in pain?
Quoted 4 lines
Signed-off-by K. Y. Srinivasan <[email protected]>Signed-off-by K. Y. Srinivasan <[email protected]>Sweet, you cloned yourself, I thought only Alan Cox had achieved that goal...
Quoted 9 lines
Signed-off-by Haiyang Zhang <[email protected]>Signed-off-by Hank Janssen <[email protected]>--- drivers/staging/hv/blkvsc_drv.c | 12 ++-- drivers/staging/hv/netvsc.c | 4 +- drivers/staging/hv/netvsc_drv.c | 36 ++++---- drivers/staging/hv/storvsc_drv.c | 44 +++++----- drivers/staging/hv/vmbus_drv.c | 164 +++++++++++++++++++-------------------
drivers/staging/hv/blkvsc_drv.c struct blkvsc_request { · line 98
Quoted 12 lines
5 files changed, 130 insertions(+), 130 deletions(-)drivers/staging/hv/blkvsc_drv.c +1
-1@@ -95,7 +95,7 @@ struct blkvsc_request {/* Per device structure */ struct block_device_context {/* point back to our device context */ -struct hyperv_device *device_ctx; +struct hyperv_device *device_obj;Hey, I was right, it does have more rounded edges, nicely done.
drivers/staging/hv/blkvsc_drv.c struct blkvsc_request { · line 100
Quoted 4 lines
drivers/staging/hv/blkvsc_drv.c +2
-2-static int netvsc_device_add (struct hyperv_device *device, -void *additional_info); +static int +netvsc_device_add (struct hyperv_device *device,void *additional_info);Again with the function return value hiding. Please don't.
Quoted 13 lines
drivers/staging/hv/storvsc_drv.c struct host_device_context { · line 46
Quoted 8 lines
drivers/staging/hv/storvsc_drv.c +1
-1@@ -43,7 +43,7 @@ struct host_device_context {/* must be 1st field * FIXME this is a bug */ /* point back to our device context */ -struct hyperv_device *device_ctx; +struct hyperv_device *device_obj;I really don't understand this change at all. "obj" is just as vapid and clueless as "ctx" is, and it seems very gratuitous to change this. And I should know, I have made a lot of gratuitous renames in my time in the kernel...
Greg, there are not that many options here. As I recall there was universal objection to the use of *context/*ctx to refer to device or driver objects. The name I chose is fairly descriptive of what it represents. If there is consensus on a better name, I will use it.
Quoted 29 lines
drivers/staging/hv/storvsc_drv.c
Quoted 8 lines
drivers/staging/hv/storvsc_drv.c +1
-1static int vmbus_uevent (struct device *device,struct kobj_uevent_env *env) { -struct hyperv_device *device_ctx =device_to_hyperv_device (device); +struct hyperv_device *device_obj =device_to_hyperv_device (device);drivers/staging/hv/storvsc_drv.c +0
-0int ret; DPRINT_INFO(VMBUS_DRV, "generating uevent -VMBUS_DEVICE_CLASS_GUID={"
Quoted 20 lines
drivers/staging/hv/storvsc_drv.c +7
-11"%02x%02x%02x%02x-%02x%02x-%02x%02x-" "%02x%02x%02x%02x%02x%02x%02x%02x}" , - device_ctx->class_id.data[3 ], device_ctx->class_id.data[2 ], - device_ctx->class_id.data[1 ], device_ctx->class_id.data[0 ], - device_ctx->class_id.data[5 ], device_ctx->class_id.data[4 ], - device_ctx->class_id.data[7 ], device_ctx->class_id.data[6 ], - device_ctx->class_id.data[8 ], device_ctx->class_id.data[9 ], - device_ctx->class_id.data[10 ], - device_ctx->class_id.data[11 ], - device_ctx->class_id.data[12 ], - device_ctx->class_id.data[13 ], - device_ctx->class_id.data[14 ], - device_ctx->class_id.data[15]); + device_obj->class_id.data[3 ], device_obj->class_id.data[2 ], + device_obj->class_id.data[1 ], device_obj->class_id.data[0 ], + device_obj->class_id.data[5 ], device_obj->class_id.data[4 ], + device_obj->class_id.data[7 ], device_obj->class_id.data[6 ], + device_obj->class_id.data[8 ], device_obj->class_id.data[9 ], + device_obj->class_id.data[10 ], + device_obj->class_id.data[11],
Quoted 8 lines
drivers/staging/hv/storvsc_drv.c
Quoted 4 lines
drivers/staging/hv/storvsc_drv.c +4
-0+ device_obj->class_id.data[12 ], + device_obj->class_id.data[13 ], + device_obj->class_id.data[14 ], + device_obj->class_id.data[15]);After seeing this stuff so many times I'm waiting for a helper function to be added for it in this subsystem. I'm sure you really don't want to edit GUID printk-like functions ever again, right?
I will have a separate patch for this.
Quoted 9 lines
Quoted 9 lines
static void
vmbus_device_release(struct device *device){drivers/staging/hv/storvsc_drv.c +2
-2-struct hyperv_device *device_ctx =device_to_hyperv_device (device); +struct hyperv_device *device_obj =device_to_hyperv_device (device); -kfree (device_ctx); +kfree (device_obj);
Quoted 7 lines
drivers/staging/hv/storvsc_drv.c
Quoted 3 lines
drivers/staging/hv/storvsc_drv.c +1
-1-/* !!DO NOT REFERENCE device_ctx anymore at this point!! */ +/* !!DO NOT REFERENCE device_obj anymore at this point!! */ }I think by virtue of the
kfree()right above this comment, it should be deleted. Especially as it is at the end of the function, making it pretty much impossible to make any sense here...
For what it is worth; this is existing code. In the spirit of one thing per patch; there will be a patch for this.
Quoted 6 lines
Come on, global search-and-replace needs to be done in a sane manner, other wise you can just send me a vi macro to run on the code, it would be the same thing in the end (hint, don't do that, only one person has ever gotten away with doing that in the history of the kernel, in an act never to be ever repeated again.)
Greg, apart from your objection to the name I picked to refer to variable referring to struct hyperv_device; what else is the problem here.
Regards,
K. Y
Quoted 4 lines
thanks,
greg k-h
Quoted 74 lines · KY Srinivasan
Quoted 60 lines
-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Monday, February 28, 2011 9:44 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Haiyang Zhang; Hank Janssen
Subject: Re: [PATCH 3/6] Staging: hv: Cleanuphyperv_devicevariable namesQuoted 2 lines · K. Y. Srinivasan
Cleanup the names of variables that refer to the
hyperv_deviceabstraction.Clean them up to be what? Shorter? Nice? Full of rounded edges so that when we bump into them in the dark they don't poke us and cause us to shreak in pain?
Quoted 4 lines
Signed-off-by K. Y. Srinivasan <[email protected]>Signed-off-by K. Y. Srinivasan <[email protected]>Sweet, you cloned yourself, I thought only Alan Cox had achieved that goal...
Quoted 9 lines
Signed-off-by Haiyang Zhang <[email protected]>Signed-off-by Hank Janssen <[email protected]>--- drivers/staging/hv/blkvsc_drv.c | 12 ++-- drivers/staging/hv/netvsc.c | 4 +- drivers/staging/hv/netvsc_drv.c | 36 ++++---- drivers/staging/hv/storvsc_drv.c | 44 +++++----- drivers/staging/hv/vmbus_drv.c | 164 +++++++++++++++++++-------------------
drivers/staging/hv/blkvsc_drv.c struct blkvsc_request { · line 98
Quoted 12 lines
5 files changed, 130 insertions(+), 130 deletions(-)drivers/staging/hv/blkvsc_drv.c +1
-1@@ -95,7 +95,7 @@ struct blkvsc_request {/* Per device structure */ struct block_device_context {/* point back to our device context */ -struct hyperv_device *device_ctx; +struct hyperv_device *device_obj;Hey, I was right, it does have more rounded edges, nicely done.
drivers/staging/hv/blkvsc_drv.c struct blkvsc_request { · line 100
Quoted 4 lines
drivers/staging/hv/blkvsc_drv.c +2
-2-static int netvsc_device_add (struct hyperv_device *device, -void *additional_info); +static int +netvsc_device_add (struct hyperv_device *device,void *additional_info);Again with the function return value hiding. Please don't.
Quoted 13 lines
drivers/staging/hv/storvsc_drv.c struct host_device_context { · line 46
Quoted 8 lines
drivers/staging/hv/storvsc_drv.c +1
-1@@ -43,7 +43,7 @@ struct host_device_context {/* must be 1st field * FIXME this is a bug */ /* point back to our device context */ -struct hyperv_device *device_ctx; +struct hyperv_device *device_obj;I really don't understand this change at all. "obj" is just as vapid and clueless as "ctx" is, and it seems very gratuitous to change this. And I should know, I have made a lot of gratuitous renames in my time in the kernel...
Quoted 4 lines
Greg, there are not that many options here. As I recall there was universal objection to the use of *context/*ctx to refer to device or driver objects. The name I chose is fairly descriptive of what it represents. If there is consensus on a better name, I will use it.
Do it like other subsystems, call it a device with the prefix for the type. So for this one, it would be:
struct hyperv_device *hyperv_device; or struct hyperv_device *hyperv_dev;
Quoted 8 lines
Quoted 5 lines
Come on, global search-and-replace needs to be done in a sane manner, other wise you can just send me a vi macro to run on the code, it would be the same thing in the end (hint, don't do that, only one person has ever gotten away with doing that in the history of the kernel, in an act never to be ever repeated again.)
Greg, apart from your objection to the name I picked to refer to variable referring to struct
hyperv_device; what else is the problem here.
Changing the comment that should be removed instead.
thanks,
greg k-h