Commit bfa2325e authored by YueHaibing's avatar YueHaibing Committed by Michael Ellerman

powerpc/powernv/npu: 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 avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1545705876-63132-1-git-send-email-yuehaibing@huawei.com
parent 090d5ab9
...@@ -3086,8 +3086,8 @@ static int pnv_pci_diag_data_set(void *data, u64 val) ...@@ -3086,8 +3086,8 @@ static int pnv_pci_diag_data_set(void *data, u64 val)
return 0; return 0;
} }
DEFINE_SIMPLE_ATTRIBUTE(pnv_pci_diag_data_fops, NULL, DEFINE_DEBUGFS_ATTRIBUTE(pnv_pci_diag_data_fops, NULL, pnv_pci_diag_data_set,
pnv_pci_diag_data_set, "%llu\n"); "%llu\n");
#endif /* CONFIG_DEBUG_FS */ #endif /* CONFIG_DEBUG_FS */
...@@ -3112,8 +3112,8 @@ static void pnv_pci_ioda_create_dbgfs(void) ...@@ -3112,8 +3112,8 @@ static void pnv_pci_ioda_create_dbgfs(void)
continue; continue;
} }
debugfs_create_file("dump_diag_regs", 0200, phb->dbgfs, hose, debugfs_create_file_unsafe("dump_diag_regs", 0200, phb->dbgfs,
&pnv_pci_diag_data_fops); hose, &pnv_pci_diag_data_fops);
} }
#endif /* CONFIG_DEBUG_FS */ #endif /* CONFIG_DEBUG_FS */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment