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:
Huihuang Shi
2018-10-23 11:45:29 +08:00
committed by wenlingz
parent d79007ae70
commit ea32c34ae1
39 changed files with 149 additions and 149 deletions

View File

@@ -62,7 +62,7 @@ static inline void list_del_node(struct list_head *prev, struct list_head *next)
prev->next = next;
}
static inline void list_del(struct list_head *entry)
static inline void list_del(const struct list_head *entry)
{
list_del_node(entry->prev, entry->next);
}
@@ -73,12 +73,12 @@ static inline void list_del_init(struct list_head *entry)
INIT_LIST_HEAD(entry);
}
static inline _Bool list_empty(struct list_head *head)
static inline _Bool list_empty(const struct list_head *head)
{
return head->next == head;
}
static inline void list_splice_node(struct list_head *list,
static inline void list_splice_node(const struct list_head *list,
struct list_head *head)
{
struct list_head *first = list->next;
@@ -92,7 +92,7 @@ static inline void list_splice_node(struct list_head *list,
at->prev = last;
}
static inline void list_splice(struct list_head *list, struct list_head *head)
static inline void list_splice(const struct list_head *list, struct list_head *head)
{
if (!list_empty(list)) {
list_splice_node(list, head);

View File

@@ -26,6 +26,6 @@ void *malloc(unsigned int num_bytes);
void *calloc(unsigned int num_elements, unsigned int element_size);
void *alloc_page(void);
void *alloc_pages(unsigned int page_num);
void free(void *ptr);
void free(const void *ptr);
#endif /* MEM_MGT_H */