HSI: omap_ssi_port: fix debugfs_simple_attr.cocci warnings
authorYueHaibing <yuehaibing@huawei.com>
Fri, 28 Dec 2018 07:33:35 +0000 (07:33 +0000)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Thu, 14 Feb 2019 11:36:21 +0000 (12:36 +0100)
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: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/hsi/controllers/omap_ssi_port.c

index b2b3989ccfd2842fed244ad13d4033b5ba23c3c6..afbf1345709da0d9cf7df2958ff6ba41a6002963 100644 (file)
@@ -162,7 +162,7 @@ static int ssi_div_set(void *data, u64 val)
        return 0;
 }
 
        return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(ssi_sst_div_fops, ssi_div_get, ssi_div_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(ssi_sst_div_fops, ssi_div_get, ssi_div_set, "%llu\n");
 
 static int ssi_debug_add_port(struct omap_ssi_port *omap_port,
                                     struct dentry *dir)
 
 static int ssi_debug_add_port(struct omap_ssi_port *omap_port,
                                     struct dentry *dir)
@@ -177,8 +177,8 @@ static int ssi_debug_add_port(struct omap_ssi_port *omap_port,
        dir = debugfs_create_dir("sst", dir);
        if (!dir)
                return -ENOMEM;
        dir = debugfs_create_dir("sst", dir);
        if (!dir)
                return -ENOMEM;
-       debugfs_create_file("divisor", S_IRUGO | S_IWUSR, dir, port,
-                           &ssi_sst_div_fops);
+       debugfs_create_file_unsafe("divisor", 0644, dir, port,
+                                  &ssi_sst_div_fops);
 
        return 0;
 }
 
        return 0;
 }