Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HSI: omap_ssi_port: 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: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

YueHaibing and committed by
Sebastian Reichel
1ff85bfa bfeffd15

+3 -3
+3 -3
drivers/hsi/controllers/omap_ssi_port.c
··· 162 162 return 0; 163 163 } 164 164 165 - DEFINE_SIMPLE_ATTRIBUTE(ssi_sst_div_fops, ssi_div_get, ssi_div_set, "%llu\n"); 165 + DEFINE_DEBUGFS_ATTRIBUTE(ssi_sst_div_fops, ssi_div_get, ssi_div_set, "%llu\n"); 166 166 167 167 static int ssi_debug_add_port(struct omap_ssi_port *omap_port, 168 168 struct dentry *dir) ··· 177 177 dir = debugfs_create_dir("sst", dir); 178 178 if (!dir) 179 179 return -ENOMEM; 180 - debugfs_create_file("divisor", S_IRUGO | S_IWUSR, dir, port, 181 - &ssi_sst_div_fops); 180 + debugfs_create_file_unsafe("divisor", 0644, dir, port, 181 + &ssi_sst_div_fops); 182 182 183 183 return 0; 184 184 }