Home
last modified time | relevance | path

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

123

/lib/
Dkfifo.c103 unsigned int len, unsigned int off) in kfifo_copy_in() argument
113 len *= esize; in kfifo_copy_in()
115 l = min(len, size - off); in kfifo_copy_in()
118 memcpy(fifo->data, src + l, len - l); in kfifo_copy_in()
127 const void *buf, unsigned int len) in __kfifo_in() argument
132 if (len > l) in __kfifo_in()
133 len = l; in __kfifo_in()
135 kfifo_copy_in(fifo, buf, len, fifo->in); in __kfifo_in()
136 fifo->in += len; in __kfifo_in()
137 return len; in __kfifo_in()
[all …]
Dchecksum.c50 static unsigned int do_csum(const unsigned char *buff, int len) in do_csum() argument
55 if (len <= 0) in do_csum()
64 len--; in do_csum()
67 if (len >= 2) { in do_csum()
70 len -= 2; in do_csum()
73 if (len >= 4) { in do_csum()
74 const unsigned char *end = buff + ((unsigned)len & ~3); in do_csum()
86 if (len & 2) { in do_csum()
91 if (len & 1) in do_csum()
129 __wsum csum_partial(const void *buff, int len, __wsum wsum) in csum_partial() argument
[all …]
Diovec.c11 int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len) in memcpy_fromiovec() argument
13 while (len > 0) { in memcpy_fromiovec()
15 int copy = min_t(unsigned int, len, iov->iov_len); in memcpy_fromiovec()
18 len -= copy; in memcpy_fromiovec()
36 int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len) in memcpy_toiovec() argument
38 while (len > 0) { in memcpy_toiovec()
40 int copy = min_t(unsigned int, iov->iov_len, len); in memcpy_toiovec()
44 len -= copy; in memcpy_toiovec()
60 int offset, int len) in memcpy_toiovecend() argument
63 for (; len > 0; ++iov) { in memcpy_toiovecend()
[all …]
Dasn1_decoder.c60 size_t dp = *_dp, len, n; in asn1_find_indefinite_length() local
93 len = data[dp++]; in asn1_find_indefinite_length()
94 if (len <= 0x7f) in asn1_find_indefinite_length()
97 if (unlikely(len == ASN1_INDEFINITE_LENGTH)) { in asn1_find_indefinite_length()
105 n = len - 0x80; in asn1_find_indefinite_length()
106 if (unlikely(n > sizeof(len) - 1)) in asn1_find_indefinite_length()
110 len = 0; in asn1_find_indefinite_length()
112 len <<= 8; in asn1_find_indefinite_length()
113 len |= data[dp++]; in asn1_find_indefinite_length()
116 if (len > datalen - dp) in asn1_find_indefinite_length()
[all …]
Dcrc32.c57 crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 (*tab)[256]) argument
84 if (unlikely((long)buf & 3 && len)) {
87 } while ((--len) && ((long)buf)&3);
91 rem_len = len & 3;
92 len = len >> 2;
94 rem_len = len & 7;
95 len = len >> 3;
101 for (i = 0; i < len; i++) {
103 for (--b; len; --len) {
114 len = rem_len;
[all …]
Dnlattr.c51 if (pt->len) in validate_nla()
52 minlen = min_t(int, attrlen, pt->len + 1); in validate_nla()
64 if (pt->len) { in validate_nla()
70 if (attrlen > pt->len) in validate_nla()
76 if (pt->len && attrlen > pt->len) in validate_nla()
81 if (attrlen < pt->len) in validate_nla()
83 if (attrlen < NLA_ALIGN(pt->len)) in validate_nla()
85 if (attrlen < NLA_ALIGN(pt->len) + NLA_HDRLEN) in validate_nla()
87 nla = nla_data(nla) + NLA_ALIGN(pt->len); in validate_nla()
88 if (attrlen < NLA_ALIGN(pt->len) + NLA_HDRLEN + nla_len(nla)) in validate_nla()
[all …]
Dpci_iomap.c29 resource_size_t len = pci_resource_len(dev, bar); in pci_iomap() local
32 if (!len || !start) in pci_iomap()
34 if (maxlen && len > maxlen) in pci_iomap()
35 len = maxlen; in pci_iomap()
37 return __pci_ioport_map(dev, start, len); in pci_iomap()
40 return ioremap(start, len); in pci_iomap()
41 return ioremap_nocache(start, len); in pci_iomap()
Dhexdump.c101 void hex_dump_to_buffer(const void *buf, size_t len, int rowsize, in hex_dump_to_buffer() argument
113 if (!len) in hex_dump_to_buffer()
115 if (len > rowsize) /* limit to one line at a time */ in hex_dump_to_buffer()
116 len = rowsize; in hex_dump_to_buffer()
117 if ((len % groupsize) != 0) /* no mixed size output */ in hex_dump_to_buffer()
123 int ngroups = len / groupsize; in hex_dump_to_buffer()
135 int ngroups = len / groupsize; in hex_dump_to_buffer()
146 int ngroups = len / groupsize; in hex_dump_to_buffer()
156 for (j = 0; (j < len) && (lx + 3) <= linebuflen; j++) { in hex_dump_to_buffer()
173 for (j = 0; (j < len) && (lx + 2) < linebuflen; j++) { in hex_dump_to_buffer()
[all …]
Dparser.c35 int len = -1; in match_one() local
47 len = simple_strtoul(p, (char **) &p, 10); in match_one()
65 if (len == -1 || len > str_len) in match_one()
66 len = str_len; in match_one()
67 args[argc].to = s + len; in match_one()
134 size_t len = s->to - s->from; in match_number() local
136 buf = kmalloc(len + 1, GFP_KERNEL); in match_number()
139 memcpy(buf, s->from, len); in match_number()
140 buf[len] = '\0'; in match_number()
265 size_t len = ret >= size ? size - 1 : ret; in match_strlcpy() local
[all …]
Ddecompress_inflate.c30 static long INIT nofill(void *buffer, unsigned long len) in nofill() argument
36 STATIC int INIT gunzip(unsigned char *buf, long len, in gunzip() argument
63 len = 0; in gunzip()
86 if (len == 0) in gunzip()
87 len = fill(zbuf, GZIP_IOBUF_SIZE); in gunzip()
90 if (len < 10 || in gunzip()
102 strm->avail_in = len - 10; in gunzip()
132 len = fill(zbuf, GZIP_IOBUF_SIZE); in gunzip()
133 if (len < 0) { in gunzip()
139 strm->avail_in = len; in gunzip()
Dtextsearch.c198 unsigned int len; member
208 if (likely(consumed < st->len)) { in get_linear_data()
210 return st->len - consumed; in get_linear_data()
231 const void *data, unsigned int len) in textsearch_find_continuous() argument
237 st->len = len; in textsearch_find_continuous()
262 unsigned int len, gfp_t gfp_mask, int flags) in textsearch_prepare() argument
268 if (len == 0) in textsearch_prepare()
287 conf = ops->init(pattern, len, gfp_mask, flags); in textsearch_prepare()
Dbitmap.c287 void bitmap_set(unsigned long *map, unsigned int start, int len) in bitmap_set() argument
290 const unsigned int size = start + len; in bitmap_set()
294 while (len - bits_to_set >= 0) { in bitmap_set()
296 len -= bits_to_set; in bitmap_set()
301 if (len) { in bitmap_set()
308 void bitmap_clear(unsigned long *map, unsigned int start, int len) in bitmap_clear() argument
311 const unsigned int size = start + len; in bitmap_clear()
315 while (len - bits_to_clear >= 0) { in bitmap_clear()
317 len -= bits_to_clear; in bitmap_clear()
322 if (len) { in bitmap_clear()
[all …]
Dts_kmp.c78 static inline void compute_prefix_tbl(const u8 *pattern, unsigned int len, in compute_prefix_tbl() argument
84 for (k = 0, q = 1; q < len; q++) { in compute_prefix_tbl()
95 static struct ts_config *kmp_init(const void *pattern, unsigned int len, in kmp_init() argument
101 unsigned int prefix_tbl_len = len * sizeof(unsigned int); in kmp_init()
102 size_t priv_size = sizeof(*kmp) + len + prefix_tbl_len; in kmp_init()
110 kmp->pattern_len = len; in kmp_init()
111 compute_prefix_tbl(pattern, len, kmp->prefix_tbl, flags); in kmp_init()
114 for (i = 0; i < len; i++) in kmp_init()
117 memcpy(kmp->pattern, pattern, len); in kmp_init()
Dhash.c22 u32 arch_fast_hash(const void *data, u32 len, u32 seed) in arch_fast_hash() argument
24 return arch_hash_ops.hash(data, len, seed); in arch_fast_hash()
28 u32 arch_fast_hash2(const u32 *data, u32 len, u32 seed) in arch_fast_hash2() argument
30 return arch_hash_ops.hash2(data, len, seed); in arch_fast_hash2()
Dearlycpio.c68 size_t len, long *nextoff) in find_cpio_data() argument
80 while (len > cpio_header_len) { in find_cpio_data()
84 len -= 4; in find_cpio_data()
117 len -= cpio_header_len; in find_cpio_data()
122 if (nptr > p + len || dptr < p || nptr < dptr) in find_cpio_data()
140 len -= (nptr - p); in find_cpio_data()
Doid_registry.c35 size_t len; in look_up_OID() local
65 len = oid_index[oid + 1] - oid_index[oid]; in look_up_OID()
66 if (len > datasize) { in look_up_OID()
70 if (len < datasize) { in look_up_OID()
78 while (len > 0) { in look_up_OID()
79 unsigned char a = oid_data[oid_index[oid] + --len]; in look_up_OID()
80 unsigned char b = octets[len]; in look_up_OID()
Dkasprintf.c16 unsigned int len; in kvasprintf() local
21 len = vsnprintf(NULL, 0, fmt, aq); in kvasprintf()
24 p = kmalloc_track_caller(len+1, gfp); in kvasprintf()
28 vsnprintf(p, len+1, fmt, ap); in kvasprintf()
Dtest-string_helpers.c77 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()
279 int len; in test_string_escape() local
294 len = strlen(s2->in); in test_string_escape()
295 memcpy(&in[p], s2->in, len); in test_string_escape()
296 p += len; in test_string_escape()
[all …]
Dkobject_uevent.c132 int len; in init_uevent_argv() local
134 len = strlcpy(&env->buf[env->buflen], subsystem, in init_uevent_argv()
136 if (len >= (sizeof(env->buf) - env->buflen)) { in init_uevent_argv()
145 env->buflen += len + 1; in init_uevent_argv()
294 size_t len; in kobject_uevent_env() local
300 len = strlen(action_string) + strlen(devpath) + 2; in kobject_uevent_env()
301 skb = alloc_skb(len + env->buflen, GFP_KERNEL); in kobject_uevent_env()
306 scratch = skb_put(skb, len); in kobject_uevent_env()
311 len = strlen(env->envp[i]) + 1; in kobject_uevent_env()
312 scratch = skb_put(skb, len); in kobject_uevent_env()
[all …]
Dstring.c41 int strncasecmp(const char *s1, const char *s2, size_t len) in strncasecmp() argument
46 if (!len) in strncasecmp()
60 } while (--len); in strncasecmp()
67 int strnicmp(const char *s1, const char *s2, size_t len) in strnicmp() argument
69 return strncasecmp(s1, s2, len); in strnicmp()
152 size_t len = (ret >= size) ? size - 1 : ret; in strlcpy() local
153 memcpy(dest, src, len); in strlcpy()
154 dest[len] = '\0'; in strlcpy()
305 size_t len = strlen(src); in strlcat() local
306 size_t res = dsize + len; in strlcat()
[all …]
Dcrc-t10dif.c22 __u16 crc_t10dif(const unsigned char *buffer, size_t len) in crc_t10dif() argument
31 return crc_t10dif_generic(0, buffer, len); in crc_t10dif()
37 err = crypto_shash_update(&desc.shash, buffer, len); in crc_t10dif()
/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.c112 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/lz4/
Dlz4_compress.c126 int len; in lz4_compressctx() local
128 len = length - RUN_MASK; in lz4_compressctx()
129 for (; len > 254 ; len -= 255) in lz4_compressctx()
131 *op++ = (u8)len; in lz4_compressctx()
254 int len, length; in lz4_compress64kctx() local
307 len = length - RUN_MASK; in lz4_compress64kctx()
308 for (; len > 254 ; len -= 255) in lz4_compress64kctx()
310 *op++ = (u8)len; in lz4_compress64kctx()
357 len = (int)(ip - anchor); in lz4_compress64kctx()
359 if (unlikely(op + (1 + LASTLITERALS) + (len >> 8) > oend)) in lz4_compress64kctx()
[all …]
/lib/zlib_deflate/
Ddeflate.c308 unsigned len = s->pending; in flush_pending() local
310 if (len > strm->avail_out) len = strm->avail_out; in flush_pending()
311 if (len == 0) return; in flush_pending()
314 memcpy(strm->next_out, s->pending_out, len); in flush_pending()
315 strm->next_out += len; in flush_pending()
317 s->pending_out += len; in flush_pending()
318 strm->total_out += len; in flush_pending()
319 strm->avail_out -= len; in flush_pending()
320 s->pending -= len; in flush_pending()
499 unsigned len = strm->avail_in; in read_buf() local
[all …]

123