为什么free_reserved_area()采用char *而不是const char *?

时间:2017-04-20 08:51:02

标签: c linux kernel compiler-warnings

unsigned long free_reserved_area(void *start, void *end, int poison, char *s)

第四个参数在我正在处理的代码中引起大量警告:

warning: passing argument 4 of ‘free_reserved_area’
  discards ‘const’ qualifier from pointer target type
  [enabled by default]

free_reserved_area()在此处声明: https://github.com/torvalds/linux/blob/master/include/linux/mm.h#L1861

我在其实施中看到char* s仅与pr_info()一起阅读: https://github.com/torvalds/linux/blob/master/mm/page_alloc.c#L6625

您知道为什么free_reserved_area()char *而不是const char *作为第四个参数?

0 个答案:

没有答案