@@ -69,20 +69,15 @@ int trace_print_seq(struct seq_file *m, struct trace_seq *s)
6969 * trace_seq_printf() is used to store strings into a special
7070 * buffer (@s). Then the output may be either used by
7171 * the sequencer or pulled into another buffer.
72- *
73- * Returns 1 if we successfully written all the contents to
74- * the buffer.
75- * Returns 0 if we the length to write is bigger than the
76- * reserved buffer space. In this case, nothing gets written.
7772 */
78- int trace_seq_printf (struct trace_seq * s , const char * fmt , ...)
73+ void trace_seq_printf (struct trace_seq * s , const char * fmt , ...)
7974{
8075 unsigned int len = TRACE_SEQ_BUF_LEFT (s );
8176 va_list ap ;
8277 int ret ;
8378
8479 if (s -> full || !len )
85- return 0 ;
80+ return ;
8681
8782 va_start (ap , fmt );
8883 ret = vsnprintf (s -> buffer + s -> len , len , fmt , ap );
@@ -91,12 +86,10 @@ int trace_seq_printf(struct trace_seq *s, const char *fmt, ...)
9186 /* If we can't write it all, don't bother writing anything */
9287 if (ret >= len ) {
9388 s -> full = 1 ;
94- return 0 ;
89+ return ;
9590 }
9691
9792 s -> len += ret ;
98-
99- return 1 ;
10093}
10194EXPORT_SYMBOL_GPL (trace_seq_printf );
10295
@@ -107,25 +100,18 @@ EXPORT_SYMBOL_GPL(trace_seq_printf);
107100 * @nmaskbits: The number of bits that are valid in @maskp
108101 *
109102 * Writes a ASCII representation of a bitmask string into @s.
110- *
111- * Returns 1 if we successfully written all the contents to
112- * the buffer.
113- * Returns 0 if we the length to write is bigger than the
114- * reserved buffer space. In this case, nothing gets written.
115103 */
116- int trace_seq_bitmask (struct trace_seq * s , const unsigned long * maskp ,
104+ void trace_seq_bitmask (struct trace_seq * s , const unsigned long * maskp ,
117105 int nmaskbits )
118106{
119107 unsigned int len = TRACE_SEQ_BUF_LEFT (s );
120108 int ret ;
121109
122110 if (s -> full || !len )
123- return 0 ;
111+ return ;
124112
125113 ret = bitmap_scnprintf (s -> buffer + s -> len , len , maskp , nmaskbits );
126114 s -> len += ret ;
127-
128- return 1 ;
129115}
130116EXPORT_SYMBOL_GPL (trace_seq_bitmask );
131117
@@ -139,28 +125,24 @@ EXPORT_SYMBOL_GPL(trace_seq_bitmask);
139125 * trace_seq_printf is used to store strings into a special
140126 * buffer (@s). Then the output may be either used by
141127 * the sequencer or pulled into another buffer.
142- *
143- * Returns how much it wrote to the buffer.
144128 */
145- int trace_seq_vprintf (struct trace_seq * s , const char * fmt , va_list args )
129+ void trace_seq_vprintf (struct trace_seq * s , const char * fmt , va_list args )
146130{
147131 unsigned int len = TRACE_SEQ_BUF_LEFT (s );
148132 int ret ;
149133
150134 if (s -> full || !len )
151- return 0 ;
135+ return ;
152136
153137 ret = vsnprintf (s -> buffer + s -> len , len , fmt , args );
154138
155139 /* If we can't write it all, don't bother writing anything */
156140 if (ret >= len ) {
157141 s -> full = 1 ;
158- return 0 ;
142+ return ;
159143 }
160144
161145 s -> len += ret ;
162-
163- return len ;
164146}
165147EXPORT_SYMBOL_GPL (trace_seq_vprintf );
166148
@@ -178,28 +160,24 @@ EXPORT_SYMBOL_GPL(trace_seq_vprintf);
178160 *
179161 * This function will take the format and the binary array and finish
180162 * the conversion into the ASCII string within the buffer.
181- *
182- * Returns how much it wrote to the buffer.
183163 */
184- int trace_seq_bprintf (struct trace_seq * s , const char * fmt , const u32 * binary )
164+ void trace_seq_bprintf (struct trace_seq * s , const char * fmt , const u32 * binary )
185165{
186166 unsigned int len = TRACE_SEQ_BUF_LEFT (s );
187167 int ret ;
188168
189169 if (s -> full || !len )
190- return 0 ;
170+ return ;
191171
192172 ret = bstr_printf (s -> buffer + s -> len , len , fmt , binary );
193173
194174 /* If we can't write it all, don't bother writing anything */
195175 if (ret >= len ) {
196176 s -> full = 1 ;
197- return 0 ;
177+ return ;
198178 }
199179
200180 s -> len += ret ;
201-
202- return len ;
203181}
204182EXPORT_SYMBOL_GPL (trace_seq_bprintf );
205183
@@ -212,25 +190,21 @@ EXPORT_SYMBOL_GPL(trace_seq_bprintf);
212190 * copy to user routines. This function records a simple string
213191 * into a special buffer (@s) for later retrieval by a sequencer
214192 * or other mechanism.
215- *
216- * Returns how much it wrote to the buffer.
217193 */
218- int trace_seq_puts (struct trace_seq * s , const char * str )
194+ void trace_seq_puts (struct trace_seq * s , const char * str )
219195{
220196 unsigned int len = strlen (str );
221197
222198 if (s -> full )
223- return 0 ;
199+ return ;
224200
225201 if (len > TRACE_SEQ_BUF_LEFT (s )) {
226202 s -> full = 1 ;
227- return 0 ;
203+ return ;
228204 }
229205
230206 memcpy (s -> buffer + s -> len , str , len );
231207 s -> len += len ;
232-
233- return len ;
234208}
235209EXPORT_SYMBOL_GPL (trace_seq_puts );
236210
@@ -243,22 +217,18 @@ EXPORT_SYMBOL_GPL(trace_seq_puts);
243217 * copy to user routines. This function records a simple charater
244218 * into a special buffer (@s) for later retrieval by a sequencer
245219 * or other mechanism.
246- *
247- * Returns how much it wrote to the buffer.
248220 */
249- int trace_seq_putc (struct trace_seq * s , unsigned char c )
221+ void trace_seq_putc (struct trace_seq * s , unsigned char c )
250222{
251223 if (s -> full )
252- return 0 ;
224+ return ;
253225
254226 if (TRACE_SEQ_BUF_LEFT (s ) < 1 ) {
255227 s -> full = 1 ;
256- return 0 ;
228+ return ;
257229 }
258230
259231 s -> buffer [s -> len ++ ] = c ;
260-
261- return 1 ;
262232}
263233EXPORT_SYMBOL_GPL (trace_seq_putc );
264234
@@ -271,23 +241,19 @@ EXPORT_SYMBOL_GPL(trace_seq_putc);
271241 * There may be cases where raw memory needs to be written into the
272242 * buffer and a strcpy() would not work. Using this function allows
273243 * for such cases.
274- *
275- * Returns how much it wrote to the buffer.
276244 */
277- int trace_seq_putmem (struct trace_seq * s , const void * mem , unsigned int len )
245+ void trace_seq_putmem (struct trace_seq * s , const void * mem , unsigned int len )
278246{
279247 if (s -> full )
280- return 0 ;
248+ return ;
281249
282250 if (len > TRACE_SEQ_BUF_LEFT (s )) {
283251 s -> full = 1 ;
284- return 0 ;
252+ return ;
285253 }
286254
287255 memcpy (s -> buffer + s -> len , mem , len );
288256 s -> len += len ;
289-
290- return len ;
291257}
292258EXPORT_SYMBOL_GPL (trace_seq_putmem );
293259
@@ -303,20 +269,17 @@ EXPORT_SYMBOL_GPL(trace_seq_putmem);
303269 * This is similar to trace_seq_putmem() except instead of just copying the
304270 * raw memory into the buffer it writes its ASCII representation of it
305271 * in hex characters.
306- *
307- * Returns how much it wrote to the buffer.
308272 */
309- int trace_seq_putmem_hex (struct trace_seq * s , const void * mem ,
273+ void trace_seq_putmem_hex (struct trace_seq * s , const void * mem ,
310274 unsigned int len )
311275{
312276 unsigned char hex [HEX_CHARS ];
313277 const unsigned char * data = mem ;
314278 unsigned int start_len ;
315279 int i , j ;
316- int cnt = 0 ;
317280
318281 if (s -> full )
319- return 0 ;
282+ return ;
320283
321284 while (len ) {
322285 start_len = min (len , HEX_CHARS - 1 );
@@ -335,9 +298,8 @@ int trace_seq_putmem_hex(struct trace_seq *s, const void *mem,
335298 len -= j / 2 ;
336299 hex [j ++ ] = ' ' ;
337300
338- cnt += trace_seq_putmem (s , hex , j );
301+ trace_seq_putmem (s , hex , j );
339302 }
340- return cnt ;
341303}
342304EXPORT_SYMBOL_GPL (trace_seq_putmem_hex );
343305
0 commit comments