mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
sh: mm: Convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com> Signed-off-by: Rich Felker <dalias@libc.org>
This commit is contained in:
committed by
Rich Felker
parent
5c5dc5f8dc
commit
a1153636e9
@@ -26,7 +26,7 @@
|
|||||||
#include <asm/processor.h>
|
#include <asm/processor.h>
|
||||||
#include <asm/mmu_context.h>
|
#include <asm/mmu_context.h>
|
||||||
|
|
||||||
static int asids_seq_show(struct seq_file *file, void *iter)
|
static int asids_debugfs_show(struct seq_file *file, void *iter)
|
||||||
{
|
{
|
||||||
struct task_struct *p;
|
struct task_struct *p;
|
||||||
|
|
||||||
@@ -48,18 +48,7 @@ static int asids_seq_show(struct seq_file *file, void *iter)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int asids_debugfs_open(struct inode *inode, struct file *file)
|
DEFINE_SHOW_ATTRIBUTE(asids_debugfs);
|
||||||
{
|
|
||||||
return single_open(file, asids_seq_show, inode->i_private);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct file_operations asids_debugfs_fops = {
|
|
||||||
.owner = THIS_MODULE,
|
|
||||||
.open = asids_debugfs_open,
|
|
||||||
.read = seq_read,
|
|
||||||
.llseek = seq_lseek,
|
|
||||||
.release = single_release,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int __init asids_debugfs_init(void)
|
static int __init asids_debugfs_init(void)
|
||||||
{
|
{
|
||||||
|
@@ -22,7 +22,7 @@ enum cache_type {
|
|||||||
CACHE_TYPE_UNIFIED,
|
CACHE_TYPE_UNIFIED,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int cache_seq_show(struct seq_file *file, void *iter)
|
static int cache_debugfs_show(struct seq_file *file, void *iter)
|
||||||
{
|
{
|
||||||
unsigned int cache_type = (unsigned int)file->private;
|
unsigned int cache_type = (unsigned int)file->private;
|
||||||
struct cache_info *cache;
|
struct cache_info *cache;
|
||||||
@@ -94,18 +94,7 @@ static int cache_seq_show(struct seq_file *file, void *iter)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cache_debugfs_open(struct inode *inode, struct file *file)
|
DEFINE_SHOW_ATTRIBUTE(cache_debugfs);
|
||||||
{
|
|
||||||
return single_open(file, cache_seq_show, inode->i_private);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct file_operations cache_debugfs_fops = {
|
|
||||||
.owner = THIS_MODULE,
|
|
||||||
.open = cache_debugfs_open,
|
|
||||||
.read = seq_read,
|
|
||||||
.llseek = seq_lseek,
|
|
||||||
.release = single_release,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int __init cache_debugfs_init(void)
|
static int __init cache_debugfs_init(void)
|
||||||
{
|
{
|
||||||
|
@@ -812,7 +812,7 @@ bool __in_29bit_mode(void)
|
|||||||
return (__raw_readl(PMB_PASCR) & PASCR_SE) == 0;
|
return (__raw_readl(PMB_PASCR) & PASCR_SE) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pmb_seq_show(struct seq_file *file, void *iter)
|
static int pmb_debugfs_show(struct seq_file *file, void *iter)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -846,18 +846,7 @@ static int pmb_seq_show(struct seq_file *file, void *iter)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pmb_debugfs_open(struct inode *inode, struct file *file)
|
DEFINE_SHOW_ATTRIBUTE(pmb_debugfs);
|
||||||
{
|
|
||||||
return single_open(file, pmb_seq_show, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct file_operations pmb_debugfs_fops = {
|
|
||||||
.owner = THIS_MODULE,
|
|
||||||
.open = pmb_debugfs_open,
|
|
||||||
.read = seq_read,
|
|
||||||
.llseek = seq_lseek,
|
|
||||||
.release = single_release,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int __init pmb_debugfs_init(void)
|
static int __init pmb_debugfs_init(void)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user