/lib/ |
D | kfifo.c | 90 unsigned int len, unsigned int off) in kfifo_copy_in() argument 100 len *= esize; in kfifo_copy_in() 102 l = min(len, size - off); in kfifo_copy_in() 105 memcpy(fifo->data, src + l, len - l); in kfifo_copy_in() 114 const void *buf, unsigned int len) in __kfifo_in() argument 119 if (len > l) in __kfifo_in() 120 len = l; in __kfifo_in() 122 kfifo_copy_in(fifo, buf, len, fifo->in); in __kfifo_in() 123 fifo->in += len; in __kfifo_in() 124 return len; in __kfifo_in() [all …]
|
D | seq_buf.c | 28 static bool seq_buf_can_fit(struct seq_buf *s, size_t len) in seq_buf_can_fit() argument 30 return s->len + len <= s->size; in seq_buf_can_fit() 42 unsigned int len = seq_buf_used(s); in seq_buf_print_seq() local 44 return seq_write(m, s->buffer, len); in seq_buf_print_seq() 59 int len; in seq_buf_vprintf() local 63 if (s->len < s->size) { in seq_buf_vprintf() 64 len = vsnprintf(s->buffer + s->len, s->size - s->len, fmt, args); in seq_buf_vprintf() 65 if (s->len + len < s->size) { in seq_buf_vprintf() 66 s->len += len; in seq_buf_vprintf() 115 unsigned int len = seq_buf_buffer_left(s); in seq_buf_bprintf() local [all …]
|
D | crc32.c | 58 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 …]
|
D | checksum.c | 46 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 …]
|
D | asn1_decoder.c | 62 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 …]
|
D | pci_iomap.c | 34 resource_size_t len = pci_resource_len(dev, bar); in pci_iomap_range() local 37 if (len <= offset || !start) in pci_iomap_range() 39 len -= offset; in pci_iomap_range() 41 if (maxlen && len > maxlen) in pci_iomap_range() 42 len = maxlen; in pci_iomap_range() 44 return __pci_ioport_map(dev, start, len); in pci_iomap_range() 46 return ioremap(start, len); in pci_iomap_range() 74 resource_size_t len = pci_resource_len(dev, bar); in pci_iomap_wc_range() local 81 if (len <= offset || !start) in pci_iomap_wc_range() 84 len -= offset; in pci_iomap_wc_range() [all …]
|
D | test_hexdump.c | 67 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_int() % d + 1; 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 …]
|
D | nlattr.c | 70 static int nla_validate_array(const struct nlattr *head, int len, int maxtype, in nla_validate_array() argument 78 nla_for_each_attr(entry, head, len, rem) { in nla_validate_array() 177 (pt->type == NLA_EXACT_LEN_WARN && attrlen != pt->len)) { in validate_nla() 204 if (attrlen != pt->len) in validate_nla() 232 if (pt->len) in validate_nla() 233 minlen = min_t(int, attrlen, pt->len + 1); in validate_nla() 247 if (pt->len) { in validate_nla() 253 if (attrlen > pt->len) in validate_nla() 259 if (pt->len && attrlen > pt->len) in validate_nla() 272 err = __nla_validate(nla_data(nla), nla_len(nla), pt->len, in validate_nla() [all …]
|
D | decompress_inflate.c | 32 static long INIT nofill(void *buffer, unsigned long len) in nofill() argument 38 STATIC int INIT __gunzip(unsigned char *buf, long len, in __gunzip() argument 65 len = 0; in __gunzip() 88 if (len == 0) in __gunzip() 89 len = fill(zbuf, GZIP_IOBUF_SIZE); in __gunzip() 92 if (len < 10 || in __gunzip() 104 strm->avail_in = len - 10; in __gunzip() 134 len = fill(zbuf, GZIP_IOBUF_SIZE); in __gunzip() 135 if (len < 0) { in __gunzip() 141 strm->avail_in = len; in __gunzip() [all …]
|
D | siphash.c | 29 #define PREAMBLE(len) \ argument 34 u64 b = ((u64)(len)) << 56; \ 52 u64 __siphash_aligned(const void *data, size_t len, const siphash_key_t *key) in __siphash_aligned() argument 54 const u8 *end = data + len - (len % sizeof(u64)); in __siphash_aligned() 55 const u8 left = len & (sizeof(u64) - 1); in __siphash_aligned() 57 PREAMBLE(len) in __siphash_aligned() 85 u64 __siphash_unaligned(const void *data, size_t len, const siphash_key_t *key) in __siphash_unaligned() argument 87 const u8 *end = data + len - (len % sizeof(u64)); in __siphash_unaligned() 88 const u8 left = len & (sizeof(u64) - 1); in __siphash_unaligned() 90 PREAMBLE(len) in __siphash_unaligned() [all …]
|
D | find_bit_benchmark.c | 36 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_next_bit(const void *bitmap, unsigned long len) in test_find_next_bit() argument 66 static int __init test_find_next_zero_bit(const void *bitmap, unsigned long len) in test_find_next_zero_bit() argument 73 i = find_next_zero_bit(bitmap, len, i) + 1; in test_find_next_zero_bit() 80 static int __init test_find_last_bit(const void *bitmap, unsigned long len) in test_find_last_bit() argument 88 l = find_last_bit(bitmap, len); in test_find_last_bit() 89 if (l >= len) in test_find_last_bit() 91 len = l; in test_find_last_bit() [all …]
|
D | hexdump.c | 105 int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize, in hex_dump_to_buffer() argument 118 if (len > rowsize) /* limit to one line at a time */ in hex_dump_to_buffer() 119 len = rowsize; in hex_dump_to_buffer() 122 if ((len % groupsize) != 0) /* no mixed size output */ in hex_dump_to_buffer() 125 ngroups = len / groupsize; in hex_dump_to_buffer() 131 if (!len) in hex_dump_to_buffer() 168 for (j = 0; j < len; j++) { in hex_dump_to_buffer() 191 for (j = 0; j < len; j++) { in hex_dump_to_buffer() 203 return ascii ? ascii_column + len : (groupsize * 2 + 1) * ngroups - 1; in hex_dump_to_buffer() 241 const void *buf, size_t len, bool ascii) in print_hex_dump() argument [all …]
|
D | textsearch.c | 200 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()
|
D | ts_kmp.c | 74 static inline void compute_prefix_tbl(const u8 *pattern, unsigned int len, in compute_prefix_tbl() argument 80 for (k = 0, q = 1; q < len; q++) { in compute_prefix_tbl() 91 static struct ts_config *kmp_init(const void *pattern, unsigned int len, in kmp_init() argument 97 unsigned int prefix_tbl_len = len * sizeof(unsigned int); in kmp_init() 98 size_t priv_size = sizeof(*kmp) + len + prefix_tbl_len; in kmp_init() 106 kmp->pattern_len = len; in kmp_init() 107 compute_prefix_tbl(pattern, len, kmp->prefix_tbl, flags); in kmp_init() 110 for (i = 0; i < len; i++) in kmp_init() 113 memcpy(kmp->pattern, pattern, len); in kmp_init()
|
D | test_firmware.c | 229 int len = 0; in config_show() local 233 len += scnprintf(buf, PAGE_SIZE - len, in config_show() 238 len += scnprintf(buf+len, PAGE_SIZE - len, in config_show() 242 len += scnprintf(buf+len, PAGE_SIZE - len, in config_show() 245 len += scnprintf(buf+len, PAGE_SIZE - len, in config_show() 248 len += scnprintf(buf+len, PAGE_SIZE - len, in config_show() 253 len += scnprintf(buf+len, PAGE_SIZE - len, in config_show() 256 len += scnprintf(buf+len, PAGE_SIZE - len, in config_show() 259 len += scnprintf(buf+len, PAGE_SIZE - len, in config_show() 264 return len; in config_show() [all …]
|
D | parser.c | 33 int len = -1; in match_one() local 45 len = simple_strtoul(p, (char **) &p, 10); in match_one() 63 if (len == -1 || len > str_len) in match_one() 64 len = str_len; in match_one() 65 args[argc].to = s + len; in match_one() 304 size_t len = ret >= size ? size - 1 : ret; in match_strlcpy() local 305 memcpy(dest, src->from, len); in match_strlcpy() 306 dest[len] = '\0'; in match_strlcpy()
|
D | oid_registry.c | 31 size_t len; in look_up_OID() local 61 len = oid_index[oid + 1] - oid_index[oid]; in look_up_OID() 62 if (len > datasize) { in look_up_OID() 66 if (len < datasize) { in look_up_OID() 74 while (len > 0) { in look_up_OID() 75 unsigned char a = oid_data[oid_index[oid] + --len]; in look_up_OID() 76 unsigned char b = octets[len]; in look_up_OID()
|
D | earlycpio.c | 60 size_t len, long *nextoff) in find_cpio_data() argument 72 while (len > cpio_header_len) { in find_cpio_data() 76 len -= 4; in find_cpio_data() 109 len -= cpio_header_len; in find_cpio_data() 114 if (nptr > p + len || dptr < p || nptr < dptr) in find_cpio_data() 135 len -= (nptr - p); in find_cpio_data()
|
D | crc-ccitt.c | 99 u16 crc_ccitt(u16 crc, u8 const *buffer, size_t len) in crc_ccitt() argument 101 while (len--) in crc_ccitt() 114 u16 crc_ccitt_false(u16 crc, u8 const *buffer, size_t len) in crc_ccitt_false() argument 116 while (len--) in crc_ccitt_false()
|
D | xxhash.c | 102 uint32_t xxh32(const void *input, const size_t len, const uint32_t seed) in xxh32() argument 105 const uint8_t *b_end = p + len; in xxh32() 108 if (len >= 16) { in xxh32() 132 h32 += (uint32_t)len; in xxh32() 172 uint64_t xxh64(const void *input, const size_t len, const uint64_t seed) in xxh64() argument 175 const uint8_t *const b_end = p + len; in xxh64() 178 if (len >= 32) { in xxh64() 207 h64 += (uint64_t)len; in xxh64() 270 int xxh32_update(struct xxh32_state *state, const void *input, const size_t len) in xxh32_update() argument 273 const uint8_t *const b_end = p + len; in xxh32_update() [all …]
|
D | sg_split.c | 26 size_t size = sizes[0], len; in sg_calculate_split() local 42 len = min_t(size_t, size, sglen - skip); in sg_calculate_split() 47 size -= len; in sg_calculate_split() 49 curr->length_last_sg = len; in sg_calculate_split() 51 while (!size && (skip + len < sglen) && (--nb_splits > 0)) { in sg_calculate_split() 54 skip += len; in sg_calculate_split() 55 len = min_t(size_t, size, sglen - skip); in sg_calculate_split() 60 curr->length_last_sg = len; in sg_calculate_split() 61 size -= len; in sg_calculate_split()
|
D | test-string_helpers.c | 77 int len = strlen(strings[i].in); in test_string_unescape() local 80 memcpy(&in[p], s, len); in test_string_unescape() 81 p += len; in test_string_unescape() 86 len = strlen(strings[i].out); in test_string_unescape() 88 memcpy(&out_test[q_test], s, len); in test_string_unescape() 89 q_test += len; in test_string_unescape() 291 int len; in test_string_escape() local 306 len = strlen(s2->in); in test_string_escape() 307 memcpy(&in[p], s2->in, len); in test_string_escape() 308 p += len; in test_string_escape() [all …]
|
/lib/zlib_inflate/ |
D | inftrees.c | 26 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 …]
|
D | inffast.c | 112 unsigned len; /* match length, unused bytes */ in inflate_fast() local 156 len = (unsigned)(this.val); in inflate_fast() 163 len += (unsigned)hold & ((1U << op) - 1); in inflate_fast() 211 if (op < len) { /* some from window */ in inflate_fast() 212 len -= op; in inflate_fast() 222 if (op < len) { /* some from end of window */ in inflate_fast() 223 len -= op; in inflate_fast() 228 if (write < len) { /* some from start of window */ in inflate_fast() 230 len -= op; in inflate_fast() 240 if (op < len) { /* some from window */ in inflate_fast() [all …]
|
/lib/reed_solomon/ |
D | test_rslib.c | 152 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 = prandom_u32() % len; in get_rcw_we() 197 errloc = prandom_u32() % 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 …]
|