LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] mhi_bus: controller: fix debugfs_simple_attr.cocci warnings
@ 2018-04-28  7:15 Julia Lawall
  0 siblings, 0 replies; only message in thread
From: Julia Lawall @ 2018-04-28  7:15 UTC (permalink / raw)
  To: Sujeev Dias
  Cc: Greg Kroah-Hartman, Arnd Bergmann, linux-kernel, linux-arm-msm,
	Tony Truong, kbuild-all

From: Fengguang Wu <fengguang.wu@intel.com>

 Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE
 for debugfs files.

 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

Fixes: 6190c08efd64 ("mhi_bus: controller: MHI support for QCOM modems")
CC: Sujeev Dias <sdias@codeaurora.org>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---

url:
https://github.com/0day-ci/linux/commits/Sujeev-Dias/mhi_bus-core-Add-support-for-MHI-host-interface/20180428-065959
:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago

 mhi_qcom.c |   26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

--- a/drivers/bus/mhi/controllers/mhi_qcom.c
+++ b/drivers/bus/mhi/controllers/mhi_qcom.c
@@ -335,11 +335,11 @@ int mhi_debugfs_trigger_m3(void *data, u
 	return 0;
 }

-DEFINE_SIMPLE_ATTRIBUTE(debugfs_trigger_m0_fops, NULL,
-			mhi_debugfs_trigger_m0, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(debugfs_trigger_m0_fops, NULL,
+			 mhi_debugfs_trigger_m0, "%llu\n");

-DEFINE_SIMPLE_ATTRIBUTE(debugfs_trigger_m3_fops, NULL,
-			mhi_debugfs_trigger_m3, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(debugfs_trigger_m3_fops, NULL,
+			 mhi_debugfs_trigger_m3, "%llu\n");

 static int mhi_init_debugfs_trigger_go(void *data, u64 val)
 {
@@ -351,8 +351,8 @@ static int mhi_init_debugfs_trigger_go(v

 	return 0;
 }
-DEFINE_SIMPLE_ATTRIBUTE(mhi_init_debugfs_trigger_go_fops, NULL,
-			mhi_init_debugfs_trigger_go, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(mhi_init_debugfs_trigger_go_fops, NULL,
+			 mhi_init_debugfs_trigger_go, "%llu\n");


 int mhi_init_debugfs_debug_show(struct seq_file *m, void *d)
@@ -434,8 +434,8 @@ static ssize_t mhi_init_debugfs_debug_wr
 	}

 	mhi_dev->debug_mode = true;
-	debugfs_create_file("go", 0444, mhi_cntrl->parent, mhi_cntrl,
-			    &mhi_init_debugfs_trigger_go_fops);
+	debugfs_create_file_unsafe("go", 0444, mhi_cntrl->parent, mhi_cntrl,
+				   &mhi_init_debugfs_trigger_go_fops);
 	pr_info(
 		"%s: ret:%d pcidev:0x%x smm_cfg:%u timeout:%u\n",
 		__func__, ret, args[1], mhi_dev->smmu_cfg,
@@ -504,10 +504,12 @@ int mhi_pci_probe(struct pci_dev *pci_de
 	pm_runtime_allow(&pci_dev->dev);

 	if (mhi_cntrl->dentry) {
-		debugfs_create_file("m0", 0444, mhi_cntrl->dentry, mhi_cntrl,
-				    &debugfs_trigger_m0_fops);
-		debugfs_create_file("m3", 0444, mhi_cntrl->dentry, mhi_cntrl,
-				    &debugfs_trigger_m3_fops);
+		debugfs_create_file_unsafe("m0", 0444, mhi_cntrl->dentry,
+					   mhi_cntrl,
+					   &debugfs_trigger_m0_fops);
+		debugfs_create_file_unsafe("m3", 0444, mhi_cntrl->dentry,
+					   mhi_cntrl,
+					   &debugfs_trigger_m3_fops);
 	}

 	MHI_LOG("Return successful\n");

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-28  7:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-28  7:15 [PATCH] mhi_bus: controller: fix debugfs_simple_attr.cocci warnings Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).