diff options
Diffstat (limited to 'lib/seq_buf.c')
| -rw-r--r-- | lib/seq_buf.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/lib/seq_buf.c b/lib/seq_buf.c index 4eedfedb9e31..88c0854bd752 100644 --- a/lib/seq_buf.c +++ b/lib/seq_buf.c | |||
| @@ -91,42 +91,6 @@ int seq_buf_printf(struct seq_buf *s, const char *fmt, ...) | |||
| 91 | return ret; | 91 | return ret; |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | /** | ||
| 95 | * seq_buf_bitmask - write a bitmask array in its ASCII representation | ||
| 96 | * @s: seq_buf descriptor | ||
| 97 | * @maskp: points to an array of unsigned longs that represent a bitmask | ||
| 98 | * @nmaskbits: The number of bits that are valid in @maskp | ||
| 99 | * | ||
| 100 | * Writes a ASCII representation of a bitmask string into @s. | ||
| 101 | * | ||
| 102 | * Returns zero on success, -1 on overflow. | ||
| 103 | */ | ||
| 104 | int seq_buf_bitmask(struct seq_buf *s, const unsigned long *maskp, | ||
| 105 | int nmaskbits) | ||
| 106 | { | ||
| 107 | unsigned int len = seq_buf_buffer_left(s); | ||
| 108 | int ret; | ||
| 109 | |||
| 110 | WARN_ON(s->size == 0); | ||
| 111 | |||
| 112 | /* | ||
| 113 | * Note, because bitmap_scnprintf() only returns the number of bytes | ||
| 114 | * written and not the number that would be written, we use the last | ||
| 115 | * byte of the buffer to let us know if we overflowed. There's a small | ||
| 116 | * chance that the bitmap could have fit exactly inside the buffer, but | ||
| 117 | * it's not that critical if that does happen. | ||
| 118 | */ | ||
| 119 | if (len > 1) { | ||
| 120 | ret = bitmap_scnprintf(s->buffer + s->len, len, maskp, nmaskbits); | ||
| 121 | if (ret < len) { | ||
| 122 | s->len += ret; | ||
| 123 | return 0; | ||
| 124 | } | ||
| 125 | } | ||
| 126 | seq_buf_set_overflow(s); | ||
| 127 | return -1; | ||
| 128 | } | ||
| 129 | |||
| 130 | #ifdef CONFIG_BINARY_PRINTF | 94 | #ifdef CONFIG_BINARY_PRINTF |
| 131 | /** | 95 | /** |
| 132 | * seq_buf_bprintf - Write the printf string from binary arguments | 96 | * seq_buf_bprintf - Write the printf string from binary arguments |
