Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 49) sorted by relevance

12

/lib/
Dvsprintf.c185 char *put_dec_trunc8(char *buf, unsigned r) in put_dec_trunc8() argument
195 *((u16 *)buf) = decpair[r - 100*q]; in put_dec_trunc8()
196 buf += 2; in put_dec_trunc8()
204 *((u16 *)buf) = decpair[q - 100*r]; in put_dec_trunc8()
205 buf += 2; in put_dec_trunc8()
213 *((u16 *)buf) = decpair[r - 100*q]; in put_dec_trunc8()
214 buf += 2; in put_dec_trunc8()
220 *((u16 *)buf) = decpair[r]; in put_dec_trunc8()
221 buf += r < 10 ? 1 : 2; in put_dec_trunc8()
222 return buf; in put_dec_trunc8()
[all …]
Dtest_meminit.c66 void *buf; in do_alloc_pages_order() local
70 buf = page_address(page); in do_alloc_pages_order()
71 fill_with_garbage(buf, size); in do_alloc_pages_order()
75 buf = page_address(page); in do_alloc_pages_order()
76 if (count_nonzero_bytes(buf, size)) in do_alloc_pages_order()
78 fill_with_garbage(buf, size); in do_alloc_pages_order()
100 void *buf; in do_kmalloc_size() local
102 buf = kmalloc(size, GFP_KERNEL); in do_kmalloc_size()
103 fill_with_garbage(buf, size); in do_kmalloc_size()
104 kfree(buf); in do_kmalloc_size()
[all …]
Dtest_strscpy.c36 char buf[6]; in tc() local
47 memset(buf, POISON, sizeof(buf)); in tc()
49 max_count = sizeof(buf) - 2; /* Space for null and to verify overflow */ in tc()
60 written = strscpy_pad(buf, src, count); in tc()
67 if (strncmp(buf, src, count - 1) != 0) { in tc()
71 if (buf[count - 1] != '\0') { in tc()
78 if (buf[i] != src[i]) { in tc()
79 pr_err("buf[i]==%c != src[i]==%c\n", buf[i], src[i]); in tc()
85 if (buf[count - 1] != '\0') { in tc()
93 if (buf[index] != '\0') { in tc()
[all …]
Dtest_firmware.c108 static ssize_t test_fw_misc_read(struct file *f, char __user *buf, in test_fw_misc_read() argument
115 rc = simple_read_from_buffer(buf, size, offset, in test_fw_misc_read()
199 const char *buf, size_t count) in reset_store() argument
227 char *buf) in config_show() argument
233 len += scnprintf(buf, PAGE_SIZE - len, in config_show()
238 len += scnprintf(buf+len, PAGE_SIZE - len, in config_show()
242 len += scnprintf(buf+len, PAGE_SIZE - len, in config_show()
245 len += scnprintf(buf+len, PAGE_SIZE - len, in config_show()
248 len += scnprintf(buf+len, PAGE_SIZE - len, in config_show()
253 len += scnprintf(buf+len, PAGE_SIZE - len, in config_show()
[all …]
Dkobject_uevent.c62 static int kobject_action_type(const char *buf, size_t count, in kobject_action_type() argument
71 if (count && (buf[count-1] == '\n' || buf[count-1] == '\0')) in kobject_action_type()
77 args_start = strnchr(buf, count, ' '); in kobject_action_type()
79 count_first = args_start - buf; in kobject_action_type()
85 if (strncmp(kobject_actions[action], buf, count_first) != 0) in kobject_action_type()
99 static const char *action_arg_word_end(const char *buf, const char *buf_end, in action_arg_word_end() argument
102 const char *next = buf; in action_arg_word_end()
108 if (next == buf) in action_arg_word_end()
114 static int kobject_action_args(const char *buf, size_t count, in kobject_action_args() argument
122 if (count && (buf[count - 1] == '\n' || buf[count - 1] == '\0')) in kobject_action_args()
[all …]
Dtest_printf.c219 char buf[PLAIN_BUF_SIZE]; in plain_format() local
222 nchars = snprintf(buf, PLAIN_BUF_SIZE, "%p", PTR); in plain_format()
227 if (strncmp(buf, PTR_VAL_NO_CRNG, PTR_WIDTH) == 0) { in plain_format()
233 if (strncmp(buf, ZEROS, strlen(ZEROS)) != 0) in plain_format()
257 plain_hash_to_buffer(const void *p, char *buf, size_t len) in plain_hash_to_buffer() argument
261 nchars = snprintf(buf, len, "%p", p); in plain_hash_to_buffer()
266 if (strncmp(buf, PTR_VAL_NO_CRNG, PTR_WIDTH) == 0) { in plain_hash_to_buffer()
278 char buf[PLAIN_BUF_SIZE]; in plain_hash() local
281 ret = plain_hash_to_buffer(PTR, buf, PLAIN_BUF_SIZE); in plain_hash()
285 if (strncmp(buf, PTR_STR, PTR_WIDTH) == 0) in plain_hash()
[all …]
Dbitmap.c376 int __bitmap_parse(const char *buf, unsigned int buflen, in __bitmap_parse() argument
382 const char __user __force *ubuf = (const char __user __force *)buf; in __bitmap_parse()
399 c = *buf++; in __bitmap_parse()
490 int bitmap_print_to_pagebuf(bool list, char *buf, const unsigned long *maskp, in bitmap_print_to_pagebuf() argument
493 ptrdiff_t len = PAGE_SIZE - offset_in_page(buf); in bitmap_print_to_pagebuf()
495 return list ? scnprintf(buf, len, "%*pbl\n", nmaskbits, maskp) : in bitmap_print_to_pagebuf()
496 scnprintf(buf, len, "%*pb\n", nmaskbits, maskp); in bitmap_print_to_pagebuf()
642 int bitmap_parselist(const char *buf, unsigned long *maskp, int nmaskbits) in bitmap_parselist() argument
649 while (buf) { in bitmap_parselist()
650 buf = bitmap_find_region(buf); in bitmap_parselist()
[all …]
Ddynamic_debug.c91 static char *ddebug_describe_flags(struct _ddebug *dp, char *buf, in ddebug_describe_flags() argument
94 char *p = buf; in ddebug_describe_flags()
101 if (p == buf) in ddebug_describe_flags()
105 return buf; in ddebug_describe_flags()
222 static int ddebug_tokenize(char *buf, char *words[], int maxwords) in ddebug_tokenize() argument
226 while (*buf) { in ddebug_tokenize()
230 buf = skip_spaces(buf); in ddebug_tokenize()
231 if (!*buf) in ddebug_tokenize()
233 if (*buf == '#') in ddebug_tokenize()
237 if (*buf == '"' || *buf == '\'') { in ddebug_tokenize()
[all …]
Dparser.c129 char *buf; in match_number() local
133 buf = match_strdup(s); in match_number()
134 if (!buf) in match_number()
138 val = simple_strtol(buf, &endp, base); in match_number()
139 if (endp == buf) in match_number()
145 kfree(buf); in match_number()
161 char *buf; in match_u64int() local
165 buf = match_strdup(s); in match_u64int()
166 if (!buf) in match_u64int()
169 ret = kstrtoull(buf, base, &val); in match_u64int()
[all …]
Dtest_kmod.c461 char *buf) in config_show() argument
469 len += snprintf(buf, PAGE_SIZE, in config_show()
473 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
477 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
483 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
487 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
491 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
495 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
566 const char *buf, size_t count) in trigger_config_store() argument
654 const char *buf, size_t count) in config_test_driver_store() argument
[all …]
Ddecompress_inflate.c38 STATIC int INIT __gunzip(unsigned char *buf, long len, in __gunzip() argument
61 if (buf) in __gunzip()
62 zbuf = buf; in __gunzip()
177 if (!buf) in __gunzip()
187 STATIC int INIT gunzip(unsigned char *buf, long len, in gunzip() argument
194 return __gunzip(buf, len, fill, flush, out_buf, 0, pos, error); in gunzip()
197 STATIC int INIT __decompress(unsigned char *buf, long len, in __decompress() argument
204 return __gunzip(buf, len, fill, flush, out_buf, out_len, pos, error); in __decompress()
Dtest_hash.c49 fill_buf(char *buf, size_t len, u32 seed) in fill_buf() argument
55 buf[i] = mod255(seed); in fill_buf()
146 char buf[SIZE+1]; in test_hash_init() local
152 fill_buf(buf, SIZE, 1); in test_hash_init()
156 buf[j] = '\0'; in test_hash_init()
159 u64 hashlen = hashlen_string(buf+i, buf+i); in test_hash_init()
160 u32 h0 = full_name_hash(buf+i, buf+i, j-i); in test_hash_init()
Dtest_hexdump.c165 char buf[TEST_HEXDUMP_BUF_SIZE]; in test_hexdump_overflow() local
172 memset(buf, FILL_CHAR, sizeof(buf)); in test_hexdump_overflow()
174 r = hex_dump_to_buffer(data_b, len, rs, gs, buf, buflen, ascii); in test_hexdump_overflow()
195 a = r == e && !memcmp(test, buf, TEST_HEXDUMP_BUF_SIZE); in test_hexdump_overflow()
197 buf[sizeof(buf) - 1] = '\0'; in test_hexdump_overflow()
201 len, buflen, strnlen(buf, sizeof(buf))); in test_hexdump_overflow()
202 pr_err("Result: %d '%s'\n", r, buf); in test_hexdump_overflow()
Dkstrtox.c377 char buf[4]; in kstrtobool_from_user() local
379 count = min(count, sizeof(buf) - 1); in kstrtobool_from_user()
380 if (copy_from_user(buf, s, count)) in kstrtobool_from_user()
382 buf[count] = '\0'; in kstrtobool_from_user()
383 return kstrtobool(buf, res); in kstrtobool_from_user()
391 char buf[1 + sizeof(type) * 8 + 1 + 1]; \
393 count = min(count, sizeof(buf) - 1); \
394 if (copy_from_user(buf, s, count)) \
396 buf[count] = '\0'; \
397 return g(buf, base, res); \
Dkfifo.c114 const void *buf, unsigned int len) in __kfifo_in() argument
122 kfifo_copy_in(fifo, buf, len, fifo->in); in __kfifo_in()
153 void *buf, unsigned int len) in __kfifo_out_peek() argument
161 kfifo_copy_out(fifo, buf, len, fifo->out); in __kfifo_out_peek()
167 void *buf, unsigned int len) in __kfifo_out() argument
169 len = __kfifo_out_peek(fifo, buf, len); in __kfifo_out()
295 static int setup_sgl_buf(struct scatterlist *sgl, void *buf, in setup_sgl_buf() argument
310 page = virt_to_page(buf); in setup_sgl_buf()
311 off = offset_in_page(buf); in setup_sgl_buf()
318 buf += PAGE_SIZE; in setup_sgl_buf()
[all …]
Dtest_uuid.c66 char buf[48]; in test_uuid_test() local
75 sprintf(buf, "%pUl", &le); in test_uuid_test()
76 test_uuid_failed("cmp", false, false, data->uuid, buf); in test_uuid_test()
86 sprintf(buf, "%pUb", &be); in test_uuid_test()
87 test_uuid_failed("cmp", false, true, data->uuid, buf); in test_uuid_test()
Dhexdump.c105 int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize, in hex_dump_to_buffer() argument
108 const u8 *ptr = buf; in hex_dump_to_buffer()
135 const u64 *ptr8 = buf; in hex_dump_to_buffer()
146 const u32 *ptr4 = buf; in hex_dump_to_buffer()
157 const u16 *ptr2 = buf; in hex_dump_to_buffer()
241 const void *buf, size_t len, bool ascii) in print_hex_dump() argument
243 const u8 *ptr = buf; in print_hex_dump()
Dscatterlist.c138 void sg_init_one(struct scatterlist *sg, const void *buf, unsigned int buflen) in sg_init_one() argument
141 sg_set_buf(sg, buf, buflen); in sg_init_one()
840 size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf, in sg_copy_buffer() argument
863 memcpy(buf + offset, miter.addr, len); in sg_copy_buffer()
865 memcpy(miter.addr, buf + offset, len); in sg_copy_buffer()
887 const void *buf, size_t buflen) in sg_copy_from_buffer() argument
889 return sg_copy_buffer(sgl, nents, (void *)buf, buflen, 0, false); in sg_copy_from_buffer()
904 void *buf, size_t buflen) in sg_copy_to_buffer() argument
906 return sg_copy_buffer(sgl, nents, buf, buflen, 0, true); in sg_copy_to_buffer()
922 const void *buf, size_t buflen, off_t skip) in sg_pcopy_from_buffer() argument
[all …]
Dseq_buf.c267 char *buf; local
268 size_t size = seq_buf_get_buf(s, &buf);
274 char *p = d_path(path, buf, size);
276 char *end = mangle_path(buf, p, esc);
278 res = end - buf;
Diov_iter.c161 char __user *buf; in copy_page_to_iter_iovec() local
174 buf = iov->iov_base + skip; in copy_page_to_iter_iovec()
177 if (IS_ENABLED(CONFIG_HIGHMEM) && !fault_in_pages_writeable(buf, copy)) { in copy_page_to_iter_iovec()
182 left = copyout(buf, from, copy); in copy_page_to_iter_iovec()
190 buf = iov->iov_base; in copy_page_to_iter_iovec()
192 left = copyout(buf, from, copy); in copy_page_to_iter_iovec()
203 buf += copy; in copy_page_to_iter_iovec()
211 left = copyout(buf, from, copy); in copy_page_to_iter_iovec()
218 buf = iov->iov_base; in copy_page_to_iter_iovec()
220 left = copyout(buf, from, copy); in copy_page_to_iter_iovec()
[all …]
/lib/xz/
Dxz_dec_bcj.c74 uint8_t buf[16]; member
88 static size_t bcj_x86(struct xz_dec_bcj *s, uint8_t *buf, size_t size) in bcj_x86() argument
108 if ((buf[i] & 0xFE) != 0xE8) in bcj_x86()
117 b = buf[i + 4 - mask_to_bit_num[prev_mask]]; in bcj_x86()
129 if (bcj_x86_test_msbyte(buf[i + 4])) { in bcj_x86()
130 src = get_unaligned_le32(buf + i + 1); in bcj_x86()
146 put_unaligned_le32(dest, buf + i + 1); in bcj_x86()
160 static size_t bcj_powerpc(struct xz_dec_bcj *s, uint8_t *buf, size_t size) in bcj_powerpc() argument
166 instr = get_unaligned_be32(buf + i); in bcj_powerpc()
172 put_unaligned_be32(instr, buf + i); in bcj_powerpc()
[all …]
Dxz_dec_stream.c128 uint8_t buf[1024]; member
162 memcpy(s->temp.buf + s->temp.pos, b->in + b->in_pos, copy_size); in fill_temp()
389 if (!memeq(s->temp.buf, HEADER_MAGIC, HEADER_MAGIC_SIZE)) in dec_stream_header()
392 if (xz_crc32(s->temp.buf + HEADER_MAGIC_SIZE, 2, 0) in dec_stream_header()
393 != get_le32(s->temp.buf + HEADER_MAGIC_SIZE + 2)) in dec_stream_header()
396 if (s->temp.buf[HEADER_MAGIC_SIZE] != 0) in dec_stream_header()
405 s->check_type = s->temp.buf[HEADER_MAGIC_SIZE + 1]; in dec_stream_header()
424 if (!memeq(s->temp.buf + 10, FOOTER_MAGIC, FOOTER_MAGIC_SIZE)) in dec_stream_footer()
427 if (xz_crc32(s->temp.buf + 4, 6, 0) != get_le32(s->temp.buf)) in dec_stream_footer()
435 if ((s->index.size >> 2) != get_le32(s->temp.buf + 4)) in dec_stream_footer()
[all …]
Dxz_dec_lzma2.c46 uint8_t *buf; member
274 uint8_t buf[3 * LZMA_IN_REQUIRED]; member
289 dict->buf = b->out + b->out_pos; in dict_reset()
327 return dict->full > 0 ? dict->buf[offset] : 0; in dict_get()
335 dict->buf[dict->pos++] = byte; in dict_put()
362 dict->buf[dict->pos++] = dict->buf[back++]; in dict_repeat()
390 memcpy(dict->buf + dict->pos, b->in + b->in_pos, copy_size); in dict_uncompressed()
424 memcpy(b->out + b->out_pos, dict->buf + dict->start, in dict_flush()
859 memcpy(s->temp.buf + s->temp.size, b->in + b->in_pos, tmp); in lzma2_lzma()
862 memzero(s->temp.buf + s->temp.size + tmp, in lzma2_lzma()
[all …]
/lib/mpi/
Dmpicoder.c143 int mpi_read_buffer(MPI a, uint8_t *buf, unsigned buf_len, unsigned *nbytes, in mpi_read_buffer() argument
157 if (!buf || !nbytes) in mpi_read_buffer()
170 p = buf; in mpi_read_buffer()
205 uint8_t *buf; in mpi_get_buffer() local
217 buf = kmalloc(n, GFP_KERNEL); in mpi_get_buffer()
219 if (!buf) in mpi_get_buffer()
222 ret = mpi_read_buffer(a, buf, n, nbytes, sign); in mpi_get_buffer()
225 kfree(buf); in mpi_get_buffer()
228 return buf; in mpi_get_buffer()
/lib/math/
Dprime_numbers.c247 char *buf; in dump_primes() local
249 buf = kmalloc(PAGE_SIZE, GFP_KERNEL); in dump_primes()
254 if (buf) in dump_primes()
255 bitmap_print_to_pagebuf(true, buf, p->primes, p->sz); in dump_primes()
257 p->last, p->sz, p->primes[BITS_TO_LONGS(p->sz) - 1], buf); in dump_primes()
261 kfree(buf); in dump_primes()

12