History

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.

Greg Kroah-Hartman committed 7 years ago

Commit a62052b1 parent 38b9e0f8 files · +51 −257Browse files

Showing the changes to include/linux (1 of 8 files). Show all

Unified · Split

include/linux/wimax/debug.h+3−17
@@ -98,9 +98,7 @@ · 97 unmodified lines
9898 * To manipulate from user space the levels, create a debugfs dentry
9999 * and then register each submodule with:
100100 *
101− * result = d_level_register_debugfs("PREFIX_", submodule_X, parent);
102− * if (result < 0)
103− * goto error;
101+ * d_level_register_debugfs("PREFIX_", submodule_X, parent);
104102 *
105103 * Where PREFIX_ is a name of your chosing. This will create debugfs
106104 * file with a single numeric value that can be use to tweak it. To
@@ -408,25 +406,13 @@ do { \ · 301 unmodified lines
408406 * @submodule: name of submodule (not a string, just the name)
409407 * @dentry: debugfs parent dentry
410408 *
411− * Returns: 0 if ok, < 0 errno on error.
412− *
413409 * For removing, just use debugfs_remove_recursive() on the parent.
414410 */
415411 #define d_level_register_debugfs(prefix, name, parent) \
416412 ({ \
417− int rc; \
418− struct dentry *fd; \
419− struct dentry *verify_parent_type = parent; \
420− fd = debugfs_create_u8( \
421− prefix #name, 0600, verify_parent_type, \
413+ debugfs_create_u8( \
414+ prefix #name, 0600, parent, \
422415 &(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; \
430416 })
431417
432418

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t