Skip to content

Commit 9afbb71

Browse files
gregkhpaulburton
authored andcommitted
mips: cavium: no need to check return value of debugfs_create functions
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Burton <paul.burton@mips.com> Cc: James Hogan <jhogan@kernel.org> Cc: linux-mips@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [paul.burton@mips.com: Remove return 0 from init_debugfs() as pointed out by Aaro Koskinen.] Signed-off-by: Paul Burton <paul.burton@mips.com>
1 parent f263f2a commit 9afbb71

File tree

1 file changed

+4
-28
lines changed

1 file changed

+4
-28
lines changed

arch/mips/cavium-octeon/oct_ilm.c

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -63,31 +63,11 @@ static int reset_statistics(void *data, u64 value)
6363

6464
DEFINE_SIMPLE_ATTRIBUTE(reset_statistics_ops, NULL, reset_statistics, "%llu\n");
6565

66-
static int init_debufs(void)
66+
static void init_debugfs(void)
6767
{
68-
struct dentry *show_dentry;
6968
dir = debugfs_create_dir("oct_ilm", 0);
70-
if (!dir) {
71-
pr_err("oct_ilm: failed to create debugfs entry oct_ilm\n");
72-
return -1;
73-
}
74-
75-
show_dentry = debugfs_create_file("statistics", 0222, dir, NULL,
76-
&oct_ilm_ops);
77-
if (!show_dentry) {
78-
pr_err("oct_ilm: failed to create debugfs entry oct_ilm/statistics\n");
79-
return -1;
80-
}
81-
82-
show_dentry = debugfs_create_file("reset", 0222, dir, NULL,
83-
&reset_statistics_ops);
84-
if (!show_dentry) {
85-
pr_err("oct_ilm: failed to create debugfs entry oct_ilm/reset\n");
86-
return -1;
87-
}
88-
89-
return 0;
90-
69+
debugfs_create_file("statistics", 0222, dir, NULL, &oct_ilm_ops);
70+
debugfs_create_file("reset", 0222, dir, NULL, &reset_statistics_ops);
9171
}
9272

9373
static void init_latency_info(struct latency_info *li, int startup)
@@ -169,11 +149,7 @@ static __init int oct_ilm_module_init(void)
169149
int rc;
170150
int irq = OCTEON_IRQ_TIMER0 + TIMER_NUM;
171151

172-
rc = init_debufs();
173-
if (rc) {
174-
WARN(1, "Could not create debugfs entries");
175-
return rc;
176-
}
152+
init_debugfs();
177153

178154
rc = request_irq(irq, cvm_oct_ciu_timer_interrupt, IRQF_NO_THREAD,
179155
"oct_ilm", 0);

0 commit comments

Comments
 (0)