[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1572525728-23957-1-git-send-email-zhongjiang@huawei.com>
Date: Thu, 31 Oct 2019 20:42:08 +0800
From: zhong jiang <zhongjiang@...wei.com>
To: <gregkh@...uxfoundation.org>, <akinobu.mita@...il.com>
CC: <tglx@...utronix.de>, <zhongjiang@...wei.com>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH] notifier-error-inject: use DEFINE_DEBUGFS_ATTRIBUTE to define debugfs fops
It is more clearly to use DEFINE_DEBUGFS_ATTRIBUTE to define debugfs file
operation rather than DEFINE_SIMPLE_ATTRIBUTE.
Meanwhile, debugfs_create_file() in debugfs_create_errno() can be replaced
by debugfs_create_file_unsafe().
Signed-off-by: zhong jiang <zhongjiang@...wei.com>
---
lib/notifier-error-inject.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/notifier-error-inject.c b/lib/notifier-error-inject.c
index 21016b3..e5302f7 100644
--- a/lib/notifier-error-inject.c
+++ b/lib/notifier-error-inject.c
@@ -15,13 +15,13 @@ static int debugfs_errno_get(void *data, u64 *val)
return 0;
}
-DEFINE_SIMPLE_ATTRIBUTE(fops_errno, debugfs_errno_get, debugfs_errno_set,
+DEFINE_DEBUGFS_ATTRIBUTE(fops_errno, debugfs_errno_get, debugfs_errno_set,
"%lld\n");
static struct dentry *debugfs_create_errno(const char *name, umode_t mode,
struct dentry *parent, int *value)
{
- return debugfs_create_file(name, mode, parent, value, &fops_errno);
+ return debugfs_create_file_unsafe(name, mode, parent, value, &fops_errno);
}
static int notifier_err_inject_callback(struct notifier_block *nb,
--
1.7.12.4
Powered by blists - more mailing lists