提交 84239b44 编写于 作者: Y YueHaibing 提交者: David S. Miller

ptp: 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: NYueHaibing <yuehaibing@huawei.com>
Acked-by: NYangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f515220c
...@@ -33,7 +33,7 @@ static int ptp_qoriq_fiper1_lpbk_set(void *data, u64 val) ...@@ -33,7 +33,7 @@ static int ptp_qoriq_fiper1_lpbk_set(void *data, u64 val)
return 0; return 0;
} }
DEFINE_SIMPLE_ATTRIBUTE(ptp_qoriq_fiper1_fops, ptp_qoriq_fiper1_lpbk_get, DEFINE_DEBUGFS_ATTRIBUTE(ptp_qoriq_fiper1_fops, ptp_qoriq_fiper1_lpbk_get,
ptp_qoriq_fiper1_lpbk_set, "%llu\n"); ptp_qoriq_fiper1_lpbk_set, "%llu\n");
static int ptp_qoriq_fiper2_lpbk_get(void *data, u64 *val) static int ptp_qoriq_fiper2_lpbk_get(void *data, u64 *val)
...@@ -64,7 +64,7 @@ static int ptp_qoriq_fiper2_lpbk_set(void *data, u64 val) ...@@ -64,7 +64,7 @@ static int ptp_qoriq_fiper2_lpbk_set(void *data, u64 val)
return 0; return 0;
} }
DEFINE_SIMPLE_ATTRIBUTE(ptp_qoriq_fiper2_fops, ptp_qoriq_fiper2_lpbk_get, DEFINE_DEBUGFS_ATTRIBUTE(ptp_qoriq_fiper2_fops, ptp_qoriq_fiper2_lpbk_get,
ptp_qoriq_fiper2_lpbk_set, "%llu\n"); ptp_qoriq_fiper2_lpbk_set, "%llu\n");
void ptp_qoriq_create_debugfs(struct qoriq_ptp *qoriq_ptp) void ptp_qoriq_create_debugfs(struct qoriq_ptp *qoriq_ptp)
...@@ -79,11 +79,11 @@ void ptp_qoriq_create_debugfs(struct qoriq_ptp *qoriq_ptp) ...@@ -79,11 +79,11 @@ void ptp_qoriq_create_debugfs(struct qoriq_ptp *qoriq_ptp)
qoriq_ptp->debugfs_root = root; qoriq_ptp->debugfs_root = root;
if (!debugfs_create_file("fiper1-loopback", 0600, root, qoriq_ptp, if (!debugfs_create_file_unsafe("fiper1-loopback", 0600, root,
&ptp_qoriq_fiper1_fops)) qoriq_ptp, &ptp_qoriq_fiper1_fops))
goto err_node; goto err_node;
if (!debugfs_create_file("fiper2-loopback", 0600, root, qoriq_ptp, if (!debugfs_create_file_unsafe("fiper2-loopback", 0600, root,
&ptp_qoriq_fiper2_fops)) qoriq_ptp, &ptp_qoriq_fiper2_fops))
goto err_node; goto err_node;
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册