Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e250fab6 authored by YueHaibing's avatar YueHaibing Committed by Marcel Holtmann
Browse files

Bluetooth: 6lowpan: Fix debugfs_simple_attr.cocci warnings



Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE
for debugfs files.

Semantic patch information:
Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file()
imposes some significant overhead as compared to
DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe().

Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 5c0a1001
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -1108,7 +1108,7 @@ static int lowpan_enable_get(void *data, u64 *val)
	return 0;
}

DEFINE_SIMPLE_ATTRIBUTE(lowpan_enable_fops, lowpan_enable_get,
DEFINE_DEBUGFS_ATTRIBUTE(lowpan_enable_fops, lowpan_enable_get,
			 lowpan_enable_set, "%llu\n");

static ssize_t lowpan_control_write(struct file *fp,
@@ -1278,8 +1278,9 @@ static struct notifier_block bt_6lowpan_dev_notifier = {

static int __init bt_6lowpan_init(void)
{
	lowpan_enable_debugfs = debugfs_create_file("6lowpan_enable", 0644,
						    bt_debugfs, NULL,
	lowpan_enable_debugfs = debugfs_create_file_unsafe("6lowpan_enable",
							   0644, bt_debugfs,
							   NULL,
							   &lowpan_enable_fops);
	lowpan_control_debugfs = debugfs_create_file("6lowpan_control", 0644,
						     bt_debugfs, NULL,