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

staging: hv: Convert camel cased struct fields in hv.h to lower cases

staging: hv: Convert camel cased struct fields in hv.h 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
6a0aaa18 f6feebe0

+63 -58
+50 -45
drivers/staging/hv/hv.c
··· 28 28 #include "vmbus_private.h" 29 29 30 30 /* The one and only */ 31 - struct hv_context gHvContext = { 32 - .SynICInitialized = false, 33 - .HypercallPage = NULL, 34 - .SignalEventParam = NULL, 35 - .SignalEventBuffer = NULL, 31 + struct hv_context hv_context = { 32 + .synic_initialized = false, 33 + .hypercall_page = NULL, 34 + .signal_event_param = NULL, 35 + .signal_event_buffer = NULL, 36 36 }; 37 37 38 38 /* ··· 134 134 u64 hvStatus = 0; 135 135 u64 inputAddress = (Input) ? virt_to_phys(Input) : 0; 136 136 u64 outputAddress = (Output) ? virt_to_phys(Output) : 0; 137 - volatile void *hypercallPage = gHvContext.HypercallPage; 137 + volatile void *hypercallPage = 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>", ··· 162 162 u64 outputAddress = (Output) ? virt_to_phys(Output) : 0; 163 163 u32 outputAddressHi = outputAddress >> 32; 164 164 u32 outputAddressLo = outputAddress & 0xFFFFFFFF; 165 - volatile void *hypercallPage = gHvContext.HypercallPage; 165 + volatile void *hypercallPage = hv_context.hypercall_page; 166 166 167 167 DPRINT_DBG(VMBUS, "Hypercall <control %llx input %p output %p>", 168 168 Control, Input, Output); ··· 192 192 union hv_x64_msr_hypercall_contents hypercallMsr; 193 193 void *virtAddr = NULL; 194 194 195 - memset(gHvContext.synICEventPage, 0, sizeof(void *) * MAX_NUM_CPUS); 196 - memset(gHvContext.synICMessagePage, 0, sizeof(void *) * MAX_NUM_CPUS); 195 + memset(hv_context.synic_event_page, 0, sizeof(void *) * MAX_NUM_CPUS); 196 + memset(hv_context.synic_message_page, 0, 197 + sizeof(void *) * MAX_NUM_CPUS); 197 198 198 199 if (!HvQueryHypervisorPresence()) { 199 200 DPRINT_ERR(VMBUS, "No Windows hypervisor detected!!"); ··· 210 209 /* 211 210 * We only support running on top of Hyper-V 212 211 */ 213 - rdmsrl(HV_X64_MSR_GUEST_OS_ID, gHvContext.GuestId); 212 + rdmsrl(HV_X64_MSR_GUEST_OS_ID, hv_context.guestid); 214 213 215 - if (gHvContext.GuestId != 0) { 214 + if (hv_context.guestid != 0) { 216 215 DPRINT_ERR(VMBUS, "Unknown guest id (0x%llx)!!", 217 - gHvContext.GuestId); 216 + hv_context.guestid); 218 217 goto Cleanup; 219 218 } 220 219 221 220 /* Write our OS info */ 222 221 wrmsrl(HV_X64_MSR_GUEST_OS_ID, HV_LINUX_GUEST_ID); 223 - gHvContext.GuestId = HV_LINUX_GUEST_ID; 222 + hv_context.guestid = HV_LINUX_GUEST_ID; 224 223 225 224 /* See if the hypercall page is already set */ 226 225 rdmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.as_uint64); ··· 251 250 goto Cleanup; 252 251 } 253 252 254 - gHvContext.HypercallPage = virtAddr; 253 + hv_context.hypercall_page = virtAddr; 255 254 256 255 DPRINT_INFO(VMBUS, "Hypercall page VA=%p, PA=0x%0llx", 257 - gHvContext.HypercallPage, 256 + hv_context.hypercall_page, 258 257 (u64)hypercallMsr.guest_physical_address << PAGE_SHIFT); 259 258 260 259 /* Setup the global signal event param for the signal event hypercall */ 261 - gHvContext.SignalEventBuffer = 260 + hv_context.signal_event_buffer = 262 261 kmalloc(sizeof(struct hv_input_signal_event_buffer), 263 262 GFP_KERNEL); 264 - if (!gHvContext.SignalEventBuffer) 263 + if (!hv_context.signal_event_buffer) 265 264 goto Cleanup; 266 265 267 - gHvContext.SignalEventParam = 266 + hv_context.signal_event_param = 268 267 (struct hv_input_signal_event *) 269 - (ALIGN_UP((unsigned long)gHvContext.SignalEventBuffer, 268 + (ALIGN_UP((unsigned long) 269 + hv_context.signal_event_buffer, 270 270 HV_HYPERCALL_PARAM_ALIGN)); 271 - gHvContext.SignalEventParam->connectionid.asu32 = 0; 272 - gHvContext.SignalEventParam->connectionid.u.id = 271 + hv_context.signal_event_param->connectionid.asu32 = 0; 272 + hv_context.signal_event_param->connectionid.u.id = 273 273 VMBUS_EVENT_CONNECTION_ID; 274 - gHvContext.SignalEventParam->flag_number = 0; 275 - gHvContext.SignalEventParam->rsvdz = 0; 274 + hv_context.signal_event_param->flag_number = 0; 275 + hv_context.signal_event_param->rsvdz = 0; 276 276 277 277 return ret; 278 278 ··· 299 297 { 300 298 union hv_x64_msr_hypercall_contents hypercallMsr; 301 299 302 - kfree(gHvContext.SignalEventBuffer); 303 - gHvContext.SignalEventBuffer = NULL; 304 - gHvContext.SignalEventParam = NULL; 300 + kfree(hv_context.signal_event_buffer); 301 + hv_context.signal_event_buffer = NULL; 302 + hv_context.signal_event_param = NULL; 305 303 306 - if (gHvContext.HypercallPage) { 304 + if (hv_context.hypercall_page) { 307 305 hypercallMsr.as_uint64 = 0; 308 306 wrmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.as_uint64); 309 - vfree(gHvContext.HypercallPage); 310 - gHvContext.HypercallPage = NULL; 307 + vfree(hv_context.hypercall_page); 308 + hv_context.hypercall_page = NULL; 311 309 } 312 310 } 313 311 ··· 361 359 { 362 360 u16 status; 363 361 364 - status = HvDoHypercall(HVCALL_SIGNAL_EVENT, gHvContext.SignalEventParam, 362 + status = HvDoHypercall(HVCALL_SIGNAL_EVENT, 363 + hv_context.signal_event_param, 365 364 NULL) & 0xFFFF; 366 365 return status; 367 366 } ··· 385 382 u32 irqVector = *((u32 *)(irqarg)); 386 383 int cpu = smp_processor_id(); 387 384 388 - if (!gHvContext.HypercallPage) 385 + if (!hv_context.hypercall_page) 389 386 return; 390 387 391 388 /* Check the version */ ··· 393 390 394 391 DPRINT_INFO(VMBUS, "SynIC version: %llx", version); 395 392 396 - gHvContext.synICMessagePage[cpu] = (void *)get_zeroed_page(GFP_ATOMIC); 393 + hv_context.synic_message_page[cpu] = 394 + (void *)get_zeroed_page(GFP_ATOMIC); 397 395 398 - if (gHvContext.synICMessagePage[cpu] == NULL) { 396 + if (hv_context.synic_message_page[cpu] == NULL) { 399 397 DPRINT_ERR(VMBUS, 400 398 "unable to allocate SYNIC message page!!"); 401 399 goto Cleanup; 402 400 } 403 401 404 - gHvContext.synICEventPage[cpu] = (void *)get_zeroed_page(GFP_ATOMIC); 402 + hv_context.synic_event_page[cpu] = 403 + (void *)get_zeroed_page(GFP_ATOMIC); 405 404 406 - if (gHvContext.synICEventPage[cpu] == NULL) { 405 + if (hv_context.synic_event_page[cpu] == NULL) { 407 406 DPRINT_ERR(VMBUS, 408 407 "unable to allocate SYNIC event page!!"); 409 408 goto Cleanup; ··· 414 409 /* Setup the Synic's message page */ 415 410 rdmsrl(HV_X64_MSR_SIMP, simp.as_uint64); 416 411 simp.simp_enabled = 1; 417 - simp.base_simp_gpa = virt_to_phys(gHvContext.synICMessagePage[cpu]) 412 + simp.base_simp_gpa = virt_to_phys(hv_context.synic_message_page[cpu]) 418 413 >> PAGE_SHIFT; 419 414 420 415 DPRINT_DBG(VMBUS, "HV_X64_MSR_SIMP msr set to: %llx", simp.as_uint64); ··· 424 419 /* Setup the Synic's event page */ 425 420 rdmsrl(HV_X64_MSR_SIEFP, siefp.as_uint64); 426 421 siefp.siefp_enabled = 1; 427 - siefp.base_siefp_gpa = virt_to_phys(gHvContext.synICEventPage[cpu]) 422 + siefp.base_siefp_gpa = virt_to_phys(hv_context.synic_event_page[cpu]) 428 423 >> PAGE_SHIFT; 429 424 430 425 DPRINT_DBG(VMBUS, "HV_X64_MSR_SIEFP msr set to: %llx", siefp.as_uint64); ··· 454 449 455 450 wrmsrl(HV_X64_MSR_SCONTROL, sctrl.as_uint64); 456 451 457 - gHvContext.SynICInitialized = true; 452 + hv_context.synic_initialized = true; 458 453 return; 459 454 460 455 Cleanup: 461 - if (gHvContext.synICEventPage[cpu]) 462 - osd_PageFree(gHvContext.synICEventPage[cpu], 1); 456 + if (hv_context.synic_event_page[cpu]) 457 + osd_PageFree(hv_context.synic_event_page[cpu], 1); 463 458 464 - if (gHvContext.synICMessagePage[cpu]) 465 - osd_PageFree(gHvContext.synICMessagePage[cpu], 1); 459 + if (hv_context.synic_message_page[cpu]) 460 + osd_PageFree(hv_context.synic_message_page[cpu], 1); 466 461 return; 467 462 } 468 463 ··· 476 471 union hv_synic_siefp siefp; 477 472 int cpu = smp_processor_id(); 478 473 479 - if (!gHvContext.SynICInitialized) 474 + if (!hv_context.synic_initialized) 480 475 return; 481 476 482 477 rdmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, sharedSint.as_uint64); ··· 499 494 500 495 wrmsrl(HV_X64_MSR_SIEFP, siefp.as_uint64); 501 496 502 - osd_PageFree(gHvContext.synICMessagePage[cpu], 1); 503 - osd_PageFree(gHvContext.synICEventPage[cpu], 1); 497 + osd_PageFree(hv_context.synic_message_page[cpu], 1); 498 + osd_PageFree(hv_context.synic_event_page[cpu], 1); 504 499 }
+10 -10
drivers/staging/hv/hv.h
··· 92 92 93 93 94 94 struct hv_input_signal_event_buffer { 95 - u64 Align8; 96 - struct hv_input_signal_event Event; 95 + u64 align8; 96 + struct hv_input_signal_event event; 97 97 }; 98 98 99 99 struct hv_context { 100 100 /* We only support running on top of Hyper-V 101 101 * So at this point this really can only contain the Hyper-V ID 102 102 */ 103 - u64 GuestId; 103 + u64 guestid; 104 104 105 - void *HypercallPage; 105 + void *hypercall_page; 106 106 107 - bool SynICInitialized; 107 + bool synic_initialized; 108 108 109 109 /* 110 110 * This is used as an input param to HvCallSignalEvent hypercall. The 111 111 * input param is immutable in our usage and must be dynamic mem (vs 112 112 * stack or global). */ 113 - struct hv_input_signal_event_buffer *SignalEventBuffer; 113 + struct hv_input_signal_event_buffer *signal_event_buffer; 114 114 /* 8-bytes aligned of the buffer above */ 115 - struct hv_input_signal_event *SignalEventParam; 115 + struct hv_input_signal_event *signal_event_param; 116 116 117 - void *synICMessagePage[MAX_NUM_CPUS]; 118 - void *synICEventPage[MAX_NUM_CPUS]; 117 + void *synic_message_page[MAX_NUM_CPUS]; 118 + void *synic_event_page[MAX_NUM_CPUS]; 119 119 }; 120 120 121 - extern struct hv_context gHvContext; 121 + extern struct hv_context hv_context; 122 122 123 123 124 124 /* Hv Interface */
+3 -3
drivers/staging/hv/vmbus.c
··· 147 147 static void VmbusOnMsgDPC(struct hv_driver *drv) 148 148 { 149 149 int cpu = smp_processor_id(); 150 - void *page_addr = gHvContext.synICMessagePage[cpu]; 150 + void *page_addr = hv_context.synic_message_page[cpu]; 151 151 struct hv_message *msg = (struct hv_message *)page_addr + 152 152 VMBUS_MESSAGE_SINT; 153 153 struct hv_message *copied; ··· 208 208 struct hv_message *msg; 209 209 union hv_synic_event_flags *event; 210 210 211 - page_addr = gHvContext.synICMessagePage[cpu]; 211 + page_addr = hv_context.synic_message_page[cpu]; 212 212 msg = (struct hv_message *)page_addr + VMBUS_MESSAGE_SINT; 213 213 214 214 /* Check if there are actual msgs to be process */ ··· 220 220 } 221 221 222 222 /* TODO: Check if there are events to be process */ 223 - page_addr = gHvContext.synICEventPage[cpu]; 223 + page_addr = hv_context.synic_event_page[cpu]; 224 224 event = (union hv_synic_event_flags *)page_addr + VMBUS_MESSAGE_SINT; 225 225 226 226 /* Since we are a child, we only need to check bit 0 */