| /lib/tests/ |
| A D | fortify_kunit.c | 411 char buf[32]; member 488 KUNIT_EXPECT_EQ(test, pad.buf[sizeof(pad.buf) - 1], '\0'); in fortify_test_strcpy() 489 KUNIT_EXPECT_EQ(test, pad.buf[sizeof(pad.buf) - 2], '\0'); in fortify_test_strcpy() 490 KUNIT_EXPECT_EQ(test, pad.buf[sizeof(pad.buf) - 3], '\0'); in fortify_test_strcpy() 670 KUNIT_ASSERT_TRUE(test, strcat(pad.buf, src) == pad.buf); in fortify_test_strcat() 673 KUNIT_ASSERT_TRUE(test, strcat(pad.buf, src) == pad.buf); in fortify_test_strcat() 681 KUNIT_ASSERT_TRUE(test, strcat(pad.buf, one) == pad.buf); in fortify_test_strcat() 768 pad.buf[sizeof(pad.buf) - 1] = 'A'; in fortify_test_strncat() 844 pad.buf[sizeof(pad.buf) - 1] = 'A'; in fortify_test_strlcat() 857 pad.buf[sizeof(pad.buf) - 1] = '\0'; in fortify_test_strlcat() [all …]
|
| A D | test_hash.c | 46 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 …]
|
| A D | seq_buf_kunit.c | 13 char buf[32]; in seq_buf_init_test() local 16 seq_buf_init(&s, buf, sizeof(buf)); in seq_buf_init_test() 154 char *buf; in seq_buf_get_buf_commit_test() local 157 len = seq_buf_get_buf(&s, &buf); in seq_buf_get_buf_commit_test() 159 KUNIT_EXPECT_PTR_NE(test, buf, NULL); in seq_buf_get_buf_commit_test() 161 memcpy(buf, "hello", 5); in seq_buf_get_buf_commit_test() 168 len = seq_buf_get_buf(&s, &buf); in seq_buf_get_buf_commit_test() 170 KUNIT_EXPECT_PTR_NE(test, buf, NULL); in seq_buf_get_buf_commit_test() 172 memcpy(buf, " worlds!", 8); in seq_buf_get_buf_commit_test() 179 len = seq_buf_get_buf(&s, &buf); in seq_buf_get_buf_commit_test() [all …]
|
| /lib/ |
| A D | vsprintf.c | 384 buf = put_dec_trunc8(buf, q); in put_dec() 611 memmove(buf + spaces, buf, len); in move_right() 1053 buf = number(buf, end, start_val, spec); in hex_range() 1273 buf = number(buf, end, val, spec); in bitmap_string() 1711 buf += string_escape_mem(addr, len, buf, buf < end ? end - buf : 0, flags, NULL); in escaped_string() 1728 buf += vsnprintf(buf, end > buf ? end - buf : 0, va_fmt->fmt, va); in va_format() 1960 buf = date_str(buf, end, tm, raw); in rtc_str() 1967 buf = time_str(buf, end, tm, raw); in rtc_str() 2221 buf = string(buf, end, p, str_spec); in device_node_string() 2231 buf = string(buf, end, p, str_spec); in device_node_string() [all …]
|
| A D | test_meminit.c | 66 void *buf; in do_alloc_pages_order() local 107 void *buf; in do_kmalloc_size() local 110 if (!buf) in do_kmalloc_size() 113 kfree(buf); in do_kmalloc_size() 116 if (!buf) in do_kmalloc_size() 121 kfree(buf); in do_kmalloc_size() 131 void *buf; in do_vmalloc_size() local 134 if (!buf) in do_vmalloc_size() 137 vfree(buf); in do_vmalloc_size() 140 if (!buf) in do_vmalloc_size() [all …]
|
| A D | bitmap-str.c | 28 char *buf; in bitmap_parse_user() local 32 if (IS_ERR(buf)) in bitmap_parse_user() 33 return PTR_ERR(buf); in bitmap_parse_user() 37 kfree(buf); in bitmap_parse_user() 382 while (buf) { in bitmap_parselist() 383 buf = bitmap_find_region(buf); in bitmap_parselist() 384 if (buf == NULL) in bitmap_parselist() 387 buf = bitmap_parse_region(buf, &r); in bitmap_parselist() 419 char *buf; in bitmap_parselist_user() local 423 if (IS_ERR(buf)) in bitmap_parselist_user() [all …]
|
| A D | test_firmware.c | 130 char *buf; member 279 char *buf) in config_show() argument 454 char *buf) in config_name_show() argument 510 char *buf) in config_num_requests_show() argument 527 char *buf) in config_into_buf_show() argument 604 char *buf) in config_partial_show() argument 1106 kfree(tst->buf); in upload_release() 1378 char *buf) in test_result_show() argument 1395 char *buf) in read_firmware_show() argument 1440 char *buf) in upload_read_show() argument [all …]
|
| A D | kobject_uevent.c | 70 if (count && (buf[count-1] == '\n' || buf[count-1] == '\0')) in kobject_action_type() 101 const char *next = buf; in action_arg_word_end() 107 if (next == buf) in action_arg_word_end() 121 if (count && (buf[count - 1] == '\n' || buf[count - 1] == '\0')) in kobject_action_args() 140 next = buf + UUID_STRING_LEN; in kobject_action_args() 141 buf_end = buf + count - 1; in kobject_action_args() 152 buf = next; in kobject_action_args() 156 key_len = next - buf; in kobject_action_args() 162 buf = next; in kobject_action_args() 168 key_len, key, (int) (next - buf), buf)) in kobject_action_args() [all …]
|
| A D | test_kmod.c | 460 char *buf) in config_show() argument 468 len += snprintf(buf, PAGE_SIZE, in config_show() 693 char *buf) in config_test_driver_show() argument 724 char *buf) in config_test_fs_show() argument 881 ret = kstrtouint(buf, 10, &val); in test_dev_config_update_uint_sync() 937 ret = kstrtoint(buf, 10, &val); in test_dev_config_update_int() 949 char *buf, in test_dev_config_show_int() argument 962 char *buf, in test_dev_config_show_uint() argument 999 char *buf) in config_num_threads_show() argument 1023 char *buf) in config_test_case_show() argument [all …]
|
| A D | parser.c | 141 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()
|
| A D | decompress_inflate.c | 42 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()
|
| A D | buildid.c | 15 void *buf; member 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 302 freader_init_from_file(&r, buf, sizeof(buf), vma->vm_file, may_fault); in __build_id_parse() [all …]
|
| A D | test_hexdump.c | 165 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()
|
| A D | dynamic_debug.c | 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() 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() 320 buf = end; in ddebug_tokenize() 854 return buf; in __dynamic_emit_prefix() [all …]
|
| A D | kstrtox.c | 402 char buf[4]; in kstrtobool_from_user() local 404 count = min(count, sizeof(buf) - 1); in kstrtobool_from_user() 405 if (copy_from_user(buf, s, count)) in kstrtobool_from_user() 407 buf[count] = '\0'; in kstrtobool_from_user() 408 return kstrtobool(buf, res); in kstrtobool_from_user() 416 char buf[1 + sizeof(type) * 8 + 1 + 1]; \ 418 count = min(count, sizeof(buf) - 1); \ 419 if (copy_from_user(buf, s, count)) \ 421 buf[count] = '\0'; \ 422 return g(buf, base, res); \
|
| A D | packing_test.c | 401 typedef struct __packed { u8 buf[PACKED_BUF_SIZE]; } packed_buf_t; member 432 .buf = { 0x50, 0x0F, 0x00, 0x05, 0x01, 0xF4, 0xD3, 0x0B }, in packing_test_pack_fields() 434 packed_buf_t buf = {}; in packing_test_pack_fields() local 436 pack_fields(&buf, sizeof(buf), &data, test_fields, 0); in packing_test_pack_fields() 438 KUNIT_EXPECT_MEMEQ(test, &expect, &buf, sizeof(buf)); in packing_test_pack_fields() 443 const packed_buf_t buf = { in packing_test_unpack_fields() local 444 .buf = { 0x17, 0x28, 0x10, 0x19, 0x3D, 0xA9, 0x07, 0x9C }, in packing_test_unpack_fields() 448 unpack_fields(&buf, sizeof(buf), &data, test_fields, 0); in packing_test_unpack_fields()
|
| /lib/xz/ |
| A D | xz_dec_bcj.c | 75 uint8_t buf[16]; member 259 buf[i + j + byte_pos] in bcj_ia64() 279 addr = (uint32_t)buf[i] | ((uint32_t)buf[i + 1] << 8) in bcj_arm() 284 buf[i] = (uint8_t)addr; in bcj_arm() 410 instr = buf[i]; in bcj_riscv() 414 b1 = buf[i + 1]; in bcj_riscv() 418 b2 = buf[i + 2]; in bcj_riscv() 419 b3 = buf[i + 3]; in bcj_riscv() 498 buf += *pos; in bcj_apply() 567 memmove(s->temp.buf, s->temp.buf + copy_size, s->temp.size); in bcj_flush() [all …]
|
| A D | xz_dec_stream.c | 127 uint8_t buf[1024]; member 395 if (s->temp.buf[HEADER_MAGIC_SIZE] != 0) in dec_stream_header() 426 if (xz_crc32(s->temp.buf + 4, 6, 0) != get_le32(s->temp.buf)) in dec_stream_footer() 437 if (s->temp.buf[8] != 0 || s->temp.buf[9] != s->check_type) in dec_stream_footer() 468 if (s->temp.buf[1] & 0x3E) in dec_block_header() 470 if (s->temp.buf[1] & 0x3F) in dec_block_header() 475 if (s->temp.buf[1] & 0x40) { in dec_block_header() 486 if (s->temp.buf[1] & 0x80) { in dec_block_header() 498 s->bcj_active = s->temp.buf[1] & 0x01; in dec_block_header() 521 if (s->temp.buf[s->temp.pos++] != 0x21) in dec_block_header() [all …]
|
| /lib/crc/s390/ |
| A D | crc32le-vx.c | 92 static u32 crc32_le_vgfm_generic(u32 crc, unsigned char const *buf, size_t size, unsigned long *con… in crc32_le_vgfm_generic() argument 108 fpu_vlm(1, 4, buf); in crc32_le_vgfm_generic() 115 buf += 64; in crc32_le_vgfm_generic() 119 fpu_vlm(5, 8, buf); in crc32_le_vgfm_generic() 135 buf += 64; in crc32_le_vgfm_generic() 149 fpu_vl(2, buf); in crc32_le_vgfm_generic() 152 buf += 16; in crc32_le_vgfm_generic() 232 u32 crc32_le_vgfm_16(u32 crc, unsigned char const *buf, size_t size) in crc32_le_vgfm_16() argument 234 return crc32_le_vgfm_generic(crc, buf, size, &constants_CRC_32_LE[0]); in crc32_le_vgfm_16() 237 u32 crc32c_le_vgfm_16(u32 crc, unsigned char const *buf, size_t size) in crc32c_le_vgfm_16() argument [all …]
|
| A D | crc32be-vx.c | 80 u32 crc32_be_vgfm_16(u32 crc, unsigned char const *buf, size_t size) in crc32_be_vgfm_16() argument 90 fpu_vlm(1, 4, buf); in crc32_be_vgfm_16() 92 buf += 64; in crc32_be_vgfm_16() 97 fpu_vlm(5, 8, buf); in crc32_be_vgfm_16() 110 buf += 64; in crc32_be_vgfm_16() 120 fpu_vl(2, buf); in crc32_be_vgfm_16() 122 buf += 16; in crc32_be_vgfm_16()
|
| /lib/crypto/ |
| A D | aesgcm.c | 92 u8 buf[AES_BLOCK_SIZE]; in aesgcm_mac() local 100 aesgcm_encrypt_block(&ctx->aes_ctx, buf, ctr); in aesgcm_mac() 104 memzero_explicit(buf, sizeof(buf)); in aesgcm_mac() 110 u8 buf[AES_BLOCK_SIZE]; in aesgcm_crypt() local 122 aesgcm_encrypt_block(&ctx->aes_ctx, buf, ctr); in aesgcm_crypt() 129 memzero_explicit(buf, sizeof(buf)); in aesgcm_crypt() 699 static u8 buf[sizeof(ptext12)]; in libaesgcm_init() local 710 || memcmp(buf, aesgcm_tv[i].ptext, plen)) { in libaesgcm_init() 716 aesgcm_encrypt(&ctx, buf, buf, plen, aesgcm_tv[i].assoc, in libaesgcm_init() 718 if (memcmp(buf, aesgcm_tv[i].ctext, plen)) { in libaesgcm_init() [all …]
|
| A D | sha1.c | 133 void sha1_init_raw(__u32 *buf) in sha1_init_raw() argument 135 buf[0] = 0x67452301; in sha1_init_raw() 136 buf[1] = 0xefcdab89; in sha1_init_raw() 137 buf[2] = 0x98badcfe; in sha1_init_raw() 138 buf[3] = 0x10325476; in sha1_init_raw() 139 buf[4] = 0xc3d2e1f0; in sha1_init_raw() 181 memcpy(&ctx->buf[partial], data, l); in sha1_update() 198 memcpy(&ctx->buf[partial], data, len); in sha1_update() 207 ctx->buf[partial++] = 0x80; in __sha1_final() 210 sha1_blocks(&ctx->state, ctx->buf, 1); in __sha1_final() [all …]
|
| A D | aescfb.c | 218 u8 buf[64]; in libaescfb_init() local 225 aescfb_encrypt(&ctx, buf, aescfb_tv[i].ptext, aescfb_tv[i].len, in libaescfb_init() 227 if (memcmp(buf, aescfb_tv[i].ctext, aescfb_tv[i].len)) { in libaescfb_init() 233 aescfb_decrypt(&ctx, buf, buf, aescfb_tv[i].len, aescfb_tv[i].iv); in libaescfb_init() 234 if (memcmp(buf, aescfb_tv[i].ptext, aescfb_tv[i].len)) { in libaescfb_init() 240 aescfb_encrypt(&ctx, buf, buf, aescfb_tv[i].len, aescfb_tv[i].iv); in libaescfb_init() 241 if (memcmp(buf, aescfb_tv[i].ctext, aescfb_tv[i].len)) { in libaescfb_init()
|
| /lib/crc/arm64/ |
| A D | crc-t10dif.h | 20 asmlinkage void crc_t10dif_pmull_p8(u16 init_crc, const u8 *buf, size_t len, 22 asmlinkage u16 crc_t10dif_pmull_p64(u16 init_crc, const u8 *buf, size_t len); 37 u8 buf[16]; in crc_t10dif_arch() local 40 crc_t10dif_pmull_p8(crc, data, length, buf); in crc_t10dif_arch() 43 return crc_t10dif_generic(0, buf, sizeof(buf)); in crc_t10dif_arch()
|
| /lib/crc/arm/ |
| A D | crc-t10dif.h | 18 asmlinkage u16 crc_t10dif_pmull64(u16 init_crc, const u8 *buf, size_t len); 19 asmlinkage void crc_t10dif_pmull8(u16 init_crc, const u8 *buf, size_t len, 35 u8 buf[16] __aligned(16); in crc_t10dif_arch() local 38 crc_t10dif_pmull8(crc, data, length, buf); in crc_t10dif_arch() 41 return crc_t10dif_generic(0, buf, sizeof(buf)); in crc_t10dif_arch()
|