[PATCH linux-next] powerpc/cell/axon_msi: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE

From
<hidden>
Date
2022-11-23 09:07:29
Also in
lkml
From: zhang songyi <redacted>

Fix the following coccicheck warning:
/arch/powerpc/platforms/cell/axon_msi.c:457:0-23: WARNING:
fops_msic should be defined with DEFINE_DEBUGFS_ATTRIBUTE

Signed-off-by: zhang songyi <redacted>
---
 arch/powerpc/platforms/cell/axon_msi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c
index 5b012abca773..ab080b5022ff 100644
--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -454,7 +454,7 @@ static int msic_get(void *data, u64 *val)
        return 0;
 }

-DEFINE_SIMPLE_ATTRIBUTE(fops_msic, msic_get, msic_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(fops_msic, msic_get, msic_set, "%llu\n");

 void axon_msi_debug_setup(struct device_node *dn, struct axon_msic *msic)
 {
@@ -475,6 +475,7 @@ void axon_msi_debug_setup(struct device_node *dn, struct axon_msic *msic)

        snprintf(name, sizeof(name), "msic_%d", of_node_to_nid(dn));

-       debugfs_create_file(name, 0600, arch_debugfs_dir, msic, &fops_msic);
+       debugfs_create_file_unsafe(name, 0600, arch_debugfs_dir,
+                                  msic, &fops_msic);
 }
 #endif /* DEBUG */
--
2.15.2
Thread (3 messages) 3 messages, 3 authors, last reply 2022-11-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help