Home
last modified time | relevance | path

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

1234

/lib/
Dfortify_kunit.c394 char buf[32]; member
403 int i, end = sizeof(pad.buf) - 1; in fortify_test_strlen()
406 for (i = 0; i < sizeof(pad.buf) - 1; i++) in fortify_test_strlen()
407 pad.buf[i] = i + '0'; in fortify_test_strlen()
409 KUNIT_EXPECT_EQ(test, pad.buf[end], '\0'); in fortify_test_strlen()
413 KUNIT_EXPECT_EQ(test, strlen(pad.buf), end); in fortify_test_strlen()
417 pad.buf[end] = 'A'; in fortify_test_strlen()
418 end = sizeof(pad.buf); in fortify_test_strlen()
419 KUNIT_EXPECT_EQ(test, strlen(pad.buf), end); in fortify_test_strlen()
426 int i, end = sizeof(pad.buf) - 1; in fortify_test_strnlen()
[all …]
Dvsprintf.c222 char *put_dec_trunc8(char *buf, unsigned r) in put_dec_trunc8() argument
232 *((u16 *)buf) = decpair[r - 100*q]; in put_dec_trunc8()
233 buf += 2; in put_dec_trunc8()
241 *((u16 *)buf) = decpair[q - 100*r]; in put_dec_trunc8()
242 buf += 2; in put_dec_trunc8()
250 *((u16 *)buf) = decpair[r - 100*q]; in put_dec_trunc8()
251 buf += 2; in put_dec_trunc8()
257 *((u16 *)buf) = decpair[r]; in put_dec_trunc8()
258 buf += r < 10 ? 1 : 2; in put_dec_trunc8()
259 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 …]
Dbitmap-str.c28 char *buf; in bitmap_parse_user() local
31 buf = memdup_user_nul(ubuf, ulen); in bitmap_parse_user()
32 if (IS_ERR(buf)) in bitmap_parse_user()
33 return PTR_ERR(buf); in bitmap_parse_user()
35 ret = bitmap_parse(buf, UINT_MAX, maskp, nmaskbits); in bitmap_parse_user()
37 kfree(buf); in bitmap_parse_user()
58 int bitmap_print_to_pagebuf(bool list, char *buf, const unsigned long *maskp, in bitmap_print_to_pagebuf() argument
61 ptrdiff_t len = PAGE_SIZE - offset_in_page(buf); in bitmap_print_to_pagebuf()
63 return list ? scnprintf(buf, len, "%*pbl\n", nmaskbits, maskp) : in bitmap_print_to_pagebuf()
64 scnprintf(buf, len, "%*pb\n", nmaskbits, maskp); in bitmap_print_to_pagebuf()
[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 …]
Dkobject_uevent.c61 static int kobject_action_type(const char *buf, size_t count, in kobject_action_type() argument
70 if (count && (buf[count-1] == '\n' || buf[count-1] == '\0')) in kobject_action_type()
76 args_start = strnchr(buf, count, ' '); in kobject_action_type()
78 count_first = args_start - buf; in kobject_action_type()
84 if (strncmp(kobject_actions[action], buf, count_first) != 0) in kobject_action_type()
98 static const char *action_arg_word_end(const char *buf, const char *buf_end, in action_arg_word_end() argument
101 const char *next = buf; in action_arg_word_end()
107 if (next == buf) in action_arg_word_end()
113 static int kobject_action_args(const char *buf, size_t count, in kobject_action_args() argument
121 if (count && (buf[count - 1] == '\n' || buf[count - 1] == '\0')) in kobject_action_args()
[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.c454 char *buf) in config_show() argument
462 len += snprintf(buf, PAGE_SIZE, in config_show()
466 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
470 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
476 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
480 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
484 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
488 len += snprintf(buf+len, PAGE_SIZE - len, in config_show()
559 const char *buf, size_t count) in trigger_config_store() argument
647 const char *buf, size_t count) in config_test_driver_store() argument
[all …]
Dparser.c141 char buf[NUMBER_BUF_LEN]; in match_number() local
145 if (match_strlcpy(buf, s, NUMBER_BUF_LEN) >= NUMBER_BUF_LEN) in match_number()
148 val = simple_strtol(buf, &endp, base); in match_number()
149 if (endp == buf) in match_number()
172 char buf[NUMBER_BUF_LEN]; in match_u64int() local
176 if (match_strlcpy(buf, s, NUMBER_BUF_LEN) >= NUMBER_BUF_LEN) in match_u64int()
178 ret = kstrtoull(buf, base, &val); in match_u64int()
212 char buf[NUMBER_BUF_LEN]; in match_uint() local
214 if (match_strlcpy(buf, s, NUMBER_BUF_LEN) >= NUMBER_BUF_LEN) in match_uint()
217 return kstrtouint(buf, 10, result); in match_uint()
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 …]
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()
Dbuildid.c15 void *buf; member
33 static void freader_init_from_file(struct freader *r, void *buf, u32 buf_sz, in freader_init_from_file() argument
37 r->buf = buf; in freader_init_from_file()
100 if (WARN_ON(r->buf && sz > r->buf_sz)) { in freader_fetch()
111 if (!r->buf) { in freader_fetch()
133 memcpy(r->buf, r->addr + (file_off - r->folio_off), part_sz); in freader_fetch()
141 memcpy(r->buf + part_sz, r->addr, sz - part_sz); in freader_fetch()
143 return r->buf; in freader_fetch()
152 if (!r->buf) in freader_cleanup()
295 char buf[MAX_FREADER_BUF_SZ]; in __build_id_parse() local
[all …]
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.c101 struct flagsbuf { char buf[ARRAY_SIZE(opt_array)+1]; }; member
106 char *p = fb->buf; in ddebug_describe_flags()
112 if (p == fb->buf) in ddebug_describe_flags()
116 return fb->buf; in ddebug_describe_flags()
279 static int ddebug_tokenize(char *buf, char *words[], int maxwords) in ddebug_tokenize() argument
283 while (*buf) { in ddebug_tokenize()
287 buf = skip_spaces(buf); in ddebug_tokenize()
288 if (!*buf) in ddebug_tokenize()
290 if (*buf == '#') in ddebug_tokenize()
294 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); \
Dbitmap.c457 static int bitmap_pos_to_ord(const unsigned long *buf, unsigned int pos, unsigned int nbits) in bitmap_pos_to_ord() argument
459 if (pos >= nbits || !test_bit(pos, buf)) in bitmap_pos_to_ord()
462 return bitmap_weight(buf, pos); in bitmap_pos_to_ord()
788 void bitmap_from_arr32(unsigned long *bitmap, const u32 *buf, unsigned int nbits) in bitmap_from_arr32() argument
794 bitmap[i/2] = (unsigned long) buf[i]; in bitmap_from_arr32()
796 bitmap[i/2] |= ((unsigned long) buf[i]) << 32; in bitmap_from_arr32()
811 void bitmap_to_arr32(u32 *buf, const unsigned long *bitmap, unsigned int nbits) in bitmap_to_arr32() argument
817 buf[i] = (u32) (bitmap[i/2] & UINT_MAX); in bitmap_to_arr32()
819 buf[i] = (u32) (bitmap[i/2] >> 32); in bitmap_to_arr32()
824 buf[halfwords - 1] &= (u32) (UINT_MAX >> ((-nbits) & 31)); in bitmap_to_arr32()
[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()
/lib/xz/
Dxz_dec_bcj.c75 uint8_t buf[16]; member
89 static size_t bcj_x86(struct xz_dec_bcj *s, uint8_t *buf, size_t size) in bcj_x86() argument
109 if ((buf[i] & 0xFE) != 0xE8) in bcj_x86()
118 b = buf[i + 4 - mask_to_bit_num[prev_mask]]; in bcj_x86()
130 if (bcj_x86_test_msbyte(buf[i + 4])) { in bcj_x86()
131 src = get_unaligned_le32(buf + i + 1); in bcj_x86()
147 put_unaligned_le32(dest, buf + i + 1); in bcj_x86()
161 static size_t bcj_powerpc(struct xz_dec_bcj *s, uint8_t *buf, size_t size) in bcj_powerpc() argument
169 instr = get_unaligned_be32(buf + i); in bcj_powerpc()
175 put_unaligned_be32(instr, buf + i); in bcj_powerpc()
[all …]
Dxz_dec_stream.c127 uint8_t buf[1024]; member
161 memcpy(s->temp.buf + s->temp.pos, b->in + b->in_pos, copy_size); in fill_temp()
388 if (!memeq(s->temp.buf, HEADER_MAGIC, HEADER_MAGIC_SIZE)) in dec_stream_header()
391 if (xz_crc32(s->temp.buf + HEADER_MAGIC_SIZE, 2, 0) in dec_stream_header()
392 != get_le32(s->temp.buf + HEADER_MAGIC_SIZE + 2)) in dec_stream_header()
395 if (s->temp.buf[HEADER_MAGIC_SIZE] != 0) in dec_stream_header()
404 if (s->temp.buf[HEADER_MAGIC_SIZE + 1] > XZ_CHECK_MAX) in dec_stream_header()
407 s->check_type = s->temp.buf[HEADER_MAGIC_SIZE + 1]; in dec_stream_header()
423 if (!memeq(s->temp.buf + 10, FOOTER_MAGIC, FOOTER_MAGIC_SIZE)) in dec_stream_footer()
426 if (xz_crc32(s->temp.buf + 4, 6, 0) != get_le32(s->temp.buf)) in dec_stream_footer()
[all …]
/lib/crypto/
Daesgcm.c93 u8 buf[AES_BLOCK_SIZE]; in aesgcm_mac() local
101 aesgcm_encrypt_block(&ctx->aes_ctx, buf, ctr); in aesgcm_mac()
102 crypto_xor_cpy(authtag, buf, (u8 *)&ghash, ctx->authsize); in aesgcm_mac()
105 memzero_explicit(buf, sizeof(buf)); in aesgcm_mac()
111 u8 buf[AES_BLOCK_SIZE]; in aesgcm_crypt() local
123 aesgcm_encrypt_block(&ctx->aes_ctx, buf, ctr); in aesgcm_crypt()
124 crypto_xor_cpy(dst, src, buf, min(len, AES_BLOCK_SIZE)); in aesgcm_crypt()
130 memzero_explicit(buf, sizeof(buf)); in aesgcm_crypt()
700 u8 buf[sizeof(ptext12)]; in libaesgcm_init() local
708 if (!aesgcm_decrypt(&ctx, buf, aesgcm_tv[i].ctext, plen, in libaesgcm_init()
[all …]
Daescfb.c219 u8 buf[64]; in libaescfb_init() local
226 aescfb_encrypt(&ctx, buf, aescfb_tv[i].ptext, aescfb_tv[i].len, in libaescfb_init()
228 if (memcmp(buf, aescfb_tv[i].ctext, aescfb_tv[i].len)) { in libaescfb_init()
234 aescfb_decrypt(&ctx, buf, buf, aescfb_tv[i].len, aescfb_tv[i].iv); in libaescfb_init()
235 if (memcmp(buf, aescfb_tv[i].ptext, aescfb_tv[i].len)) { in libaescfb_init()
241 aescfb_encrypt(&ctx, buf, buf, aescfb_tv[i].len, aescfb_tv[i].iv); in libaescfb_init()
242 if (memcmp(buf, aescfb_tv[i].ctext, aescfb_tv[i].len)) { in libaescfb_init()
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()
Dcurve25519-hacl64.c298 u64 buf[20] = { 0 }; in crecip_crecip() local
299 u64 *a0 = buf; in crecip_crecip()
300 u64 *t00 = buf + 5; in crecip_crecip()
301 u64 *b0 = buf + 10; in crecip_crecip()
316 t01 = buf + 5; in crecip_crecip()
317 b1 = buf + 10; in crecip_crecip()
318 c0 = buf + 15; in crecip_crecip()
327 a = buf; in crecip_crecip()
328 t0 = buf + 5; in crecip_crecip()
329 b = buf + 10; in crecip_crecip()
[all …]
Dblake2s-selftest.c551 u8 buf[ARRAY_SIZE(blake2s_testvecs)]; in blake2s_digest_test() local
561 for (i = 0; i < sizeof(buf); ++i) in blake2s_digest_test()
562 buf[i] = (u8)i; in blake2s_digest_test()
568 blake2s(hash, buf, key + BLAKE2S_KEY_SIZE - keylen, outlen, i, in blake2s_digest_test()
582 blake2s_update(&state, buf, l); in blake2s_digest_test()
583 blake2s_update(&state, buf + l, i - l); in blake2s_digest_test()

1234