From: wenglianfa wenglianfa@huawei.com
driver inclusion category: cleanup bugzilla: https://gitee.com/openeuler/kernel/issues/I8LY0D
--------------------------------------------------------------------------
The structure member of hns_debugfs_seqfile records the handle of the debugfs file After the debugfs file is created, a value is assigned to the handle. It is originally used to destroy the created debugfs subdirectory when the debugfs file system is uninstalled. Because debugfs_remove_recursive() has been introduced in previous reconstruction, this function only needs to know the root directory of the debugfs file system and can automatically destroy subdirectories recursively. The function of the structure member entry of hns_debugfs_seqfile has been replaced. The deletion is performed here.
Fixes: b6643496e2b4 ("RDMA/hns: Refactor hns RoCE debugfs") Signed-off-by: wenglianfa wenglianfa@huawei.com --- drivers/infiniband/hw/hns/hns_roce_debugfs.c | 11 ++++------- drivers/infiniband/hw/hns/hns_roce_debugfs.h | 1 - 2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_debugfs.c b/drivers/infiniband/hw/hns/hns_roce_debugfs.c index 86894432c4dc..d42bea711507 100644 --- a/drivers/infiniband/hw/hns/hns_roce_debugfs.c +++ b/drivers/infiniband/hw/hns/hns_roce_debugfs.c @@ -137,14 +137,11 @@ static void init_debugfs_seqfile(struct hns_debugfs_seqfile *seq, int (*read_fn)(struct seq_file *, void *), void *data) { - struct dentry *entry; - - entry = debugfs_create_file(name, 0400, parent, seq, - &hns_debugfs_seqfile_fops); + debugfs_create_file(name, 0400, parent, seq, + &hns_debugfs_seqfile_fops);
seq->read = read_fn; seq->data = data; - seq->entry = entry; }
struct dca_mem_stats { @@ -666,8 +663,8 @@ static void create_srq_debugfs(struct hns_roce_dev *hr_dev,
dbgfs->root = debugfs_create_dir("srq", parent);
- dbgfs->srqn.entry = debugfs_create_file("srqn", 0600, dbgfs->root, - hr_dev, &hns_srqn_fops); + debugfs_create_file("srqn", 0600, dbgfs->root, + hr_dev, &hns_srqn_fops);
init_debugfs_seqfile(&dbgfs->srqc, "srqc", dbgfs->root, srqc_debugfs_show, hr_dev); diff --git a/drivers/infiniband/hw/hns/hns_roce_debugfs.h b/drivers/infiniband/hw/hns/hns_roce_debugfs.h index be952fed25df..509260edcb19 100644 --- a/drivers/infiniband/hw/hns/hns_roce_debugfs.h +++ b/drivers/infiniband/hw/hns/hns_roce_debugfs.h @@ -6,7 +6,6 @@
/* debugfs seqfile */ struct hns_debugfs_seqfile { - struct dentry *entry; int (*read)(struct seq_file *seq, void *data); void *data; };