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

arm: omap1: 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: Paul Walmsley <paul@pwsan.com>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Kevin Hilman <khilman@kernel.org>
Cc: linux-omap@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+14 -56
+12 -51
arch/arm/mach-omap1/clock.c
··· 990 990 991 991 DEFINE_SHOW_ATTRIBUTE(debug_clock); 992 992 993 - static int clk_debugfs_register_one(struct clk *c) 993 + static void clk_debugfs_register_one(struct clk *c) 994 994 { 995 - int err; 996 995 struct dentry *d; 997 996 struct clk *pa = c->parent; 998 997 999 998 d = debugfs_create_dir(c->name, pa ? pa->dent : clk_debugfs_root); 1000 - if (!d) 1001 - return -ENOMEM; 1002 999 c->dent = d; 1003 1000 1004 - d = debugfs_create_u8("usecount", S_IRUGO, c->dent, &c->usecount); 1005 - if (!d) { 1006 - err = -ENOMEM; 1007 - goto err_out; 1008 - } 1009 - d = debugfs_create_ulong("rate", S_IRUGO, c->dent, &c->rate); 1010 - if (!d) { 1011 - err = -ENOMEM; 1012 - goto err_out; 1013 - } 1014 - d = debugfs_create_x8("flags", S_IRUGO, c->dent, &c->flags); 1015 - if (!d) { 1016 - err = -ENOMEM; 1017 - goto err_out; 1018 - } 1019 - return 0; 1020 - 1021 - err_out: 1022 - debugfs_remove_recursive(c->dent); 1023 - return err; 1001 + debugfs_create_u8("usecount", S_IRUGO, c->dent, &c->usecount); 1002 + debugfs_create_ulong("rate", S_IRUGO, c->dent, &c->rate); 1003 + debugfs_create_x8("flags", S_IRUGO, c->dent, &c->flags); 1024 1004 } 1025 1005 1026 - static int clk_debugfs_register(struct clk *c) 1006 + static void clk_debugfs_register(struct clk *c) 1027 1007 { 1028 1008 int err; 1029 1009 struct clk *pa = c->parent; 1030 1010 1031 - if (pa && !pa->dent) { 1032 - err = clk_debugfs_register(pa); 1033 - if (err) 1034 - return err; 1035 - } 1011 + if (pa && !pa->dent) 1012 + clk_debugfs_register(pa); 1036 1013 1037 - if (!c->dent) { 1038 - err = clk_debugfs_register_one(c); 1039 - if (err) 1040 - return err; 1041 - } 1042 - return 0; 1014 + if (!c->dent) 1015 + clk_debugfs_register_one(c); 1043 1016 } 1044 1017 1045 1018 static int __init clk_debugfs_init(void) 1046 1019 { 1047 1020 struct clk *c; 1048 1021 struct dentry *d; 1049 - int err; 1050 1022 1051 1023 d = debugfs_create_dir("clock", NULL); 1052 - if (!d) 1053 - return -ENOMEM; 1054 1024 clk_debugfs_root = d; 1055 1025 1056 - list_for_each_entry(c, &clocks, node) { 1057 - err = clk_debugfs_register(c); 1058 - if (err) 1059 - goto err_out; 1060 - } 1026 + list_for_each_entry(c, &clocks, node) 1027 + clk_debugfs_register(c); 1061 1028 1062 - d = debugfs_create_file("summary", S_IRUGO, 1063 - d, NULL, &debug_clock_fops); 1064 - if (!d) 1065 - return -ENOMEM; 1029 + debugfs_create_file("summary", S_IRUGO, d, NULL, &debug_clock_fops); 1066 1030 1067 1031 return 0; 1068 - err_out: 1069 - debugfs_remove_recursive(clk_debugfs_root); 1070 - return err; 1071 1032 } 1072 1033 late_initcall(clk_debugfs_init); 1073 1034
+2 -5
arch/arm/mach-omap1/pm.c
··· 539 539 struct dentry *d; 540 540 541 541 d = debugfs_create_dir("pm_debug", NULL); 542 - if (!d) 543 - return; 544 - 545 - (void) debugfs_create_file("omap_pm", S_IWUSR | S_IRUGO, 546 - d, NULL, &omap_pm_debug_fops); 542 + debugfs_create_file("omap_pm", S_IWUSR | S_IRUGO, d, NULL, 543 + &omap_pm_debug_fops); 547 544 } 548 545 549 546 #endif /* CONFIG_DEBUG_FS */