summaryrefslogtreecommitdiffstats
path: root/mm/damon/dbgfs.c
diff options
context:
space:
mode:
authorKenneth Lee <klee33@uw.edu>2022-08-09 00:00:19 +0200
committerAndrew Morton <akpm@linux-foundation.org>2022-09-12 05:25:48 +0200
commitb2d4c646d5a15c1854e09898a374983167e53e0e (patch)
tree73b0d3afa4a35a15a237c023a55ec04b01541c54 /mm/damon/dbgfs.c
parentmm/filemap.c: convert page_endio() to use a folio (diff)
downloadlinux-b2d4c646d5a15c1854e09898a374983167e53e0e.tar.xz
linux-b2d4c646d5a15c1854e09898a374983167e53e0e.zip
mm/damon/dbgfs: use kmalloc for allocating only one element
Use kmalloc(...) rather than kmalloc_array(1, ...) because the number of elements we are specifying in this case is 1, kmalloc would accomplish the same thing and we can simplify. Link: https://lkml.kernel.org/r/20220808220019.1680469-1-klee33@uw.edu Signed-off-by: Kenneth Lee <klee33@uw.edu> Reviewed-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/damon/dbgfs.c')
-rw-r--r--mm/damon/dbgfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c
index cfdf63132d5a..3b55a1b219b5 100644
--- a/mm/damon/dbgfs.c
+++ b/mm/damon/dbgfs.c
@@ -1044,7 +1044,7 @@ static int __init __damon_dbgfs_init(void)
fops[i]);
dbgfs_fill_ctx_dir(dbgfs_root, dbgfs_ctxs[0]);
- dbgfs_dirs = kmalloc_array(1, sizeof(dbgfs_root), GFP_KERNEL);
+ dbgfs_dirs = kmalloc(sizeof(dbgfs_root), GFP_KERNEL);
if (!dbgfs_dirs) {
debugfs_remove(dbgfs_root);
return -ENOMEM;