summaryrefslogtreecommitdiffstats
path: root/include/linux/wimax
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-08-10 06:17:16 -0400
committerDavid S. Miller <davem@davemloft.net>2019-08-10 18:25:47 -0400
commita62052ba2aecb9269a32efeb3e22f96b83a13304 (patch)
tree47b4a528a298070c8bf0a880cf01402dbd99a667 /include/linux/wimax
parent38b9e0f6d981daf46a935c8c63a67f3949a15b6a (diff)
wimax: 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. This cleans up a lot of unneeded code and logic around the debugfs wimax files, making all of this much simpler and easier to understand. Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> Cc: linux-wimax@intel.com Cc: netdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/wimax')
-rw-r--r--include/linux/wimax/debug.h20
1 files changed, 3 insertions, 17 deletions
diff --git a/include/linux/wimax/debug.h b/include/linux/wimax/debug.h
index 7cb63e4ec0ae..4dd2c1cea6a9 100644
--- a/include/linux/wimax/debug.h
+++ b/include/linux/wimax/debug.h
@@ -98,9 +98,7 @@
98 * To manipulate from user space the levels, create a debugfs dentry 98 * To manipulate from user space the levels, create a debugfs dentry
99 * and then register each submodule with: 99 * and then register each submodule with:
100 * 100 *
101 * result = d_level_register_debugfs("PREFIX_", submodule_X, parent); 101 * d_level_register_debugfs("PREFIX_", submodule_X, parent);
102 * if (result < 0)
103 * goto error;
104 * 102 *
105 * Where PREFIX_ is a name of your chosing. This will create debugfs 103 * Where PREFIX_ is a name of your chosing. This will create debugfs
106 * file with a single numeric value that can be use to tweak it. To 104 * file with a single numeric value that can be use to tweak it. To
@@ -408,25 +406,13 @@ do { \
408 * @submodule: name of submodule (not a string, just the name) 406 * @submodule: name of submodule (not a string, just the name)
409 * @dentry: debugfs parent dentry 407 * @dentry: debugfs parent dentry
410 * 408 *
411 * Returns: 0 if ok, < 0 errno on error.
412 *
413 * For removing, just use debugfs_remove_recursive() on the parent. 409 * For removing, just use debugfs_remove_recursive() on the parent.
414 */ 410 */
415#define d_level_register_debugfs(prefix, name, parent) \ 411#define d_level_register_debugfs(prefix, name, parent) \
416({ \ 412({ \
417 int rc; \ 413 debugfs_create_u8( \
418 struct dentry *fd; \ 414 prefix #name, 0600, parent, \
419 struct dentry *verify_parent_type = parent; \
420 fd = debugfs_create_u8( \
421 prefix #name, 0600, verify_parent_type, \
422 &(D_LEVEL[__D_SUBMODULE_ ## name].level)); \ 415 &(D_LEVEL[__D_SUBMODULE_ ## name].level)); \
423 rc = PTR_ERR(fd); \
424 if (IS_ERR(fd) && rc != -ENODEV) \
425 printk(KERN_ERR "%s: Can't create debugfs entry %s: " \
426 "%d\n", __func__, prefix #name, rc); \
427 else \
428 rc = 0; \
429 rc; \
430}) 416})
431 417
432 418