History

random: move randomize_page() into mm where it belongs

randomize_page is an mm function. It is documented like one. It contains the history of one. It has the naming convention of one. It looks just like another very similar function in mm, randomize_stack_top(). And it has always been maintained and updated by mm people. There is no need for it to be in random.c. In the "which shape does not look like the other ones" test, pointing to randomize_page() is correct. So move randomize_page() into mm/util.c, right next to the similar randomize_stack_top() function. This commit contains no actual code changes.

Jason A. Donenfeld committed 4 years ago

Commit 5ad7dd81 parent 6701de64 files · +33 −34Browse files

Showing the changes to include (2 of 4 files). Show all

Unified · Split

2 files
  1. include/linux/mm.h +1 −0
  2. include/linux/random.h +0 −2
include/linux/mm.h+1−0
@@ -2677,6 +2677,7 @@ extern int install_special_mapping(struct mm_struct *mm, · 2676 unmodified lines
26772677 unsigned long flags, struct page **pages);
26782678
26792679 unsigned long randomize_stack_top(unsigned long stack_top);
2680+unsigned long randomize_page(unsigned long start, unsigned long range);
26802681
26812682 extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
26822683
include/linux/random.h+0−2
@@ -72,8 +72,6 @@ static inline unsigned long get_random_canary(void) · 71 unmodified lines
7272 return get_random_long() & CANARY_MASK;
7373 }
7474
75−unsigned long randomize_page(unsigned long start, unsigned long range);
76−
7775 int __init random_init(const char *command_line);
7876 bool rng_is_initialized(void);
7977 bool rng_has_arch_random(void);