Skip to content

Commit 2448913

Browse files
committed
seq-buf: Make seq_buf_bprintf() conditional on CONFIG_BINARY_PRINTF
The function bstr_printf() from lib/vsprnintf.c is only available if CONFIG_BINARY_PRINTF is defined. This is due to the only user currently being the tracing infrastructure, which needs to select this config when tracing is configured. Until there is another user of the binary printf formats, this will continue to be the case. Since seq_buf.c is now lives in lib/ and is compiled even without tracing, it must encompass its use of bstr_printf() which is used by seq_buf_printf(). This too is only used by the tracing infrastructure and is still encapsulated by the CONFIG_BINARY_PRINTF. Link: http://lkml.kernel.org/r/[email protected] Tested-by: Jiri Kosina <[email protected]> Acked-by: Jiri Kosina <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent 01cb06a commit 2448913

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

include/linux/seq_buf.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ extern __printf(2, 3)
115115
int seq_buf_printf(struct seq_buf *s, const char *fmt, ...);
116116
extern __printf(2, 0)
117117
int seq_buf_vprintf(struct seq_buf *s, const char *fmt, va_list args);
118-
extern int
119-
seq_buf_bprintf(struct seq_buf *s, const char *fmt, const u32 *binary);
120118
extern int seq_buf_print_seq(struct seq_file *m, struct seq_buf *s);
121119
extern int seq_buf_to_user(struct seq_buf *s, char __user *ubuf,
122120
int cnt);
@@ -130,4 +128,9 @@ extern int seq_buf_path(struct seq_buf *s, const struct path *path, const char *
130128
extern int seq_buf_bitmask(struct seq_buf *s, const unsigned long *maskp,
131129
int nmaskbits);
132130

131+
#ifdef CONFIG_BINARY_PRINTF
132+
extern int
133+
seq_buf_bprintf(struct seq_buf *s, const char *fmt, const u32 *binary);
134+
#endif
135+
133136
#endif /* _LINUX_SEQ_BUF_H */

kernel/trace/seq_buf.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ int seq_buf_bitmask(struct seq_buf *s, const unsigned long *maskp,
127127
return -1;
128128
}
129129

130+
#ifdef CONFIG_BINARY_PRINTF
130131
/**
131132
* seq_buf_bprintf - Write the printf string from binary arguments
132133
* @s: seq_buf descriptor
@@ -161,6 +162,7 @@ int seq_buf_bprintf(struct seq_buf *s, const char *fmt, const u32 *binary)
161162
seq_buf_set_overflow(s);
162163
return -1;
163164
}
165+
#endif /* CONFIG_BINARY_PRINTF */
164166

165167
/**
166168
* seq_buf_puts - sequence printing of simple string

0 commit comments

Comments
 (0)