Skip to content

Commit cd1769e

Browse files
longlimsftliuw
authored andcommitted
Drivers: hv: Remove hv_alloc/free_* helpers
There are no users for those functions, remove them. Signed-off-by: Long Li <longli@microsoft.com> Reviewed-by: Michael Kelley <mhklinux@outlook.com> Link: https://lore.kernel.org/r/1746492997-4599-6-git-send-email-longli@linuxonhyperv.com Signed-off-by: Wei Liu <wei.liu@kernel.org> Message-ID: <1746492997-4599-6-git-send-email-longli@linuxonhyperv.com>
1 parent a60822b commit cd1769e

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

drivers/hv/hv_common.c

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -105,45 +105,6 @@ void __init hv_common_free(void)
105105
hv_synic_eventring_tail = NULL;
106106
}
107107

108-
/*
109-
* Functions for allocating and freeing memory with size and
110-
* alignment HV_HYP_PAGE_SIZE. These functions are needed because
111-
* the guest page size may not be the same as the Hyper-V page
112-
* size. We depend upon kmalloc() aligning power-of-two size
113-
* allocations to the allocation size boundary, so that the
114-
* allocated memory appears to Hyper-V as a page of the size
115-
* it expects.
116-
*/
117-
118-
void *hv_alloc_hyperv_page(void)
119-
{
120-
BUILD_BUG_ON(PAGE_SIZE < HV_HYP_PAGE_SIZE);
121-
122-
if (PAGE_SIZE == HV_HYP_PAGE_SIZE)
123-
return (void *)__get_free_page(GFP_KERNEL);
124-
else
125-
return kmalloc(HV_HYP_PAGE_SIZE, GFP_KERNEL);
126-
}
127-
EXPORT_SYMBOL_GPL(hv_alloc_hyperv_page);
128-
129-
void *hv_alloc_hyperv_zeroed_page(void)
130-
{
131-
if (PAGE_SIZE == HV_HYP_PAGE_SIZE)
132-
return (void *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
133-
else
134-
return kzalloc(HV_HYP_PAGE_SIZE, GFP_KERNEL);
135-
}
136-
EXPORT_SYMBOL_GPL(hv_alloc_hyperv_zeroed_page);
137-
138-
void hv_free_hyperv_page(void *addr)
139-
{
140-
if (PAGE_SIZE == HV_HYP_PAGE_SIZE)
141-
free_page((unsigned long)addr);
142-
else
143-
kfree(addr);
144-
}
145-
EXPORT_SYMBOL_GPL(hv_free_hyperv_page);
146-
147108
static void *hv_panic_page;
148109

149110
/*

include/asm-generic/mshyperv.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,6 @@ int hv_common_cpu_init(unsigned int cpu);
236236
int hv_common_cpu_die(unsigned int cpu);
237237
void hv_identify_partition_type(void);
238238

239-
void *hv_alloc_hyperv_page(void);
240-
void *hv_alloc_hyperv_zeroed_page(void);
241-
void hv_free_hyperv_page(void *addr);
242-
243239
/**
244240
* hv_cpu_number_to_vp_number() - Map CPU to VP.
245241
* @cpu_number: CPU number in Linux terms

0 commit comments

Comments
 (0)