Home
last modified time | relevance | path

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

123

/lib/
Dvsprintf.c218 char *put_dec_trunc8(char *buf, unsigned r) in put_dec_trunc8() argument
228 *((u16 *)buf) = decpair[r - 100*q]; in put_dec_trunc8()
229 buf += 2; in put_dec_trunc8()
237 *((u16 *)buf) = decpair[q - 100*r]; in put_dec_trunc8()
238 buf += 2; in put_dec_trunc8()
246 *((u16 *)buf) = decpair[r - 100*q]; in put_dec_trunc8()
247 buf += 2; in put_dec_trunc8()
253 *((u16 *)buf) = decpair[r]; in put_dec_trunc8()
254 buf += r < 10 ? 1 : 2; in put_dec_trunc8()
255 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_firmware.c119 static ssize_t test_fw_misc_read(struct file *f, char __user *buf, in test_fw_misc_read() argument
126 rc = simple_read_from_buffer(buf, size, offset, in test_fw_misc_read()
219 const char *buf, size_t count) in reset_store() argument
247 char *buf) in config_show() argument
253 len += scnprintf(buf, PAGE_SIZE - len, in config_show()
258 len += scnprintf(buf + len, PAGE_SIZE - len, in config_show()
262 len += scnprintf(buf + len, PAGE_SIZE - len, in config_show()
265 len += scnprintf(buf + len, PAGE_SIZE - len, in config_show()
268 len += scnprintf(buf + len, PAGE_SIZE - len, in config_show()
273 len += scnprintf(buf + len, PAGE_SIZE - len, in config_show()
[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 …]
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 …]
Dbitmap.c450 char *buf; in bitmap_parse_user() local
453 buf = memdup_user_nul(ubuf, ulen); in bitmap_parse_user()
454 if (IS_ERR(buf)) in bitmap_parse_user()
455 return PTR_ERR(buf); in bitmap_parse_user()
457 ret = bitmap_parse(buf, UINT_MAX, maskp, nmaskbits); in bitmap_parse_user()
459 kfree(buf); in bitmap_parse_user()
480 int bitmap_print_to_pagebuf(bool list, char *buf, const unsigned long *maskp, in bitmap_print_to_pagebuf() argument
483 ptrdiff_t len = PAGE_SIZE - offset_in_page(buf); in bitmap_print_to_pagebuf()
485 return list ? scnprintf(buf, len, "%*pbl\n", nmaskbits, maskp) : in bitmap_print_to_pagebuf()
486 scnprintf(buf, len, "%*pb\n", nmaskbits, maskp); in bitmap_print_to_pagebuf()
[all …]
Dtest_printf.c224 char buf[PLAIN_BUF_SIZE]; in plain_format() local
227 nchars = snprintf(buf, PLAIN_BUF_SIZE, "%p", PTR); in plain_format()
232 if (strncmp(buf, PTR_VAL_NO_CRNG, PTR_WIDTH) == 0) { in plain_format()
238 if (strncmp(buf, ZEROS, strlen(ZEROS)) != 0) in plain_format()
263 plain_hash_to_buffer(const void *p, char *buf, size_t len) in plain_hash_to_buffer() argument
267 nchars = snprintf(buf, len, "%p", p); in plain_hash_to_buffer()
272 if (strncmp(buf, PTR_VAL_NO_CRNG, PTR_WIDTH) == 0) { in plain_hash_to_buffer()
284 char buf[PLAIN_BUF_SIZE]; in plain_hash() local
287 ret = plain_hash_to_buffer(PTR, buf, PLAIN_BUF_SIZE); in plain_hash()
291 if (strncmp(buf, PTR_STR, PTR_WIDTH) == 0) in plain_hash()
[all …]
Dparser.c130 char *buf; in match_number() local
134 buf = match_strdup(s); in match_number()
135 if (!buf) in match_number()
139 val = simple_strtol(buf, &endp, base); in match_number()
140 if (endp == buf) in match_number()
146 kfree(buf); in match_number()
162 char *buf; in match_u64int() local
166 buf = match_strdup(s); in match_u64int()
167 if (!buf) in match_u64int()
170 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 …]
Ddynamic_debug.c95 struct flagsbuf { char buf[ARRAY_SIZE(opt_array)+1]; }; member
100 char *p = fb->buf; in ddebug_describe_flags()
106 if (p == fb->buf) in ddebug_describe_flags()
110 return fb->buf; in ddebug_describe_flags()
237 static int ddebug_tokenize(char *buf, char *words[], int maxwords) in ddebug_tokenize() argument
241 while (*buf) { in ddebug_tokenize()
245 buf = skip_spaces(buf); in ddebug_tokenize()
246 if (!*buf) in ddebug_tokenize()
248 if (*buf == '#') in ddebug_tokenize()
252 if (*buf == '"' || *buf == '\'') { in ddebug_tokenize()
[all …]
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()
Ddecompress_inflate.c42 STATIC int INIT __gunzip(unsigned char *buf, long len, in __gunzip() argument
65 if (buf) in __gunzip()
66 zbuf = buf; in __gunzip()
190 if (!buf) in __gunzip()
200 STATIC int INIT gunzip(unsigned char *buf, long len, in gunzip() argument
207 return __gunzip(buf, len, fill, flush, out_buf, 0, pos, error); in gunzip()
210 STATIC int INIT __decompress(unsigned char *buf, long len, in __decompress() argument
217 return __gunzip(buf, len, fill, flush, out_buf, out_len, pos, error); in __decompress()
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.c381 char buf[4]; in kstrtobool_from_user() local
383 count = min(count, sizeof(buf) - 1); in kstrtobool_from_user()
384 if (copy_from_user(buf, s, count)) in kstrtobool_from_user()
386 buf[count] = '\0'; in kstrtobool_from_user()
387 return kstrtobool(buf, res); in kstrtobool_from_user()
395 char buf[1 + sizeof(type) * 8 + 1 + 1]; \
397 count = min(count, sizeof(buf) - 1); \
398 if (copy_from_user(buf, s, count)) \
400 buf[count] = '\0'; \
401 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 …]
Dhexdump.c135 int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize, in hex_dump_to_buffer() argument
138 const u8 *ptr = buf; in hex_dump_to_buffer()
165 const u64 *ptr8 = buf; in hex_dump_to_buffer()
176 const u32 *ptr4 = buf; in hex_dump_to_buffer()
187 const u16 *ptr2 = buf; in hex_dump_to_buffer()
271 const void *buf, size_t len, bool ascii) in print_hex_dump() argument
273 const u8 *ptr = buf; in print_hex_dump()
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()
Diov_iter.c169 char __user *buf; in copy_page_to_iter_iovec() local
182 buf = iov->iov_base + skip; in copy_page_to_iter_iovec()
185 if (IS_ENABLED(CONFIG_HIGHMEM) && !fault_in_pages_writeable(buf, copy)) { in copy_page_to_iter_iovec()
190 left = copyout(buf, from, copy); in copy_page_to_iter_iovec()
198 buf = iov->iov_base; in copy_page_to_iter_iovec()
200 left = copyout(buf, from, copy); in copy_page_to_iter_iovec()
211 buf += copy; in copy_page_to_iter_iovec()
219 left = copyout(buf, from, copy); in copy_page_to_iter_iovec()
226 buf = iov->iov_base; in copy_page_to_iter_iovec()
228 left = copyout(buf, from, copy); in copy_page_to_iter_iovec()
[all …]
Dsha1.c129 void sha1_init(__u32 *buf) in sha1_init() argument
131 buf[0] = 0x67452301; in sha1_init()
132 buf[1] = 0xefcdab89; in sha1_init()
133 buf[2] = 0x98badcfe; in sha1_init()
134 buf[3] = 0x10325476; in sha1_init()
135 buf[4] = 0xc3d2e1f0; in sha1_init()
Dseq_buf.c272 char *buf; local
273 size_t size = seq_buf_get_buf(s, &buf);
279 char *p = d_path(path, buf, size);
281 char *end = mangle_path(buf, p, esc);
283 res = end - buf;
363 const void *buf, size_t len, bool ascii) argument
365 const u8 *ptr = buf;
/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 if (s->temp.buf[HEADER_MAGIC_SIZE + 1] > XZ_CHECK_MAX) in dec_stream_header()
408 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()
[all …]
/lib/crypto/
Dblake2s-selftest.c549 u8 buf[ARRAY_SIZE(blake2s_testvecs)]; in blake2s_selftest() local
559 for (i = 0; i < sizeof(buf); ++i) in blake2s_selftest()
560 buf[i] = (u8)i; in blake2s_selftest()
566 blake2s(hash, buf, key + BLAKE2S_KEY_SIZE - keylen, outlen, i, in blake2s_selftest()
580 blake2s_update(&state, buf, l); in blake2s_selftest()
581 blake2s_update(&state, buf + l, i - l); in blake2s_selftest()
Dpoly1305.c37 memcpy(desc->buf + desc->buflen, src, bytes); in poly1305_update_generic()
43 poly1305_core_blocks(&desc->h, &desc->core_r, desc->buf, in poly1305_update_generic()
58 memcpy(desc->buf, src, nbytes); in poly1305_update_generic()
66 desc->buf[desc->buflen++] = 1; in poly1305_final_generic()
67 memset(desc->buf + desc->buflen, 0, in poly1305_final_generic()
69 poly1305_core_blocks(&desc->h, &desc->core_r, desc->buf, 1, 0); in poly1305_final_generic()
Dcurve25519-hacl64.c300 u64 buf[20] = { 0 }; in crecip_crecip() local
301 u64 *a0 = buf; in crecip_crecip()
302 u64 *t00 = buf + 5; in crecip_crecip()
303 u64 *b0 = buf + 10; in crecip_crecip()
318 t01 = buf + 5; in crecip_crecip()
319 b1 = buf + 10; in crecip_crecip()
320 c0 = buf + 15; in crecip_crecip()
329 a = buf; in crecip_crecip()
330 t0 = buf + 5; in crecip_crecip()
331 b = buf + 10; in crecip_crecip()
[all …]

123