CC: [email protected]
CC: Linux Memory Management List <[email protected]>
TO: Dmitry Osipenko <[email protected]>
CC: Thierry Reding <[email protected]>
CC: Krzysztof Kozlowski <[email protected]>
CC: Jonathan Hunter <[email protected]>
CC: Joseph Lo <[email protected]>
CC: Geert Uytterhoeven <[email protected]>
CC: [email protected]
CC: [email protected]

From: kernel test robot <[email protected]>

drivers/memory/tegra/tegra210-emc-core.c:1695:0-23: WARNING: 
tegra210_emc_debug_max_rate_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE
drivers/memory/tegra/tegra210-emc-core.c:1665:0-23: WARNING: 
tegra210_emc_debug_min_rate_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE
drivers/memory/tegra/tegra210-emc-core.c:1726:0-23: WARNING: 
tegra210_emc_debug_temperature_fops should be defined with 
DEFINE_DEBUGFS_ATTRIBUTE

 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

Fixes: 56ebc9b0d77e ("memory: tegra: Enable compile testing for all drivers")
CC: Dmitry Osipenko <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
master
head:   c7d4c1fd91ab4a6d2620497921a9c6bf54650ab8
commit: 56ebc9b0d77e0406aba2d900c82e79204cc7dc32 [6065/10489] memory: tegra: 
Enable compile testing for all drivers
:::::: branch date: 22 hours ago
:::::: commit date: 2 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 tegra210-emc-core.c |   30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

--- a/drivers/memory/tegra/tegra210-emc-core.c
+++ b/drivers/memory/tegra/tegra210-emc-core.c
@@ -1662,9 +1662,9 @@ static int tegra210_emc_debug_min_rate_s
        return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(tegra210_emc_debug_min_rate_fops,
-                       tegra210_emc_debug_min_rate_get,
-                       tegra210_emc_debug_min_rate_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(tegra210_emc_debug_min_rate_fops,
+                        tegra210_emc_debug_min_rate_get,
+                        tegra210_emc_debug_min_rate_set, "%llu\n");
 
 static int tegra210_emc_debug_max_rate_get(void *data, u64 *rate)
 {
@@ -1692,9 +1692,9 @@ static int tegra210_emc_debug_max_rate_s
        return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(tegra210_emc_debug_max_rate_fops,
-                       tegra210_emc_debug_max_rate_get,
-                       tegra210_emc_debug_max_rate_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(tegra210_emc_debug_max_rate_fops,
+                        tegra210_emc_debug_max_rate_get,
+                        tegra210_emc_debug_max_rate_set, "%llu\n");
 
 static int tegra210_emc_debug_temperature_get(void *data, u64 *temperature)
 {
@@ -1723,9 +1723,9 @@ static int tegra210_emc_debug_temperatur
        return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(tegra210_emc_debug_temperature_fops,
-                       tegra210_emc_debug_temperature_get,
-                       tegra210_emc_debug_temperature_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(tegra210_emc_debug_temperature_fops,
+                        tegra210_emc_debug_temperature_get,
+                        tegra210_emc_debug_temperature_set, "%llu\n");
 
 static void tegra210_emc_debugfs_init(struct tegra210_emc *emc)
 {
@@ -1766,12 +1766,12 @@ static void tegra210_emc_debugfs_init(st
 
        debugfs_create_file("available_rates", 0444, emc->debugfs.root, emc,
                            &tegra210_emc_debug_available_rates_fops);
-       debugfs_create_file("min_rate", 0644, emc->debugfs.root, emc,
-                           &tegra210_emc_debug_min_rate_fops);
-       debugfs_create_file("max_rate", 0644, emc->debugfs.root, emc,
-                           &tegra210_emc_debug_max_rate_fops);
-       debugfs_create_file("temperature", 0644, emc->debugfs.root, emc,
-                           &tegra210_emc_debug_temperature_fops);
+       debugfs_create_file_unsafe("min_rate", 0644, emc->debugfs.root, emc,
+                                  &tegra210_emc_debug_min_rate_fops);
+       debugfs_create_file_unsafe("max_rate", 0644, emc->debugfs.root, emc,
+                                  &tegra210_emc_debug_max_rate_fops);
+       debugfs_create_file_unsafe("temperature", 0644, emc->debugfs.root,
+                                  emc, &tegra210_emc_debug_temperature_fops);
 }
 
 static void tegra210_emc_detect(struct tegra210_emc *emc)
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to