diff options
author | Ganesh Mahendran <opensource.ganesh@gmail.com> | 2014-12-18 16:17:40 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-18 19:08:11 -0800 |
commit | 66cdef663cd7a97aff6bbbf41a81a0205dc81ba2 (patch) | |
tree | f41ba2279a16cd072461e4e91cdac878a3cfd5ad /mm/mempolicy.c | |
parent | 136f49b9171074872f2a14ad0ab10486d1ba13ca (diff) | |
download | op-kernel-dev-66cdef663cd7a97aff6bbbf41a81a0205dc81ba2.zip op-kernel-dev-66cdef663cd7a97aff6bbbf41a81a0205dc81ba2.tar.gz |
mm/zsmalloc: adjust order of functions
Currently functions in zsmalloc.c does not arranged in a readable and
reasonable sequence. With the more and more functions added, we may
meet below inconvenience. For example:
Current functions:
void zs_init()
{
}
static void get_maxobj_per_zspage()
{
}
Then I want to add a func_1() which is called from zs_init(), and this
new added function func_1() will used get_maxobj_per_zspage() which is
defined below zs_init().
void func_1()
{
get_maxobj_per_zspage()
}
void zs_init()
{
func_1()
}
static void get_maxobj_per_zspage()
{
}
This will cause compiling issue. So we must add a declaration:
static void get_maxobj_per_zspage();
before func_1() if we do not put get_maxobj_per_zspage() before
func_1().
In addition, puting module_[init|exit] functions at the bottom of the
file conforms to our habit.
So, this patch ajusts function sequence as:
/* helper functions */
...
obj_location_to_handle()
...
/* Some exported functions */
...
zs_map_object()
zs_unmap_object()
zs_malloc()
zs_free()
zs_init()
zs_exit()
Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mempolicy.c')
0 files changed, 0 insertions, 0 deletions