Home
last modified time | relevance | path

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

1234

/lib/
Dvsprintf.c219 char *put_dec_trunc8(char *buf, unsigned r) in put_dec_trunc8() argument
229 *((u16 *)buf) = decpair[r - 100*q]; in put_dec_trunc8()
230 buf += 2; in put_dec_trunc8()
238 *((u16 *)buf) = decpair[q - 100*r]; in put_dec_trunc8()
239 buf += 2; in put_dec_trunc8()
247 *((u16 *)buf) = decpair[r - 100*q]; in put_dec_trunc8()
248 buf += 2; in put_dec_trunc8()
254 *((u16 *)buf) = decpair[r]; in put_dec_trunc8()
255 buf += r < 10 ? 1 : 2; in put_dec_trunc8()
256 return buf; in put_dec_trunc8()
[all …]
Dtest_meminit.c66 void *buf; in do_alloc_pages_order() local
72 buf = page_address(page); in do_alloc_pages_order()
73 fill_with_garbage(buf, size); in do_alloc_pages_order()
79 buf = page_address(page); in do_alloc_pages_order()
80 if (count_nonzero_bytes(buf, size)) in do_alloc_pages_order()
82 fill_with_garbage(buf, size); in do_alloc_pages_order()
107 void *buf; in do_kmalloc_size() local
109 buf = kmalloc(size, GFP_KERNEL); in do_kmalloc_size()
110 if (!buf) in do_kmalloc_size()
112 fill_with_garbage(buf, size); in do_kmalloc_size()
[all …]
Dtest_firmware.c130 char *buf; member
150 static ssize_t test_fw_misc_read(struct file *f, char __user *buf, in test_fw_misc_read() argument
157 rc = simple_read_from_buffer(buf, size, offset, in test_fw_misc_read()
251 const char *buf, size_t count) in reset_store() argument
279 char *buf) in config_show() argument
285 len += scnprintf(buf, PAGE_SIZE - len, in config_show()
290 len += scnprintf(buf + len, PAGE_SIZE - len, in config_show()
294 len += scnprintf(buf + len, PAGE_SIZE - len, in config_show()
297 len += scnprintf(buf + len, PAGE_SIZE - len, in config_show()
300 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 …]
Dparser.c132 char *buf; in match_number() local
136 buf = match_strdup(s); in match_number()
137 if (!buf) in match_number()
141 val = simple_strtol(buf, &endp, base); in match_number()
142 if (endp == buf) in match_number()
148 kfree(buf); in match_number()
166 char *buf; in match_u64int() local
170 buf = match_strdup(s); in match_u64int()
171 if (!buf) in match_u64int()
174 ret = kstrtoull(buf, base, &val); in match_u64int()
[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.c461 char *buf; in bitmap_parse_user() local
464 buf = memdup_user_nul(ubuf, ulen); in bitmap_parse_user()
465 if (IS_ERR(buf)) in bitmap_parse_user()
466 return PTR_ERR(buf); in bitmap_parse_user()
468 ret = bitmap_parse(buf, UINT_MAX, maskp, nmaskbits); in bitmap_parse_user()
470 kfree(buf); in bitmap_parse_user()
491 int bitmap_print_to_pagebuf(bool list, char *buf, const unsigned long *maskp, in bitmap_print_to_pagebuf() argument
494 ptrdiff_t len = PAGE_SIZE - offset_in_page(buf); in bitmap_print_to_pagebuf()
496 return list ? scnprintf(buf, len, "%*pbl\n", nmaskbits, maskp) : in bitmap_print_to_pagebuf()
497 scnprintf(buf, len, "%*pb\n", nmaskbits, maskp); in bitmap_print_to_pagebuf()
[all …]
Dtest_hash.c46 static void fill_buf(char *buf, size_t len, u32 seed) in fill_buf() argument
52 buf[i] = mod255(seed); in fill_buf()
146 char buf[SIZE+1]; in test_string_or() local
150 fill_buf(buf, SIZE, 1); in test_string_or()
154 buf[j] = '\0'; in test_string_or()
157 u32 h0 = full_name_hash(buf+i, buf+i, j-i); in test_string_or()
171 char buf[SIZE+1]; in test_hash_or() local
176 fill_buf(buf, SIZE, 1); in test_hash_or()
180 buf[j] = '\0'; in test_hash_or()
183 u64 hashlen = hashlen_string(buf+i, buf+i); in test_hash_or()
[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 …]
Dtest_printf.c237 char buf[PLAIN_BUF_SIZE]; in plain_format() local
240 nchars = snprintf(buf, PLAIN_BUF_SIZE, "%p", PTR); in plain_format()
245 if (strncmp(buf, PTR_VAL_NO_CRNG, PTR_WIDTH) == 0) { in plain_format()
251 if (strncmp(buf, ZEROS, strlen(ZEROS)) != 0) in plain_format()
276 plain_hash_to_buffer(const void *p, char *buf, size_t len) in plain_hash_to_buffer() argument
280 nchars = snprintf(buf, len, "%p", p); in plain_hash_to_buffer()
285 if (strncmp(buf, PTR_VAL_NO_CRNG, PTR_WIDTH) == 0) { in plain_hash_to_buffer()
297 char buf[PLAIN_BUF_SIZE]; in plain_hash() local
300 ret = plain_hash_to_buffer(PTR, buf, PLAIN_BUF_SIZE); in plain_hash()
304 if (strncmp(buf, PTR_STR, PTR_WIDTH) == 0) in plain_hash()
[all …]
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()
Ddynamic_debug.c100 struct flagsbuf { char buf[ARRAY_SIZE(opt_array)+1]; }; member
105 char *p = fb->buf; in ddebug_describe_flags()
111 if (p == fb->buf) in ddebug_describe_flags()
115 return fb->buf; in ddebug_describe_flags()
278 static int ddebug_tokenize(char *buf, char *words[], int maxwords) in ddebug_tokenize() argument
282 while (*buf) { in ddebug_tokenize()
286 buf = skip_spaces(buf); in ddebug_tokenize()
287 if (!*buf) in ddebug_tokenize()
289 if (*buf == '#') in ddebug_tokenize()
293 if (*buf == '"' || *buf == '\'') { in ddebug_tokenize()
[all …]
Dkstrtox.c398 char buf[4]; in kstrtobool_from_user() local
400 count = min(count, sizeof(buf) - 1); in kstrtobool_from_user()
401 if (copy_from_user(buf, s, count)) in kstrtobool_from_user()
403 buf[count] = '\0'; in kstrtobool_from_user()
404 return kstrtobool(buf, res); in kstrtobool_from_user()
412 char buf[1 + sizeof(type) * 8 + 1 + 1]; \
414 count = min(count, sizeof(buf) - 1); \
415 if (copy_from_user(buf, s, count)) \
417 buf[count] = '\0'; \
418 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.c127 int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize, in hex_dump_to_buffer() argument
130 const u8 *ptr = buf; in hex_dump_to_buffer()
157 const u64 *ptr8 = buf; in hex_dump_to_buffer()
168 const u32 *ptr4 = buf; in hex_dump_to_buffer()
179 const u16 *ptr2 = buf; in hex_dump_to_buffer()
263 const void *buf, size_t len, bool ascii) in print_hex_dump() argument
265 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()
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/
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()
Dblake2s.c31 memcpy(state->buf + state->buflen, in, fill); in blake2s_update()
32 blake2s_compress(state, state->buf, 1, BLAKE2S_BLOCK_SIZE); in blake2s_update()
43 memcpy(state->buf + state->buflen, in, inlen); in blake2s_update()
52 memset(state->buf + state->buflen, 0, in blake2s_final()
54 blake2s_compress(state, state->buf, 1, state->buflen); in blake2s_final()
Dblake2s-selftest.c551 u8 buf[ARRAY_SIZE(blake2s_testvecs)]; in blake2s_selftest() local
561 for (i = 0; i < sizeof(buf); ++i) in blake2s_selftest()
562 buf[i] = (u8)i; in blake2s_selftest()
568 blake2s(hash, buf, key + BLAKE2S_KEY_SIZE - keylen, outlen, i, in blake2s_selftest()
582 blake2s_update(&state, buf, l); in blake2s_selftest()
583 blake2s_update(&state, buf + l, i - l); in blake2s_selftest()
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 …]
Dsha1.c130 void sha1_init(__u32 *buf) in sha1_init() argument
132 buf[0] = 0x67452301; in sha1_init()
133 buf[1] = 0xefcdab89; in sha1_init()
134 buf[2] = 0x98badcfe; in sha1_init()
135 buf[3] = 0x10325476; in sha1_init()
136 buf[4] = 0xc3d2e1f0; in sha1_init()

1234