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

staging: hv: Convert camel cased local variables in hv.c to lower cases

staging: hv: Convert camel cased local variables in hv.c to lower cases

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

Haiyang Zhang and committed by
Greg Kroah-Hartman
b8dfb264 6a0aaa18

+86 -86
+86 -86
drivers/staging/hv/hv.c
··· 65 65 unsigned int ebx; 66 66 unsigned int ecx; 67 67 unsigned int edx; 68 - unsigned int maxLeaf; 68 + unsigned int max_leaf; 69 69 unsigned int op; 70 70 71 71 /* ··· 93 93 ((edx >> 16) & 0xFF), 94 94 ((edx >> 24) & 0xFF)); 95 95 96 - maxLeaf = eax; 96 + max_leaf = eax; 97 97 eax = 0; 98 98 ebx = 0; 99 99 ecx = 0; ··· 107 107 ((eax >> 16) & 0xFF), 108 108 ((eax >> 24) & 0xFF)); 109 109 110 - if (maxLeaf >= HVCPUID_VERSION) { 110 + if (max_leaf >= HVCPUID_VERSION) { 111 111 eax = 0; 112 112 ebx = 0; 113 113 ecx = 0; ··· 122 122 edx >> 24, 123 123 edx & 0xFFFFFF); 124 124 } 125 - return maxLeaf; 125 + return max_leaf; 126 126 } 127 127 128 128 /* 129 129 * HvDoHypercall - Invoke the specified hypercall 130 130 */ 131 - static u64 HvDoHypercall(u64 Control, void *Input, void *Output) 131 + static u64 HvDoHypercall(u64 control, void *input, void *output) 132 132 { 133 133 #ifdef CONFIG_X86_64 134 - u64 hvStatus = 0; 135 - u64 inputAddress = (Input) ? virt_to_phys(Input) : 0; 136 - u64 outputAddress = (Output) ? virt_to_phys(Output) : 0; 137 - volatile void *hypercallPage = hv_context.hypercall_page; 134 + u64 hv_status = 0; 135 + u64 input_address = (input) ? virt_to_phys(input) : 0; 136 + u64 output_address = (output) ? virt_to_phys(output) : 0; 137 + volatile void *hypercall_page = hv_context.hypercall_page; 138 138 139 139 DPRINT_DBG(VMBUS, "Hypercall <control %llx input phys %llx virt %p " 140 140 "output phys %llx virt %p hypercall %p>", 141 - Control, inputAddress, Input, 142 - outputAddress, Output, hypercallPage); 141 + control, input_address, input, 142 + output_address, output, hypercall_page); 143 143 144 - __asm__ __volatile__("mov %0, %%r8" : : "r" (outputAddress) : "r8"); 145 - __asm__ __volatile__("call *%3" : "=a" (hvStatus) : 146 - "c" (Control), "d" (inputAddress), 147 - "m" (hypercallPage)); 144 + __asm__ __volatile__("mov %0, %%r8" : : "r" (output_address) : "r8"); 145 + __asm__ __volatile__("call *%3" : "=a" (hv_status) : 146 + "c" (control), "d" (input_address), 147 + "m" (hypercall_page)); 148 148 149 - DPRINT_DBG(VMBUS, "Hypercall <return %llx>", hvStatus); 149 + DPRINT_DBG(VMBUS, "Hypercall <return %llx>", hv_status); 150 150 151 - return hvStatus; 151 + return hv_status; 152 152 153 153 #else 154 154 155 - u32 controlHi = Control >> 32; 156 - u32 controlLo = Control & 0xFFFFFFFF; 157 - u32 hvStatusHi = 1; 158 - u32 hvStatusLo = 1; 159 - u64 inputAddress = (Input) ? virt_to_phys(Input) : 0; 160 - u32 inputAddressHi = inputAddress >> 32; 161 - u32 inputAddressLo = inputAddress & 0xFFFFFFFF; 162 - u64 outputAddress = (Output) ? virt_to_phys(Output) : 0; 163 - u32 outputAddressHi = outputAddress >> 32; 164 - u32 outputAddressLo = outputAddress & 0xFFFFFFFF; 165 - volatile void *hypercallPage = hv_context.hypercall_page; 155 + u32 control_hi = control >> 32; 156 + u32 control_lo = control & 0xFFFFFFFF; 157 + u32 hv_status_hi = 1; 158 + u32 hv_status_lo = 1; 159 + u64 input_address = (input) ? virt_to_phys(input) : 0; 160 + u32 input_address_hi = input_address >> 32; 161 + u32 input_address_lo = input_address & 0xFFFFFFFF; 162 + u64 output_address = (output) ? virt_to_phys(output) : 0; 163 + u32 output_address_hi = output_address >> 32; 164 + u32 output_address_lo = output_address & 0xFFFFFFFF; 165 + volatile void *hypercall_page = hv_context.hypercall_page; 166 166 167 167 DPRINT_DBG(VMBUS, "Hypercall <control %llx input %p output %p>", 168 - Control, Input, Output); 168 + control, input, output); 169 169 170 - __asm__ __volatile__ ("call *%8" : "=d"(hvStatusHi), 171 - "=a"(hvStatusLo) : "d" (controlHi), 172 - "a" (controlLo), "b" (inputAddressHi), 173 - "c" (inputAddressLo), "D"(outputAddressHi), 174 - "S"(outputAddressLo), "m" (hypercallPage)); 170 + __asm__ __volatile__ ("call *%8" : "=d"(hv_status_hi), 171 + "=a"(hv_status_lo) : "d" (control_hi), 172 + "a" (control_lo), "b" (input_address_hi), 173 + "c" (input_address_lo), "D"(output_address_hi), 174 + "S"(output_address_lo), "m" (hypercall_page)); 175 175 176 176 DPRINT_DBG(VMBUS, "Hypercall <return %llx>", 177 - hvStatusLo | ((u64)hvStatusHi << 32)); 177 + hv_status_lo | ((u64)hv_status_hi << 32)); 178 178 179 - return hvStatusLo | ((u64)hvStatusHi << 32); 179 + return hv_status_lo | ((u64)hv_status_hi << 32); 180 180 #endif /* !x86_64 */ 181 181 } 182 182 ··· 188 188 int HvInit(void) 189 189 { 190 190 int ret = 0; 191 - int maxLeaf; 192 - union hv_x64_msr_hypercall_contents hypercallMsr; 193 - void *virtAddr = NULL; 191 + int max_leaf; 192 + union hv_x64_msr_hypercall_contents hypercall_msr; 193 + void *virtaddr = NULL; 194 194 195 195 memset(hv_context.synic_event_page, 0, sizeof(void *) * MAX_NUM_CPUS); 196 196 memset(hv_context.synic_message_page, 0, ··· 204 204 DPRINT_INFO(VMBUS, 205 205 "Windows hypervisor detected! Retrieving more info..."); 206 206 207 - maxLeaf = HvQueryHypervisorInfo(); 207 + max_leaf = HvQueryHypervisorInfo(); 208 208 /* HvQueryHypervisorFeatures(maxLeaf); */ 209 209 210 210 /* ··· 223 223 hv_context.guestid = HV_LINUX_GUEST_ID; 224 224 225 225 /* See if the hypercall page is already set */ 226 - rdmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.as_uint64); 226 + rdmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64); 227 227 228 228 /* 229 229 * Allocate the hypercall page memory 230 - * virtAddr = osd_PageAlloc(1); 230 + * virtaddr = osd_PageAlloc(1); 231 231 */ 232 - virtAddr = osd_VirtualAllocExec(PAGE_SIZE); 232 + virtaddr = osd_VirtualAllocExec(PAGE_SIZE); 233 233 234 - if (!virtAddr) { 234 + if (!virtaddr) { 235 235 DPRINT_ERR(VMBUS, 236 236 "unable to allocate hypercall page!!"); 237 237 goto Cleanup; 238 238 } 239 239 240 - hypercallMsr.enable = 1; 240 + hypercall_msr.enable = 1; 241 241 242 - hypercallMsr.guest_physical_address = vmalloc_to_pfn(virtAddr); 243 - wrmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.as_uint64); 242 + hypercall_msr.guest_physical_address = vmalloc_to_pfn(virtaddr); 243 + wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64); 244 244 245 245 /* Confirm that hypercall page did get setup. */ 246 - hypercallMsr.as_uint64 = 0; 247 - rdmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.as_uint64); 246 + hypercall_msr.as_uint64 = 0; 247 + rdmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64); 248 248 249 - if (!hypercallMsr.enable) { 249 + if (!hypercall_msr.enable) { 250 250 DPRINT_ERR(VMBUS, "unable to set hypercall page!!"); 251 251 goto Cleanup; 252 252 } 253 253 254 - hv_context.hypercall_page = virtAddr; 254 + hv_context.hypercall_page = virtaddr; 255 255 256 256 DPRINT_INFO(VMBUS, "Hypercall page VA=%p, PA=0x%0llx", 257 257 hv_context.hypercall_page, 258 - (u64)hypercallMsr.guest_physical_address << PAGE_SHIFT); 258 + (u64)hypercall_msr.guest_physical_address << PAGE_SHIFT); 259 259 260 260 /* Setup the global signal event param for the signal event hypercall */ 261 261 hv_context.signal_event_buffer = ··· 278 278 return ret; 279 279 280 280 Cleanup: 281 - if (virtAddr) { 282 - if (hypercallMsr.enable) { 283 - hypercallMsr.as_uint64 = 0; 284 - wrmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.as_uint64); 281 + if (virtaddr) { 282 + if (hypercall_msr.enable) { 283 + hypercall_msr.as_uint64 = 0; 284 + wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64); 285 285 } 286 286 287 - vfree(virtAddr); 287 + vfree(virtaddr); 288 288 } 289 289 ret = -1; 290 290 return ret; ··· 297 297 */ 298 298 void HvCleanup(void) 299 299 { 300 - union hv_x64_msr_hypercall_contents hypercallMsr; 300 + union hv_x64_msr_hypercall_contents hypercall_msr; 301 301 302 302 kfree(hv_context.signal_event_buffer); 303 303 hv_context.signal_event_buffer = NULL; 304 304 hv_context.signal_event_param = NULL; 305 305 306 306 if (hv_context.hypercall_page) { 307 - hypercallMsr.as_uint64 = 0; 308 - wrmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.as_uint64); 307 + hypercall_msr.as_uint64 = 0; 308 + wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64); 309 309 vfree(hv_context.hypercall_page); 310 310 hv_context.hypercall_page = NULL; 311 311 } ··· 316 316 * 317 317 * This involves a hypercall. 318 318 */ 319 - u16 HvPostMessage(union hv_connection_id connectionId, 320 - enum hv_message_type messageType, 321 - void *payload, size_t payloadSize) 319 + u16 HvPostMessage(union hv_connection_id connection_id, 320 + enum hv_message_type message_type, 321 + void *payload, size_t payload_size) 322 322 { 323 - struct alignedInput { 323 + struct aligned_input { 324 324 u64 alignment8; 325 325 struct hv_input_post_message msg; 326 326 }; 327 327 328 - struct hv_input_post_message *alignedMsg; 328 + struct hv_input_post_message *aligned_msg; 329 329 u16 status; 330 330 unsigned long addr; 331 331 332 - if (payloadSize > HV_MESSAGE_PAYLOAD_BYTE_COUNT) 332 + if (payload_size > HV_MESSAGE_PAYLOAD_BYTE_COUNT) 333 333 return -1; 334 334 335 - addr = (unsigned long)kmalloc(sizeof(struct alignedInput), GFP_ATOMIC); 335 + addr = (unsigned long)kmalloc(sizeof(struct aligned_input), GFP_ATOMIC); 336 336 if (!addr) 337 337 return -1; 338 338 339 - alignedMsg = (struct hv_input_post_message *) 339 + aligned_msg = (struct hv_input_post_message *) 340 340 (ALIGN_UP(addr, HV_HYPERCALL_PARAM_ALIGN)); 341 341 342 - alignedMsg->connectionid = connectionId; 343 - alignedMsg->message_type = messageType; 344 - alignedMsg->payload_size = payloadSize; 345 - memcpy((void *)alignedMsg->payload, payload, payloadSize); 342 + aligned_msg->connectionid = connection_id; 343 + aligned_msg->message_type = message_type; 344 + aligned_msg->payload_size = payload_size; 345 + memcpy((void *)aligned_msg->payload, payload, payload_size); 346 346 347 - status = HvDoHypercall(HVCALL_POST_MESSAGE, alignedMsg, NULL) & 0xFFFF; 347 + status = HvDoHypercall(HVCALL_POST_MESSAGE, aligned_msg, NULL) & 0xFFFF; 348 348 349 349 kfree((void *)addr); 350 350 ··· 379 379 u64 version; 380 380 union hv_synic_simp simp; 381 381 union hv_synic_siefp siefp; 382 - union hv_synic_sint sharedSint; 382 + union hv_synic_sint shared_sint; 383 383 union hv_synic_scontrol sctrl; 384 384 385 - u32 irqVector = *((u32 *)(irqarg)); 385 + u32 irq_vector = *((u32 *)(irqarg)); 386 386 int cpu = smp_processor_id(); 387 387 388 388 if (!hv_context.hypercall_page) ··· 436 436 /* interceptionSint.as_uint64); */ 437 437 438 438 /* Setup the shared SINT. */ 439 - rdmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, sharedSint.as_uint64); 439 + rdmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, shared_sint.as_uint64); 440 440 441 - sharedSint.as_uint64 = 0; 442 - sharedSint.vector = irqVector; /* HV_SHARED_SINT_IDT_VECTOR + 0x20; */ 443 - sharedSint.masked = false; 444 - sharedSint.auto_eoi = true; 441 + shared_sint.as_uint64 = 0; 442 + shared_sint.vector = irq_vector; /* HV_SHARED_SINT_IDT_VECTOR + 0x20; */ 443 + shared_sint.masked = false; 444 + shared_sint.auto_eoi = true; 445 445 446 446 DPRINT_DBG(VMBUS, "HV_X64_MSR_SINT1 msr set to: %llx", 447 - sharedSint.as_uint64); 447 + shared_sint.as_uint64); 448 448 449 - wrmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, sharedSint.as_uint64); 449 + wrmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, shared_sint.as_uint64); 450 450 451 451 /* Enable the global synic bit */ 452 452 rdmsrl(HV_X64_MSR_SCONTROL, sctrl.as_uint64); ··· 471 471 */ 472 472 void HvSynicCleanup(void *arg) 473 473 { 474 - union hv_synic_sint sharedSint; 474 + union hv_synic_sint shared_sint; 475 475 union hv_synic_simp simp; 476 476 union hv_synic_siefp siefp; 477 477 int cpu = smp_processor_id(); ··· 479 479 if (!hv_context.synic_initialized) 480 480 return; 481 481 482 - rdmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, sharedSint.as_uint64); 482 + rdmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, shared_sint.as_uint64); 483 483 484 - sharedSint.masked = 1; 484 + shared_sint.masked = 1; 485 485 486 486 /* Need to correctly cleanup in the case of SMP!!! */ 487 487 /* Disable the interrupt */ 488 - wrmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, sharedSint.as_uint64); 488 + wrmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, shared_sint.as_uint64); 489 489 490 490 rdmsrl(HV_X64_MSR_SIMP, simp.as_uint64); 491 491 simp.simp_enabled = 0;