Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: hv: Convert camel case struct fields in storvsc.c to lowercase

Convert camel cased struct fields in storvsc.c to lowercase

Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Hank Janssen and committed by
Greg Kroah-Hartman
3d8cdf22 eb4f3e0a

+67 -66
+67 -66
drivers/staging/hv/storvsc.c
··· 34 34 struct storvsc_request_extension { 35 35 /* LIST_ENTRY ListEntry; */ 36 36 37 - struct hv_storvsc_request *Request; 38 - struct hv_device *Device; 37 + struct hv_storvsc_request *request; 38 + struct hv_device *device; 39 39 40 40 /* Synchronize the request/response if needed */ 41 - struct osd_waitevent *WaitEvent; 41 + struct osd_waitevent *wait_event; 42 42 43 - struct vstor_packet VStorPacket; 43 + struct vstor_packet vstor_packet; 44 44 }; 45 45 46 46 /* A storvsc device is a device object that contains a vmbus channel */ 47 47 struct storvsc_device { 48 - struct hv_device *Device; 48 + struct hv_device *device; 49 49 50 50 /* 0 indicates the device is being destroyed */ 51 - atomic_t RefCount; 51 + atomic_t ref_count; 52 52 53 - atomic_t NumOutstandingRequests; 53 + atomic_t num_outstanding_requests; 54 54 55 55 /* 56 56 * Each unique Port/Path/Target represents 1 channel ie scsi 57 57 * controller. In reality, the pathid, targetid is always 0 58 58 * and the port is set by us 59 59 */ 60 - unsigned int PortNumber; 61 - unsigned char PathId; 62 - unsigned char TargetId; 60 + unsigned int port_number; 61 + unsigned char path_id; 62 + unsigned char target_id; 63 63 64 64 /* LIST_ENTRY OutstandingRequestList; */ 65 65 /* HANDLE OutstandingRequestLock; */ 66 66 67 67 /* Used for vsc/vsp channel reset process */ 68 - struct storvsc_request_extension InitRequest; 69 - struct storvsc_request_extension ResetRequest; 68 + struct storvsc_request_extension init_request; 69 + struct storvsc_request_extension reset_request; 70 70 }; 71 71 72 72 73 - static const char *gDriverName = "storvsc"; 73 + static const char *g_driver_name = "storvsc"; 74 74 75 75 /* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */ 76 76 static const struct hv_guid gStorVscDeviceType = { ··· 90 90 return NULL; 91 91 92 92 /* Set to 2 to allow both inbound and outbound traffics */ 93 - /* (ie GetStorDevice() and MustGetStorDevice()) to proceed. */ 94 - atomic_cmpxchg(&storDevice->RefCount, 0, 2); 93 + /* (ie get_stor_device() and must_get_stor_device()) to proceed. */ 94 + atomic_cmpxchg(&storDevice->ref_count, 0, 2); 95 95 96 - storDevice->Device = Device; 96 + storDevice->device = Device; 97 97 Device->Extension = storDevice; 98 98 99 99 return storDevice; ··· 101 101 102 102 static inline void FreeStorDevice(struct storvsc_device *Device) 103 103 { 104 - /* ASSERT(atomic_read(&Device->RefCount) == 0); */ 104 + /* ASSERT(atomic_read(&Device->ref_count) == 0); */ 105 105 kfree(Device); 106 106 } 107 107 ··· 111 111 struct storvsc_device *storDevice; 112 112 113 113 storDevice = (struct storvsc_device *)Device->Extension; 114 - if (storDevice && atomic_read(&storDevice->RefCount) > 1) 115 - atomic_inc(&storDevice->RefCount); 114 + if (storDevice && atomic_read(&storDevice->ref_count) > 1) 115 + atomic_inc(&storDevice->ref_count); 116 116 else 117 117 storDevice = NULL; 118 118 ··· 125 125 struct storvsc_device *storDevice; 126 126 127 127 storDevice = (struct storvsc_device *)Device->Extension; 128 - if (storDevice && atomic_read(&storDevice->RefCount)) 129 - atomic_inc(&storDevice->RefCount); 128 + if (storDevice && atomic_read(&storDevice->ref_count)) 129 + atomic_inc(&storDevice->ref_count); 130 130 else 131 131 storDevice = NULL; 132 132 ··· 140 140 storDevice = (struct storvsc_device *)Device->Extension; 141 141 /* ASSERT(storDevice); */ 142 142 143 - atomic_dec(&storDevice->RefCount); 144 - /* ASSERT(atomic_read(&storDevice->RefCount)); */ 143 + atomic_dec(&storDevice->ref_count); 144 + /* ASSERT(atomic_read(&storDevice->ref_count)); */ 145 145 } 146 146 147 147 /* Drop ref count to 1 to effectively disable GetStorDevice() */ ··· 153 153 /* ASSERT(storDevice); */ 154 154 155 155 /* Busy wait until the ref drop to 2, then set it to 1 */ 156 - while (atomic_cmpxchg(&storDevice->RefCount, 2, 1) != 2) 156 + while (atomic_cmpxchg(&storDevice->ref_count, 2, 1) != 2) 157 157 udelay(100); 158 158 159 159 return storDevice; ··· 169 169 /* ASSERT(storDevice); */ 170 170 171 171 /* Busy wait until the ref drop to 1, then set it to 0 */ 172 - while (atomic_cmpxchg(&storDevice->RefCount, 1, 0) != 1) 172 + while (atomic_cmpxchg(&storDevice->ref_count, 1, 0) != 1) 173 173 udelay(100); 174 174 175 175 Device->Extension = NULL; ··· 190 190 return -1; 191 191 } 192 192 193 - request = &storDevice->InitRequest; 194 - vstorPacket = &request->VStorPacket; 193 + request = &storDevice->init_request; 194 + vstorPacket = &request->vstor_packet; 195 195 196 196 /* 197 197 * Now, initiate the vsc/vsp initialization protocol on the open 198 198 * channel 199 199 */ 200 200 memset(request, 0, sizeof(struct storvsc_request_extension)); 201 - request->WaitEvent = osd_waitevent_create(); 202 - if (!request->WaitEvent) { 201 + request->wait_event = osd_waitevent_create(); 202 + if (!request->wait_event) { 203 203 ret = -ENOMEM; 204 204 goto nomem; 205 205 } ··· 224 224 goto Cleanup; 225 225 } 226 226 227 - osd_waitevent_wait(request->WaitEvent); 227 + osd_waitevent_wait(request->wait_event); 228 228 229 229 if (vstorPacket->operation != VSTOR_OPERATION_COMPLETE_IO || 230 230 vstorPacket->status != 0) { ··· 255 255 goto Cleanup; 256 256 } 257 257 258 - osd_waitevent_wait(request->WaitEvent); 258 + osd_waitevent_wait(request->wait_event); 259 259 260 260 /* TODO: Check returned version */ 261 261 if (vstorPacket->operation != VSTOR_OPERATION_COMPLETE_IO || ··· 273 273 vstorPacket->operation = VSTOR_OPERATION_QUERY_PROPERTIES; 274 274 vstorPacket->flags = REQUEST_COMPLETION_FLAG; 275 275 vstorPacket->storage_channel_properties.port_number = 276 - storDevice->PortNumber; 276 + storDevice->port_number; 277 277 278 278 ret = vmbus_sendpacket(Device->channel, vstorPacket, 279 279 sizeof(struct vstor_packet), ··· 287 287 goto Cleanup; 288 288 } 289 289 290 - osd_waitevent_wait(request->WaitEvent); 290 + osd_waitevent_wait(request->wait_event); 291 291 292 292 /* TODO: Check returned version */ 293 293 if (vstorPacket->operation != VSTOR_OPERATION_COMPLETE_IO || ··· 298 298 goto Cleanup; 299 299 } 300 300 301 - storDevice->PathId = vstorPacket->storage_channel_properties.path_id; 302 - storDevice->TargetId 301 + storDevice->path_id = vstorPacket->storage_channel_properties.path_id; 302 + storDevice->target_id 303 303 = vstorPacket->storage_channel_properties.target_id; 304 304 305 305 DPRINT_DBG(STORVSC, "channel flag 0x%x, max xfer len 0x%x", ··· 324 324 goto Cleanup; 325 325 } 326 326 327 - osd_waitevent_wait(request->WaitEvent); 327 + osd_waitevent_wait(request->wait_event); 328 328 329 329 if (vstorPacket->operation != VSTOR_OPERATION_COMPLETE_IO || 330 330 vstorPacket->status != 0) { ··· 337 337 DPRINT_INFO(STORVSC, "**** storage channel up and running!! ****"); 338 338 339 339 Cleanup: 340 - kfree(request->WaitEvent); 341 - request->WaitEvent = NULL; 340 + kfree(request->wait_event); 341 + request->wait_event = NULL; 342 342 nomem: 343 343 PutStorDevice(Device); 344 344 return ret; ··· 365 365 /* ASSERT(RequestExt != NULL); */ 366 366 /* ASSERT(RequestExt->Request != NULL); */ 367 367 368 - request = RequestExt->Request; 368 + request = RequestExt->request; 369 369 370 370 /* ASSERT(request->OnIOCompletion != NULL); */ 371 371 ··· 403 403 404 404 request->on_io_completion(request); 405 405 406 - atomic_dec(&storDevice->NumOutstandingRequests); 406 + atomic_dec(&storDevice->num_outstanding_requests); 407 407 408 408 PutStorDevice(Device); 409 409 } ··· 463 463 /* ASSERT(request);c */ 464 464 465 465 /* if (vstorPacket.Flags & SYNTHETIC_FLAG) */ 466 - if ((request == &storDevice->InitRequest) || 467 - (request == &storDevice->ResetRequest)) { 466 + if ((request == &storDevice->init_request) || 467 + (request == &storDevice->reset_request)) { 468 468 /* DPRINT_INFO(STORVSC, 469 469 * "reset completion - operation " 470 470 * "%u status %u", 471 471 * vstorPacket.Operation, 472 472 * vstorPacket.Status); */ 473 473 474 - memcpy(&request->VStorPacket, packet, 474 + memcpy(&request->vstor_packet, packet, 475 475 sizeof(struct vstor_packet)); 476 476 477 - osd_waitevent_set(request->WaitEvent); 477 + osd_waitevent_set(request->wait_event); 478 478 } else { 479 479 StorVscOnReceive(device, 480 480 (struct vstor_packet *)packet, ··· 522 522 523 523 /* 524 524 * StorVscOnDeviceAdd - Callback when the device belonging to this driver is added 525 + * is added 525 526 */ 526 527 static int StorVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo) 527 528 { ··· 553 552 storChannel->PathId = props->PathId; 554 553 storChannel->TargetId = props->TargetId; */ 555 554 556 - storDevice->PortNumber = deviceInfo->port_number; 555 + storDevice->port_number = deviceInfo->port_number; 557 556 /* Send it back up */ 558 557 ret = StorVscConnectToVsp(Device); 559 558 560 559 /* deviceInfo->PortNumber = storDevice->PortNumber; */ 561 - deviceInfo->path_id = storDevice->PathId; 562 - deviceInfo->target_id = storDevice->TargetId; 560 + deviceInfo->path_id = storDevice->path_id; 561 + deviceInfo->target_id = storDevice->target_id; 563 562 564 563 DPRINT_DBG(STORVSC, "assigned port %u, path %u target %u\n", 565 - storDevice->PortNumber, storDevice->PathId, 566 - storDevice->TargetId); 564 + storDevice->port_number, storDevice->path_id, 565 + storDevice->target_id); 567 566 568 567 Cleanup: 569 568 return ret; ··· 586 585 * only allow inbound traffic (responses) to proceed so that 587 586 * outstanding requests can be completed. 588 587 */ 589 - while (atomic_read(&storDevice->NumOutstandingRequests)) { 588 + while (atomic_read(&storDevice->num_outstanding_requests)) { 590 589 DPRINT_INFO(STORVSC, "waiting for %d requests to complete...", 591 - atomic_read(&storDevice->NumOutstandingRequests)); 590 + atomic_read(&storDevice->num_outstanding_requests)); 592 591 udelay(100); 593 592 } 594 593 ··· 622 621 return -1; 623 622 } 624 623 625 - request = &storDevice->ResetRequest; 626 - vstorPacket = &request->VStorPacket; 624 + request = &storDevice->reset_request; 625 + vstorPacket = &request->vstor_packet; 627 626 628 - request->WaitEvent = osd_waitevent_create(); 629 - if (!request->WaitEvent) { 627 + request->wait_event = osd_waitevent_create(); 628 + if (!request->wait_event) { 630 629 ret = -ENOMEM; 631 630 goto Cleanup; 632 631 } 633 632 634 633 vstorPacket->operation = VSTOR_OPERATION_RESET_BUS; 635 634 vstorPacket->flags = REQUEST_COMPLETION_FLAG; 636 - vstorPacket->vm_srb.path_id = storDevice->PathId; 635 + vstorPacket->vm_srb.path_id = storDevice->path_id; 637 636 638 637 ret = vmbus_sendpacket(Device->channel, vstorPacket, 639 638 sizeof(struct vstor_packet), 640 - (unsigned long)&storDevice->ResetRequest, 639 + (unsigned long)&storDevice->reset_request, 641 640 VmbusPacketTypeDataInBand, 642 641 VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); 643 642 if (ret != 0) { ··· 647 646 } 648 647 649 648 /* FIXME: Add a timeout */ 650 - osd_waitevent_wait(request->WaitEvent); 649 + osd_waitevent_wait(request->wait_event); 651 650 652 - kfree(request->WaitEvent); 651 + kfree(request->wait_event); 653 652 DPRINT_INFO(STORVSC, "host adapter reset completed"); 654 653 655 654 /* ··· 675 674 676 675 requestExtension = 677 676 (struct storvsc_request_extension *)Request->extension; 678 - vstorPacket = &requestExtension->VStorPacket; 677 + vstorPacket = &requestExtension->vstor_packet; 679 678 storDevice = GetStorDevice(Device); 680 679 681 680 DPRINT_DBG(STORVSC, "enter - Device %p, DeviceExt %p, Request %p, " ··· 695 694 /* print_hex_dump_bytes("", DUMP_PREFIX_NONE, Request->Cdb, 696 695 * Request->CdbLen); */ 697 696 698 - requestExtension->Request = Request; 699 - requestExtension->Device = Device; 697 + requestExtension->request = Request; 698 + requestExtension->device = Device; 700 699 701 700 memset(vstorPacket, 0 , sizeof(struct vstor_packet)); 702 701 ··· 730 729 vstorPacket->vm_srb.sense_info_length, 731 730 vstorPacket->vm_srb.cdb_length); 732 731 733 - if (requestExtension->Request->data_buffer.Length) { 732 + if (requestExtension->request->data_buffer.Length) { 734 733 ret = vmbus_sendpacket_multipagebuffer(Device->channel, 735 - &requestExtension->Request->data_buffer, 734 + &requestExtension->request->data_buffer, 736 735 vstorPacket, 737 736 sizeof(struct vstor_packet), 738 737 (unsigned long)requestExtension); ··· 749 748 vstorPacket, ret); 750 749 } 751 750 752 - atomic_inc(&storDevice->NumOutstandingRequests); 751 + atomic_inc(&storDevice->num_outstanding_requests); 753 752 754 753 PutStorDevice(Device); 755 754 return ret; ··· 783 782 /* Make sure we are at least 2 pages since 1 page is used for control */ 784 783 /* ASSERT(storDriver->RingBufferSize >= (PAGE_SIZE << 1)); */ 785 784 786 - Driver->name = gDriverName; 785 + Driver->name = g_driver_name; 787 786 memcpy(&Driver->deviceType, &gStorVscDeviceType, 788 787 sizeof(struct hv_guid)); 789 788