mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-22 01:07:57 +00:00
HV:fix "Pointer param should be declared pointer to const"
Fix violations for function whose parameter can be read-only. Tracked-On: #861 Signed-off-by: Huihuang Shi <huihuang.shi@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -187,7 +187,7 @@ static void *allocate_mem(struct mem_pool *pool, unsigned int num_bytes)
|
||||
return (void *)NULL;
|
||||
}
|
||||
|
||||
static void deallocate_mem(struct mem_pool *pool, void *ptr)
|
||||
static void deallocate_mem(struct mem_pool *pool, const void *ptr)
|
||||
{
|
||||
uint32_t *bitmask, *contiguity_bitmask;
|
||||
uint32_t bmp_idx, bit_idx, buff_idx;
|
||||
@@ -297,7 +297,7 @@ void *calloc(unsigned int num_elements, unsigned int element_size)
|
||||
return memory;
|
||||
}
|
||||
|
||||
void free(void *ptr)
|
||||
void free(const void *ptr)
|
||||
{
|
||||
/* Check if ptr belongs to 16-Bytes aligned Memory Pool */
|
||||
if ((Memory_Pool.start_addr < ptr) &&
|
||||
|
@@ -382,7 +382,7 @@ static void print_decimal(struct print_param *param, int64_t value)
|
||||
|
||||
}
|
||||
|
||||
static void print_string(struct print_param *param, const char *s)
|
||||
static void print_string(const struct print_param *param, const char *s)
|
||||
{
|
||||
/* the length of the string (-1) if unknown */
|
||||
uint32_t len;
|
||||
|
Reference in New Issue
Block a user