Skip to content

Commit 9096032

Browse files
committed
tracing: Remove trace_seq_reserve()
trace_seq_reserve() has no users in the kernel, it just wastes space. Remove it. Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent 6d2289f commit 9096032

2 files changed

Lines changed: 0 additions & 35 deletions

File tree

‎include/linux/trace_seq.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ extern int trace_seq_putc(struct trace_seq *s, unsigned char c);
4343
extern int trace_seq_putmem(struct trace_seq *s, const void *mem, unsigned int len);
4444
extern int trace_seq_putmem_hex(struct trace_seq *s, const void *mem,
4545
unsigned int len);
46-
extern void *trace_seq_reserve(struct trace_seq *s, unsigned int len);
4746
extern int trace_seq_path(struct trace_seq *s, const struct path *path);
4847

4948
extern int trace_seq_bitmask(struct trace_seq *s, const unsigned long *maskp,
@@ -94,10 +93,6 @@ static inline int trace_seq_putmem_hex(struct trace_seq *s, const void *mem,
9493
{
9594
return 0;
9695
}
97-
static inline void *trace_seq_reserve(struct trace_seq *s, unsigned int len)
98-
{
99-
return NULL;
100-
}
10196
static inline int trace_seq_path(struct trace_seq *s, const struct path *path)
10297
{
10398
return 0;

‎kernel/trace/trace_seq.c‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -341,36 +341,6 @@ int trace_seq_putmem_hex(struct trace_seq *s, const void *mem,
341341
}
342342
EXPORT_SYMBOL_GPL(trace_seq_putmem_hex);
343343

344-
/**
345-
* trace_seq_reserve - reserve space on the sequence buffer
346-
* @s: trace sequence descriptor
347-
* @len: The amount to reserver.
348-
*
349-
* If for some reason there is a need to save some space on the
350-
* buffer to fill in later, this function is used for that purpose.
351-
* The given length will be reserved and the pointer to that
352-
* location on the buffer is returned, unless there is not enough
353-
* buffer left to hold the given length then NULL is returned.
354-
*/
355-
void *trace_seq_reserve(struct trace_seq *s, unsigned int len)
356-
{
357-
void *ret;
358-
359-
if (s->full)
360-
return NULL;
361-
362-
if (len > TRACE_SEQ_BUF_LEFT(s)) {
363-
s->full = 1;
364-
return NULL;
365-
}
366-
367-
ret = s->buffer + s->len;
368-
s->len += len;
369-
370-
return ret;
371-
}
372-
EXPORT_SYMBOL_GPL(trace_seq_reserve);
373-
374344
/**
375345
* trace_seq_path - copy a path into the sequence buffer
376346
* @s: trace sequence descriptor

0 commit comments

Comments
 (0)