Home
last modified time | relevance | path

Searched refs:len (Results 1 – 25 of 99) sorted by relevance

1234

/lib/
Dkfifo.c91 unsigned int len, unsigned int off) in kfifo_copy_in() argument
101 len *= esize; in kfifo_copy_in()
103 l = min(len, size - off); in kfifo_copy_in()
106 memcpy(fifo->data, src + l, len - l); in kfifo_copy_in()
115 const void *buf, unsigned int len) in __kfifo_in() argument
120 if (len > l) in __kfifo_in()
121 len = l; in __kfifo_in()
123 kfifo_copy_in(fifo, buf, len, fifo->in); in __kfifo_in()
124 fifo->in += len; in __kfifo_in()
125 return len; in __kfifo_in()
[all …]
Dseq_buf.c38 static bool seq_buf_can_fit(struct seq_buf *s, size_t len) in seq_buf_can_fit() argument
40 return s->len + len <= s->size; in seq_buf_can_fit()
52 unsigned int len = seq_buf_used(s); in seq_buf_print_seq() local
54 return seq_write(m, s->buffer, len); in seq_buf_print_seq()
69 int len; in seq_buf_vprintf() local
73 if (s->len < s->size) { in seq_buf_vprintf()
74 len = vsnprintf(s->buffer + s->len, s->size - s->len, fmt, args); in seq_buf_vprintf()
75 if (s->len + len < s->size) { in seq_buf_vprintf()
76 s->len += len; in seq_buf_vprintf()
119 if (s->size == 0 || s->len == 0) in seq_buf_do_printk()
[all …]
Dcrc32.c58 crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 (*tab)[256]) argument
85 if (unlikely((long)buf & 3 && len)) {
88 } while ((--len) && ((long)buf)&3);
92 rem_len = len & 3;
93 len = len >> 2;
95 rem_len = len & 7;
96 len = len >> 3;
102 for (i = 0; i < len; i++) {
104 for (--b; len; --len) {
115 len = rem_len;
[all …]
Dchecksum_kunit.c451 #define full_csum(buff, len, sum) csum_fold(csum_partial(buff, len, sum)) argument
481 int len, align; in test_csum_fixed_random_inputs() local
489 for (len = 0; len < MAX_LEN && (align + len) < TEST_BUFLEN; in test_csum_fixed_random_inputs()
490 ++len) { in test_csum_fixed_random_inputs()
495 result = full_csum(&tmp_buf[align], len, sum); in test_csum_fixed_random_inputs()
496 expec = to_sum16(expected_results[len]); in test_csum_fixed_random_inputs()
507 int len, align; in test_csum_all_carry_inputs() local
514 for (len = 0; len < MAX_LEN && (align + len) < TEST_BUFLEN; in test_csum_all_carry_inputs()
515 ++len) { in test_csum_all_carry_inputs()
520 result = full_csum(&tmp_buf[align], len, sum); in test_csum_all_carry_inputs()
[all …]
Dasn1_encoder.c191 static int asn1_encode_length(unsigned char **data, int *data_len, int len) in asn1_encode_length() argument
196 if (len < 0) { in asn1_encode_length()
202 if (len <= 0x7f) { in asn1_encode_length()
203 *((*data)++) = len; in asn1_encode_length()
211 if (len <= 0xff) { in asn1_encode_length()
213 *((*data)++) = len & 0xff; in asn1_encode_length()
221 if (len <= 0xffff) { in asn1_encode_length()
223 *((*data)++) = (len >> 8) & 0xff; in asn1_encode_length()
224 *((*data)++) = len & 0xff; in asn1_encode_length()
229 if (WARN(len > 0xffffff, "ASN.1 length can't be > 0xffffff")) in asn1_encode_length()
[all …]
Dasn1_decoder.c62 size_t dp = *_dp, len, n; in asn1_find_indefinite_length() local
95 len = data[dp++]; in asn1_find_indefinite_length()
96 if (len <= 0x7f) in asn1_find_indefinite_length()
99 if (unlikely(len == ASN1_INDEFINITE_LENGTH)) { in asn1_find_indefinite_length()
107 n = len - 0x80; in asn1_find_indefinite_length()
108 if (unlikely(n > sizeof(len) - 1)) in asn1_find_indefinite_length()
112 len = 0; in asn1_find_indefinite_length()
114 len <<= 8; in asn1_find_indefinite_length()
115 len |= data[dp++]; in asn1_find_indefinite_length()
118 if (len > datalen - dp) in asn1_find_indefinite_length()
[all …]
Dchecksum.c46 static unsigned int do_csum(const unsigned char *buff, int len) in do_csum() argument
51 if (len <= 0) in do_csum()
60 len--; in do_csum()
63 if (len >= 2) { in do_csum()
66 len -= 2; in do_csum()
69 if (len >= 4) { in do_csum()
70 const unsigned char *end = buff + ((unsigned)len & ~3); in do_csum()
82 if (len & 2) { in do_csum()
87 if (len & 1) in do_csum()
125 __wsum csum_partial(const void *buff, int len, __wsum wsum) in csum_partial() argument
[all …]
Dfind_bit_benchmark.c36 static int __init test_find_first_bit(void *bitmap, unsigned long len) in test_find_first_bit() argument
42 for (cnt = i = 0; i < len; cnt++) { in test_find_first_bit()
43 i = find_first_bit(bitmap, len); in test_find_first_bit()
52 static int __init test_find_first_and_bit(void *bitmap, const void *bitmap2, unsigned long len) in test_find_first_and_bit() argument
61 for (cnt = i = 0; i < len; cnt++) { in test_find_first_and_bit()
62 i = find_first_and_bit(cp, bitmap2, len); in test_find_first_and_bit()
71 static int __init test_find_next_bit(const void *bitmap, unsigned long len) in test_find_next_bit() argument
85 static int __init test_find_next_zero_bit(const void *bitmap, unsigned long len) in test_find_next_zero_bit() argument
92 i = find_next_zero_bit(bitmap, len, i) + 1; in test_find_next_zero_bit()
99 static int __init test_find_last_bit(const void *bitmap, unsigned long len) in test_find_last_bit() argument
[all …]
Dtest_hexdump.c67 static void __init test_hexdump_prepare_test(size_t len, int rowsize, in test_hexdump_prepare_test() argument
73 size_t l = len; in test_hexdump_prepare_test()
84 if (!is_power_of_2(gs) || gs > 8 || (len % gs != 0)) in test_hexdump_prepare_test()
125 static void __init test_hexdump(size_t len, int rowsize, int groupsize, in test_hexdump() argument
134 hex_dump_to_buffer(data_b, len, rowsize, groupsize, real, sizeof(real), in test_hexdump()
138 test_hexdump_prepare_test(len, rowsize, groupsize, test, sizeof(test), in test_hexdump()
142 pr_err("Len: %zu row: %d group: %d\n", len, rowsize, groupsize); in test_hexdump()
152 size_t len = get_random_u32_inclusive(1, d); in test_hexdump_set() local
154 test_hexdump(len, rowsize, 4, ascii); in test_hexdump_set()
155 test_hexdump(len, rowsize, 2, ascii); in test_hexdump_set()
[all …]
Dsiphash.c22 #define PREAMBLE(len) \ argument
27 u64 b = ((u64)(len)) << 56; \
46 u64 __siphash_aligned(const void *data, size_t len, const siphash_key_t *key) in __siphash_aligned() argument
48 const u8 *end = data + len - (len % sizeof(u64)); in __siphash_aligned()
49 const u8 left = len & (sizeof(u64) - 1); in __siphash_aligned()
51 PREAMBLE(len) in __siphash_aligned()
79 u64 __siphash_unaligned(const void *data, size_t len, const siphash_key_t *key) in __siphash_unaligned() argument
81 const u8 *end = data + len - (len % sizeof(u64)); in __siphash_unaligned()
82 const u8 left = len & (sizeof(u64) - 1); in __siphash_unaligned()
84 PREAMBLE(len) in __siphash_unaligned()
[all …]
Diov_iter.c18 size_t len, void *from, void *priv2) in copy_to_user_iter() argument
21 return len; in copy_to_user_iter()
22 if (access_ok(iter_to, len)) { in copy_to_user_iter()
24 instrument_copy_to_user(iter_to, from, len); in copy_to_user_iter()
25 len = raw_copy_to_user(iter_to, from, len); in copy_to_user_iter()
27 return len; in copy_to_user_iter()
32 size_t len, void *from, void *priv2) in copy_to_user_iter_nofault() argument
37 return len; in copy_to_user_iter_nofault()
40 res = copy_to_user_nofault(iter_to, from, len); in copy_to_user_iter_nofault()
41 return res < 0 ? len : res; in copy_to_user_iter_nofault()
[all …]
Ddecompress_inflate.c36 static long INIT nofill(void *buffer, unsigned long len) in nofill() argument
42 static int INIT __gunzip(unsigned char *buf, long len, in __gunzip() argument
69 len = 0; in __gunzip()
97 if (len == 0) in __gunzip()
98 len = fill(zbuf, GZIP_IOBUF_SIZE); in __gunzip()
101 if (len < 10 || in __gunzip()
113 strm->avail_in = len - 10; in __gunzip()
147 len = fill(zbuf, GZIP_IOBUF_SIZE); in __gunzip()
148 if (len < 0) { in __gunzip()
154 strm->avail_in = len; in __gunzip()
[all …]
Dnlattr.c60 static int __nla_validate_parse(const struct nlattr *head, int len, int maxtype,
89 static int nla_validate_array(const struct nlattr *head, int len, int maxtype, in nla_validate_array() argument
97 nla_for_each_attr(entry, head, len, rem) { in nla_validate_array()
472 if (pt->len) in validate_nla()
473 minlen = min_t(int, attrlen, pt->len + 1); in validate_nla()
487 if (pt->len) { in validate_nla()
493 if (attrlen > pt->len) in validate_nla()
499 if (pt->len && attrlen > pt->len) in validate_nla()
513 pt->len, pt->nested_policy, in validate_nla()
537 pt->len, pt->nested_policy, in validate_nla()
[all …]
Dhexdump.c127 int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize, in hex_dump_to_buffer() argument
140 if (len > rowsize) /* limit to one line at a time */ in hex_dump_to_buffer()
141 len = rowsize; in hex_dump_to_buffer()
144 if ((len % groupsize) != 0) /* no mixed size output */ in hex_dump_to_buffer()
147 ngroups = len / groupsize; in hex_dump_to_buffer()
153 if (!len) in hex_dump_to_buffer()
190 for (j = 0; j < len; j++) { in hex_dump_to_buffer()
213 for (j = 0; j < len; j++) { in hex_dump_to_buffer()
225 return ascii ? ascii_column + len : (groupsize * 2 + 1) * ngroups - 1; in hex_dump_to_buffer()
263 const void *buf, size_t len, bool ascii) in print_hex_dump() argument
[all …]
Dscatterlist.c71 int sg_nents_for_len(struct scatterlist *sg, u64 len) in sg_nents_for_len() argument
76 if (!len) in sg_nents_for_len()
82 if (total >= len) in sg_nents_for_len()
981 unsigned int len; in sg_copy_buffer() local
983 len = min(miter.length, buflen - offset); in sg_copy_buffer()
986 memcpy(buf + offset, miter.addr, len); in sg_copy_buffer()
988 memcpy(miter.addr, buf + offset, len); in sg_copy_buffer()
990 offset += len; in sg_copy_buffer()
1091 unsigned int len; in sg_zero_buffer() local
1093 len = min(miter.length, buflen - offset); in sg_zero_buffer()
[all …]
Dcrc64-rocksoft.c57 u64 crc64_rocksoft_update(u64 crc, const unsigned char *buffer, size_t len) in crc64_rocksoft_update() argument
66 return crc64_rocksoft_generic(crc, buffer, len); in crc64_rocksoft_update()
71 err = crypto_shash_update(&desc.shash, buffer, len); in crc64_rocksoft_update()
80 u64 crc64_rocksoft(const unsigned char *buffer, size_t len) in crc64_rocksoft() argument
82 return crc64_rocksoft_update(0, buffer, len); in crc64_rocksoft()
107 int len; in crc64_rocksoft_transform_show() local
114 len = snprintf(buffer, PAGE_SIZE, "%s\n", in crc64_rocksoft_transform_show()
118 return len; in crc64_rocksoft_transform_show()
Dcrc-t10dif.c63 __u16 crc_t10dif_update(__u16 crc, const unsigned char *buffer, size_t len) in crc_t10dif_update() argument
72 return crc_t10dif_generic(crc, buffer, len); in crc_t10dif_update()
77 err = crypto_shash_update(&desc.shash, buffer, len); in crc_t10dif_update()
86 __u16 crc_t10dif(const unsigned char *buffer, size_t len) in crc_t10dif() argument
88 return crc_t10dif_update(0, buffer, len); in crc_t10dif()
113 int len; in crc_t10dif_transform_show() local
120 len = snprintf(buffer, PAGE_SIZE, "%s\n", in crc_t10dif_transform_show()
124 return len; in crc_t10dif_transform_show()
Dtextsearch.c200 unsigned int len; member
210 if (likely(consumed < st->len)) { in get_linear_data()
212 return st->len - consumed; in get_linear_data()
233 const void *data, unsigned int len) in textsearch_find_continuous() argument
239 st->len = len; in textsearch_find_continuous()
264 unsigned int len, gfp_t gfp_mask, int flags) in textsearch_prepare() argument
270 if (len == 0) in textsearch_prepare()
289 conf = ops->init(pattern, len, gfp_mask, flags); in textsearch_prepare()
/lib/zlib_inflate/
Dinftrees.c26 unsigned len; /* a code's length in bits */ in zlib_inflate_table() local
93 for (len = 0; len <= MAXBITS; len++) in zlib_inflate_table()
94 count[len] = 0; in zlib_inflate_table()
118 for (len = 1; len <= MAXBITS; len++) { in zlib_inflate_table()
120 left -= count[len]; in zlib_inflate_table()
128 for (len = 1; len < MAXBITS; len++) in zlib_inflate_table()
129 offs[len + 1] = offs[len] + count[len]; in zlib_inflate_table()
189 len = min; /* starting code length */ in zlib_inflate_table()
204 this.bits = (unsigned char)(len - drop); in zlib_inflate_table()
219 incr = 1U << (len - drop); in zlib_inflate_table()
[all …]
Dinffast.c91 unsigned len; /* match length, unused bytes */ in inflate_fast() local
135 len = (unsigned)(this.val); in inflate_fast()
142 len += (unsigned)hold & ((1U << op) - 1); in inflate_fast()
190 if (op < len) { /* some from window */ in inflate_fast()
191 len -= op; in inflate_fast()
201 if (op < len) { /* some from end of window */ in inflate_fast()
202 len -= op; in inflate_fast()
207 if (write < len) { /* some from start of window */ in inflate_fast()
209 len -= op; in inflate_fast()
219 if (op < len) { /* some from window */ in inflate_fast()
[all …]
/lib/crypto/
Daescfb.c43 int len, const u8 iv[AES_BLOCK_SIZE]) in aescfb_encrypt() argument
48 while (len > 0) { in aescfb_encrypt()
50 crypto_xor_cpy(dst, src, ks, min(len, AES_BLOCK_SIZE)); in aescfb_encrypt()
55 len -= AES_BLOCK_SIZE; in aescfb_encrypt()
72 int len, const u8 iv[AES_BLOCK_SIZE]) in aescfb_decrypt() argument
78 for (int i = 0; len > 0; i ^= 1) { in aescfb_decrypt()
79 if (len > AES_BLOCK_SIZE) in aescfb_decrypt()
87 crypto_xor_cpy(dst, src, ks[i], min(len, AES_BLOCK_SIZE)); in aescfb_decrypt()
91 len -= AES_BLOCK_SIZE; in aescfb_decrypt()
116 int len; member
[all …]
Dutils.c17 void __crypto_xor(u8 *dst, const u8 *src1, const u8 *src2, unsigned int len) in __crypto_xor() argument
35 while (((unsigned long)dst & (relalign - 1)) && len > 0) { in __crypto_xor()
37 len--; in __crypto_xor()
41 while (IS_ENABLED(CONFIG_64BIT) && len >= 8 && !(relalign & 7)) { in __crypto_xor()
52 len -= 8; in __crypto_xor()
55 while (len >= 4 && !(relalign & 3)) { in __crypto_xor()
66 len -= 4; in __crypto_xor()
69 while (len >= 2 && !(relalign & 1)) { in __crypto_xor()
80 len -= 2; in __crypto_xor()
83 while (len--) in __crypto_xor()
/lib/vdso/
Dgetrandom.c20 #define MEMCPY_AND_ZERO_SRC(type, dst, src, len) do { \ argument
21 while (len >= sizeof(type)) { \
26 len -= sizeof(type); \
30 static void memcpy_and_zero_src(void *dst, void *src, size_t len) in memcpy_and_zero_src() argument
34 MEMCPY_AND_ZERO_SRC(u64, dst, src, len); in memcpy_and_zero_src()
35 MEMCPY_AND_ZERO_SRC(u32, dst, src, len); in memcpy_and_zero_src()
36 MEMCPY_AND_ZERO_SRC(u16, dst, src, len); in memcpy_and_zero_src()
38 MEMCPY_AND_ZERO_SRC(u8, dst, src, len); in memcpy_and_zero_src()
68 __cvdso_getrandom_data(const struct vdso_rng_data *rng_info, void *buffer, size_t len, in __cvdso_getrandom_data() argument
71 ssize_t ret = min_t(size_t, INT_MAX & PAGE_MASK /* = MAX_RW_COUNT */, len); in __cvdso_getrandom_data()
[all …]
/lib/zlib_deflate/
Ddefutil.h49 ush len; /* length of bit string */ member
56 #define Len dl.len
300 int len /* its bit length */ in bi_reverse() argument
307 } while (--len > 0); in bi_reverse()
390 { int len = length;\
391 if (s->bi_valid > (int)Buf_size - len) {\
396 s->bi_valid += len - Buf_size;\
399 s->bi_valid += len;\
423 unsigned len; in flush_pending() local
427 len = s->pending; in flush_pending()
[all …]
/lib/reed_solomon/
Dtest_rslib.c152 int len, int errs, int eras) in get_rcw_we() argument
157 int dlen = len - nroots; in get_rcw_we()
173 memcpy(r, c, len * sizeof(*r)); in get_rcw_we()
174 memset(errlocs, 0, len * sizeof(*errlocs)); in get_rcw_we()
186 errloc = get_random_u32_below(len); in get_rcw_we()
197 errloc = get_random_u32_below(len); in get_rcw_we()
230 int len, uint16_t *syn) in compute_syndrome() argument
243 for (j = 1; j < len; j++) { in compute_syndrome()
260 static void test_uc(struct rs_control *rs, int len, int errs, in test_uc() argument
264 int dlen = len - rs->codec->nroots; in test_uc()
[all …]

1234