notifier-error-inject: use DEFINE_DEBUGFS_ATTRIBUTE to define debugfs fops
PATCH 1/1 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 <[email protected]>
--- lib/notifier-error-inject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/notifier-error-inject.c +2 -2
@@ -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,
Signature · 1 line
1.7.12.4