mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-11 01:00:57 +00:00
RDMA/ipoib: Convert to use DEFINE_SEQ_ATTRIBUTE macro
Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code. Link: https://lore.kernel.org/r/20200916025022.3992627-1-liushixin2@huawei.com Signed-off-by: Liu Shixin <liushixin2@huawei.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
parent
1d7c995820
commit
3cc30e8dfc
1 changed files with 4 additions and 46 deletions
|
@ -124,35 +124,14 @@ static int ipoib_mcg_seq_show(struct seq_file *file, void *iter_ptr)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct seq_operations ipoib_mcg_seq_ops = {
|
static const struct seq_operations ipoib_mcg_sops = {
|
||||||
.start = ipoib_mcg_seq_start,
|
.start = ipoib_mcg_seq_start,
|
||||||
.next = ipoib_mcg_seq_next,
|
.next = ipoib_mcg_seq_next,
|
||||||
.stop = ipoib_mcg_seq_stop,
|
.stop = ipoib_mcg_seq_stop,
|
||||||
.show = ipoib_mcg_seq_show,
|
.show = ipoib_mcg_seq_show,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int ipoib_mcg_open(struct inode *inode, struct file *file)
|
DEFINE_SEQ_ATTRIBUTE(ipoib_mcg);
|
||||||
{
|
|
||||||
struct seq_file *seq;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = seq_open(file, &ipoib_mcg_seq_ops);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
seq = file->private_data;
|
|
||||||
seq->private = inode->i_private;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct file_operations ipoib_mcg_fops = {
|
|
||||||
.owner = THIS_MODULE,
|
|
||||||
.open = ipoib_mcg_open,
|
|
||||||
.read = seq_read,
|
|
||||||
.llseek = seq_lseek,
|
|
||||||
.release = seq_release
|
|
||||||
};
|
|
||||||
|
|
||||||
static void *ipoib_path_seq_start(struct seq_file *file, loff_t *pos)
|
static void *ipoib_path_seq_start(struct seq_file *file, loff_t *pos)
|
||||||
{
|
{
|
||||||
|
@ -229,35 +208,14 @@ static int ipoib_path_seq_show(struct seq_file *file, void *iter_ptr)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct seq_operations ipoib_path_seq_ops = {
|
static const struct seq_operations ipoib_path_sops = {
|
||||||
.start = ipoib_path_seq_start,
|
.start = ipoib_path_seq_start,
|
||||||
.next = ipoib_path_seq_next,
|
.next = ipoib_path_seq_next,
|
||||||
.stop = ipoib_path_seq_stop,
|
.stop = ipoib_path_seq_stop,
|
||||||
.show = ipoib_path_seq_show,
|
.show = ipoib_path_seq_show,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int ipoib_path_open(struct inode *inode, struct file *file)
|
DEFINE_SEQ_ATTRIBUTE(ipoib_path);
|
||||||
{
|
|
||||||
struct seq_file *seq;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = seq_open(file, &ipoib_path_seq_ops);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
seq = file->private_data;
|
|
||||||
seq->private = inode->i_private;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct file_operations ipoib_path_fops = {
|
|
||||||
.owner = THIS_MODULE,
|
|
||||||
.open = ipoib_path_open,
|
|
||||||
.read = seq_read,
|
|
||||||
.llseek = seq_lseek,
|
|
||||||
.release = seq_release
|
|
||||||
};
|
|
||||||
|
|
||||||
void ipoib_create_debug_files(struct net_device *dev)
|
void ipoib_create_debug_files(struct net_device *dev)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue