hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/linux/wimax/debug.h
....@@ -1,28 +1,12 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Linux WiMAX
34 * Collection of tools to manage debug operations.
45 *
5
- *
66 * Copyright (C) 2005-2007 Intel Corporation
77 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
88 *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU General Public License version
11
- * 2 as published by the Free Software Foundation.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program; if not, write to the Free Software
20
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21
- * 02110-1301, USA.
22
- *
23
- *
249 * Don't #include this file directly, read on!
25
- *
2610 *
2711 * EXECUTING DEBUGGING ACTIONS OR NOT
2812 *
....@@ -43,7 +27,6 @@
4327 * always false at compile time will get the code depending on it
4428 * compiled out by optimization.
4529 *
46
- *
4730 * DEBUG LEVELS
4831 *
4932 * It is up to the caller to define how much a debugging level is.
....@@ -52,13 +35,11 @@
5235 * will always be taken). The increasing debug levels are used for
5336 * increased verbosity.
5437 *
55
- *
5638 * USAGE
5739 *
5840 * Group the code in modules and submodules inside each module [which
5941 * in most cases maps to Linux modules and .c files that compose
6042 * those].
61
- *
6243 *
6344 * For each module, there is:
6445 *
....@@ -117,9 +98,7 @@
11798 * To manipulate from user space the levels, create a debugfs dentry
11899 * and then register each submodule with:
119100 *
120
- * result = d_level_register_debugfs("PREFIX_", submodule_X, parent);
121
- * if (result < 0)
122
- * goto error;
101
+ * d_level_register_debugfs("PREFIX_", submodule_X, parent);
123102 *
124103 * Where PREFIX_ is a name of your chosing. This will create debugfs
125104 * file with a single numeric value that can be use to tweak it. To
....@@ -128,7 +107,6 @@
128107 * NOTE: remember that even if this will show attached to some
129108 * particular instance of a device, the settings are *global*.
130109 *
131
- *
132110 * On each submodule (for example, .c files), the debug infrastructure
133111 * should be included like this:
134112 *
....@@ -136,7 +114,6 @@
136114 * #include "debug-levels.h"
137115 *
138116 * after #including all your include files.
139
- *
140117 *
141118 * Now you can use the d_*() macros below [d_test(), d_fnstart(),
142119 * d_fnend(), d_printf(), d_dump()].
....@@ -207,8 +184,8 @@
207184
208185
209186 /*
210
- * CPP sintatic sugar to generate A_B like symbol names when one of
211
- * the arguments is a a preprocessor #define.
187
+ * CPP syntactic sugar to generate A_B like symbol names when one of
188
+ * the arguments is a preprocessor #define.
212189 */
213190 #define __D_PASTE__(varname, modulename) varname##_##modulename
214191 #define __D_PASTE(varname, modulename) (__D_PASTE__(varname, modulename))
....@@ -429,25 +406,13 @@
429406 * @submodule: name of submodule (not a string, just the name)
430407 * @dentry: debugfs parent dentry
431408 *
432
- * Returns: 0 if ok, < 0 errno on error.
433
- *
434409 * For removing, just use debugfs_remove_recursive() on the parent.
435410 */
436411 #define d_level_register_debugfs(prefix, name, parent) \
437412 ({ \
438
- int rc; \
439
- struct dentry *fd; \
440
- struct dentry *verify_parent_type = parent; \
441
- fd = debugfs_create_u8( \
442
- prefix #name, 0600, verify_parent_type, \
413
+ debugfs_create_u8( \
414
+ prefix #name, 0600, parent, \
443415 &(D_LEVEL[__D_SUBMODULE_ ## name].level)); \
444
- rc = PTR_ERR(fd); \
445
- if (IS_ERR(fd) && rc != -ENODEV) \
446
- printk(KERN_ERR "%s: Can't create debugfs entry %s: " \
447
- "%d\n", __func__, prefix #name, rc); \
448
- else \
449
- rc = 0; \
450
- rc; \
451416 })
452417
453418