Skip to content

Commit a9ea242

Browse files
xiongzhongjiangtorvalds
authored andcommitted
mm/cma_debug.c: use DEFINE_DEBUGFS_ATTRIBUTE to define debugfs fops
It is more clear to use DEFINE_DEBUGFS_ATTRIBUTE to define debugfs file operation rather than DEFINE_SIMPLE_ATTRIBUTE. Link: http://lkml.kernel.org/r/1572348687-9951-1-git-send-email-zhongjiang@huawei.com Signed-off-by: zhong jiang <zhongjiang@huawei.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Yue Hu <huyue2@yulong.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 2184f99 commit a9ea242

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎mm/cma_debug.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static int cma_debugfs_get(void *data, u64 *val)
2929

3030
return 0;
3131
}
32-
DEFINE_SIMPLE_ATTRIBUTE(cma_debugfs_fops, cma_debugfs_get, NULL, "%llu\n");
32+
DEFINE_DEBUGFS_ATTRIBUTE(cma_debugfs_fops, cma_debugfs_get, NULL, "%llu\n");
3333

3434
static int cma_used_get(void *data, u64 *val)
3535
{
@@ -44,7 +44,7 @@ static int cma_used_get(void *data, u64 *val)
4444

4545
return 0;
4646
}
47-
DEFINE_SIMPLE_ATTRIBUTE(cma_used_fops, cma_used_get, NULL, "%llu\n");
47+
DEFINE_DEBUGFS_ATTRIBUTE(cma_used_fops, cma_used_get, NULL, "%llu\n");
4848

4949
static int cma_maxchunk_get(void *data, u64 *val)
5050
{
@@ -66,7 +66,7 @@ static int cma_maxchunk_get(void *data, u64 *val)
6666

6767
return 0;
6868
}
69-
DEFINE_SIMPLE_ATTRIBUTE(cma_maxchunk_fops, cma_maxchunk_get, NULL, "%llu\n");
69+
DEFINE_DEBUGFS_ATTRIBUTE(cma_maxchunk_fops, cma_maxchunk_get, NULL, "%llu\n");
7070

7171
static void cma_add_to_cma_mem_list(struct cma *cma, struct cma_mem *mem)
7272
{
@@ -126,7 +126,7 @@ static int cma_free_write(void *data, u64 val)
126126

127127
return cma_free_mem(cma, pages);
128128
}
129-
DEFINE_SIMPLE_ATTRIBUTE(cma_free_fops, NULL, cma_free_write, "%llu\n");
129+
DEFINE_DEBUGFS_ATTRIBUTE(cma_free_fops, NULL, cma_free_write, "%llu\n");
130130

131131
static int cma_alloc_mem(struct cma *cma, int count)
132132
{
@@ -158,7 +158,7 @@ static int cma_alloc_write(void *data, u64 val)
158158

159159
return cma_alloc_mem(cma, pages);
160160
}
161-
DEFINE_SIMPLE_ATTRIBUTE(cma_alloc_fops, NULL, cma_alloc_write, "%llu\n");
161+
DEFINE_DEBUGFS_ATTRIBUTE(cma_alloc_fops, NULL, cma_alloc_write, "%llu\n");
162162

163163
static void cma_debugfs_add_one(struct cma *cma, struct dentry *root_dentry)
164164
{

0 commit comments

Comments
 (0)