diff options
author | Li kunyu <kunyu@nfschina.com> | 2022-09-28 14:40:46 +0800 |
---|---|---|
committer | Wei Liu <wei.liu@kernel.org> | 2022-09-28 13:36:56 +0000 |
commit | d5ebde1e2b46154d7e03efb1ae3039a304e5386d (patch) | |
tree | c458dd46f795936b97ec128a10264e11a0625f51 /include/asm-generic/mshyperv.h | |
parent | fb2d14add4f813c73bd9d28b750315ccb3f5f0ea (diff) | |
download | linux-stable-d5ebde1e2b46154d7e03efb1ae3039a304e5386d.tar.gz linux-stable-d5ebde1e2b46154d7e03efb1ae3039a304e5386d.tar.bz2 linux-stable-d5ebde1e2b46154d7e03efb1ae3039a304e5386d.zip |
hyperv: simplify and rename generate_guest_id
The generate_guest_id function is more suitable for use after the
following modifications.
1. The return value of the function is modified to u64.
2. Remove the d_info1 and d_info2 parameters from the function, keep the
u64 type kernel_version parameter.
3. Rename the function to make it clearly a Hyper-V related function,
and modify it to hv_generate_guest_id.
Signed-off-by: Li kunyu <kunyu@nfschina.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20220928064046.3545-1-kunyu@nfschina.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Diffstat (limited to 'include/asm-generic/mshyperv.h')
-rw-r--r-- | include/asm-generic/mshyperv.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h index c05d2ce9b6cd..bfb9eb9d7215 100644 --- a/include/asm-generic/mshyperv.h +++ b/include/asm-generic/mshyperv.h @@ -105,15 +105,12 @@ static inline u64 hv_do_rep_hypercall(u16 code, u16 rep_count, u16 varhead_size, } /* Generate the guest OS identifier as described in the Hyper-V TLFS */ -static inline __u64 generate_guest_id(__u64 d_info1, __u64 kernel_version, - __u64 d_info2) +static inline u64 hv_generate_guest_id(u64 kernel_version) { - __u64 guest_id = 0; + u64 guest_id; - guest_id = (((__u64)HV_LINUX_VENDOR_ID) << 48); - guest_id |= (d_info1 << 48); + guest_id = (((u64)HV_LINUX_VENDOR_ID) << 48); guest_id |= (kernel_version << 16); - guest_id |= d_info2; return guest_id; } |