treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 482
[linux-2.6-block.git] / tools / testing / selftests / kvm / x86_64 / vmx_set_nested_state_test.c
index 61a2163cf9f182ec7b5e6c4a689d8d91677d21b1..d0ae57aae1bec71c794d5ad78f4ccd33d365339e 100644 (file)
@@ -1,10 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-only
 /*
  * vmx_set_nested_state_test
  *
  * Copyright (C) 2019, Google LLC.
  *
- * This work is licensed under the terms of the GNU GPL, version 2.
- *
  * This test verifies the integrity of calling the ioctl KVM_SET_NESTED_STATE.
  */
 
@@ -75,7 +74,7 @@ void set_revision_id_for_vmcs12(struct kvm_nested_state *state,
                                u32 vmcs12_revision)
 {
        /* Set revision_id in vmcs12 to vmcs12_revision. */
-       *(u32 *)(state->data) = vmcs12_revision;
+       memcpy(state->data, &vmcs12_revision, sizeof(u32));
 }
 
 void set_default_state(struct kvm_nested_state *state)