Commit b4601d0
mm/slab: fix 'variable obj_exts set but not used' warning
slab_post_alloc_hook() uses prepare_slab_obj_exts_hook() to obtain
slabobj_ext object. Currently the only user of slabobj_ext object in this
path is memory allocation profiling, therefore when it's not enabled this
object is not needed. This also generates a warning when compiling with
CONFIG_MEM_ALLOC_PROFILING=n. Move the code under this configuration to
fix the warning. If more slabobj_ext users appear in the future, the code
will have to be changed back to call prepare_slab_obj_exts_hook().
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 4b87369 ("mm/slab: add allocation accounting into slab allocation and free paths")
Signed-off-by: Suren Baghdasaryan <[email protected]>
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Cc: Kent Overstreet <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>1 parent 399ab86 commit b4601d0
1 file changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3902 | 3902 | | |
3903 | 3903 | | |
3904 | 3904 | | |
3905 | | - | |
3906 | 3905 | | |
3907 | 3906 | | |
3908 | 3907 | | |
| |||
3945 | 3944 | | |
3946 | 3945 | | |
3947 | 3946 | | |
| 3947 | + | |
3948 | 3948 | | |
| 3949 | + | |
| 3950 | + | |
3949 | 3951 | | |
3950 | | - | |
3951 | 3952 | | |
3952 | 3953 | | |
3953 | 3954 | | |
3954 | 3955 | | |
3955 | 3956 | | |
3956 | 3957 | | |
3957 | 3958 | | |
3958 | | - | |
3959 | 3959 | | |
| 3960 | + | |
3960 | 3961 | | |
3961 | 3962 | | |
3962 | 3963 | | |
| |||
0 commit comments