hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/gpu/arm/bifrost/mali_kbase_debugfs_helper.h
....@@ -1,7 +1,7 @@
11 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22 /*
33 *
4
- * (C) COPYRIGHT 2019-2021 ARM Limited. All rights reserved.
4
+ * (C) COPYRIGHT 2019-2022 ARM Limited. All rights reserved.
55 *
66 * This program is free software and is provided to you under the terms of the
77 * GNU General Public License version 2 as published by the Free Software
....@@ -37,6 +37,11 @@
3737 * kbase_debugfs_helper_set_attr_from_string - Parse a string to reconfigure an
3838 * array
3939 *
40
+ * @buf: Input string to parse. Must be nul-terminated!
41
+ * @array: Address of an object that can be accessed like an array.
42
+ * @nelems: Number of elements in the array.
43
+ * @set_attr_fn: Function to be called back for each array element.
44
+ *
4045 * The given function is called once for each attribute value found in the
4146 * input string. It is not an error if the string specifies fewer attribute
4247 * values than the specified number of array elements.
....@@ -45,11 +50,6 @@
4550 * according to the standard rules (e.g. prefix "0x" for hexadecimal).
4651 * Attribute values are separated by one or more space characters.
4752 * Additional leading and trailing spaces are ignored.
48
- *
49
- * @buf: Input string to parse. Must be nul-terminated!
50
- * @array: Address of an object that can be accessed like an array.
51
- * @nelems: Number of elements in the array.
52
- * @set_attr_fn: Function to be called back for each array element.
5353 *
5454 * Return: 0 if success, negative error code otherwise.
5555 */
....@@ -62,6 +62,8 @@
6262 * debugfs file for any incorrect formats
6363 * or wrong values.
6464 *
65
+ * @buf: Null-terminated string to validate.
66
+ *
6567 * This function is to be used before any writes to debugfs values are done
6668 * such that any strings with erroneous values (such as octal 09 or
6769 * hexadecimal 0xGH are fully ignored) - without this validation, any correct
....@@ -72,8 +74,6 @@
7274 * It is largely similar to set_attr_from_string to iterate through the values
7375 * of the input string. This function also requires the input string to be
7476 * writable.
75
- *
76
- * @buf: Null-terminated string to validate.
7777 *
7878 * Return: 0 with no error, else -22 (the invalid return value of kstrtoul) if
7979 * any value in the string was wrong or with an incorrect format.
....@@ -95,16 +95,16 @@
9595 * kbase_debugfs_helper_get_attr_to_string - Construct a formatted string
9696 * from elements in an array
9797 *
98
- * The given function is called once for each array element to get the
99
- * value of the attribute to be inspected. The attribute values are
100
- * written to the buffer as a formatted string of decimal numbers
101
- * separated by spaces and terminated by a linefeed.
102
- *
10398 * @buf: Buffer in which to store the formatted output string.
10499 * @size: The size of the buffer, in bytes.
105100 * @array: Address of an object that can be accessed like an array.
106101 * @nelems: Number of elements in the array.
107102 * @get_attr_fn: Function to be called back for each array element.
103
+ *
104
+ * The given function is called once for each array element to get the
105
+ * value of the attribute to be inspected. The attribute values are
106
+ * written to the buffer as a formatted string of decimal numbers
107
+ * separated by spaces and terminated by a linefeed.
108108 *
109109 * Return: Number of characters written excluding the nul terminator.
110110 */
....@@ -116,6 +116,10 @@
116116 * kbase_debugfs_helper_seq_read - Implements reads from a virtual file for an
117117 * array
118118 *
119
+ * @sfile: A virtual file previously opened by calling single_open.
120
+ * @nelems: Number of elements in the array.
121
+ * @get_attr_fn: Function to be called back for each array element.
122
+ *
119123 * The virtual file must have been opened by calling single_open and passing
120124 * the address of an object that can be accessed like an array.
121125 *
....@@ -123,10 +127,6 @@
123127 * value of the attribute to be inspected. The attribute values are
124128 * written to the buffer as a formatted string of decimal numbers
125129 * separated by spaces and terminated by a linefeed.
126
- *
127
- * @sfile: A virtual file previously opened by calling single_open.
128
- * @nelems: Number of elements in the array.
129
- * @get_attr_fn: Function to be called back for each array element.
130130 *
131131 * Return: 0 if success, negative error code otherwise.
132132 */
....@@ -138,18 +138,18 @@
138138 * kbase_debugfs_helper_seq_write - Implements writes to a virtual file for an
139139 * array
140140 *
141
+ * @file: A virtual file previously opened by calling single_open.
142
+ * @ubuf: Source address in user space.
143
+ * @count: Number of bytes written to the virtual file.
144
+ * @nelems: Number of elements in the array.
145
+ * @set_attr_fn: Function to be called back for each array element.
146
+ *
141147 * The virtual file must have been opened by calling single_open and passing
142148 * the address of an object that can be accessed like an array.
143149 *
144150 * The given function is called once for each attribute value found in the
145151 * data written to the virtual file. For further details, refer to the
146152 * description of set_attr_from_string.
147
- *
148
- * @file: A virtual file previously opened by calling single_open.
149
- * @ubuf: Source address in user space.
150
- * @count: Number of bytes written to the virtual file.
151
- * @nelems: Number of elements in the array.
152
- * @set_attr_fn: Function to be called back for each array element.
153153 *
154154 * Return: 0 if success, negative error code otherwise.
155155 */