Home
last modified time | relevance | path

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

123

/scripts/dtc/
Ddata.c36 while ((d.len + xlen) > newsize) in data_grow_for()
44 struct data data_copy_mem(const char *mem, int len) in data_copy_mem() argument
48 d = data_grow_for(empty_data, len); in data_copy_mem()
50 d.len = len; in data_copy_mem()
51 memcpy(d.val, mem, len); in data_copy_mem()
56 struct data data_copy_escape_string(const char *s, int len) in data_copy_escape_string() argument
63 d = data_grow_for(d, len + 1); in data_copy_escape_string()
66 while (i < len) { in data_copy_escape_string()
72 q[d.len++] = c; in data_copy_escape_string()
75 q[d.len++] = '\0'; in data_copy_escape_string()
[all …]
Dutil.c28 int len = strlen(s) + 1; in xstrdup() local
29 char *d = xmalloc(len); in xstrdup()
31 memcpy(d, s, len); in xstrdup()
88 int len; in join_path() local
92 len = lenp + lenn + 2; in join_path()
95 len--; in join_path()
98 str = xmalloc(len); in join_path()
108 bool util_is_printable_string(const void *data, int len) in util_is_printable_string() argument
114 if (len == 0) in util_is_printable_string()
118 if (s[len - 1] != '\0') in util_is_printable_string()
[all …]
Dutil.h43 static inline void *xmalloc(size_t len) in xmalloc() argument
45 void *new = malloc(len); in xmalloc()
53 static inline void *xrealloc(void *p, size_t len) in xrealloc() argument
55 void *new = realloc(p, len); in xrealloc()
58 die("realloc() failed (len=%zd)\n", len); in xrealloc()
79 bool util_is_printable_string(const void *data, int len);
97 char *utilfdt_read(const char *filename, size_t *len);
109 int utilfdt_read_err(const char *filename, char **buffp, size_t *len);
179 void utilfdt_print_data(const char *data, int len);
Dfdtput.c62 int len; /* length of this cell/string/byte */ in encode_value() local
75 for (; arg_count > 0; arg++, arg_count--, upto += len) { in encode_value()
78 len = strlen(*arg) + 1; in encode_value()
80 len = disp->size == -1 ? 4 : disp->size; in encode_value()
83 if (upto + len > value_size) { in encode_value()
84 value_size = (upto + len) + 500; in encode_value()
95 memcpy(ptr, *arg, len); in encode_value()
101 if (len == 4) in encode_value()
121 const char *property, const char *buf, int len) in store_key_value() argument
132 err = fdt_setprop(blob, node, property, buf, len); in store_key_value()
[all …]
Dtreesource.c49 static void write_propval_string(FILE *f, const char *s, size_t len) in write_propval_string() argument
51 const char *end = s + len - 1; in write_propval_string()
53 if (!len) in write_propval_string()
102 static void write_propval_int(FILE *f, const char *p, size_t len, size_t width) in write_propval_int() argument
104 const char *end = p + len; in write_propval_int()
105 assert(len % width == 0); in write_propval_int()
165 int len = prop->val.len; in guess_value_type() local
172 for (i = 0; i < len; i++) { in guess_value_type()
186 if ((p[len-1] == '\0') && (nnotstring == 0) && (nnul <= (len-nnul)) in guess_value_type()
189 } else if (((len % sizeof(cell_t)) == 0) && (nnotcelllbl == 0)) { in guess_value_type()
[all …]
Dfdtget.c53 static int show_data(struct display_info *disp, const char *data, int len) in show_data() argument
63 if (len == 0) in show_data()
67 (!disp->type && util_is_printable_string(data, len)); in show_data()
69 if (data[len - 1] != '\0') { in show_data()
73 for (s = data; s - data < len; s += strlen(s) + 1) { in show_data()
82 size = (len % 4) == 0 ? 4 : 1; in show_data()
83 } else if (len % size) { in show_data()
91 for (i = 0; i < len; i += size, p += size) { in show_data()
196 int len, err = 0; in show_data_for_item() local
209 value = fdt_getprop(blob, node, property, &len); in show_data_for_item()
[all …]
Dyamltree.c32 …opval_int(yaml_emitter_t *emitter, struct marker *markers, char *data, unsigned int len, int width) in yaml_propval_int() argument
46 assert(len % width == 0); in yaml_propval_int()
52 for (off = 0; off < len; off += width) { in yaml_propval_int()
95 static void yaml_propval_string(yaml_emitter_t *emitter, char *str, int len) in yaml_propval_string() argument
100 assert(str[len-1] == '\0'); in yaml_propval_string()
103 for (i = 0; i < len; i++) in yaml_propval_string()
108 len-1, 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE); in yaml_propval_string()
115 unsigned int len = prop->val.len; in yaml_propval() local
125 if (len == 0) { in yaml_propval()
148 chunk_len = type_marker_length(m) ? : len; in yaml_propval()
[all …]
Dflattree.c52 static void bin_emit_string(void *e, const char *str, int len) in bin_emit_string() argument
56 if (len == 0) in bin_emit_string()
57 len = strlen(str); in bin_emit_string()
59 *dtbuf = data_append_data(*dtbuf, str, len); in bin_emit_string()
74 *dtbuf = data_append_data(*dtbuf, d.val, d.len); in bin_emit_data()
132 static void asm_emit_string(void *e, const char *str, int len) in asm_emit_string() argument
136 if (len != 0) in asm_emit_string()
137 fprintf(f, "\t.string\t\"%.*s\"\n", len, str); in asm_emit_string()
158 while ((d.len - off) >= sizeof(uint32_t)) { in asm_emit_data()
163 while ((d.len - off) >= 1) { in asm_emit_data()
[all …]
/scripts/dtc/libfdt/
Dfdt_wip.c16 int len) in fdt_setprop_inplace_namelen_partial() argument
26 if ((unsigned)proplen < (len + idx)) in fdt_setprop_inplace_namelen_partial()
29 memcpy((char *)propval + idx, val, len); in fdt_setprop_inplace_namelen_partial()
34 const void *val, int len) in fdt_setprop_inplace() argument
43 if (proplen != len) in fdt_setprop_inplace()
48 val, len); in fdt_setprop_inplace()
51 static void fdt_nop_region_(void *start, int len) in fdt_nop_region_() argument
55 for (p = start; (char *)p < ((char *)start + len); p++) in fdt_nop_region_()
62 int len; in fdt_nop_property() local
64 prop = fdt_get_property_w(fdt, nodeoffset, name, &len); in fdt_nop_property()
[all …]
Dfdt_overlay.c31 int len; in overlay_get_target_phandle() local
33 val = fdt_getprop(fdto, fragment, "target", &len); in overlay_get_target_phandle()
37 if ((len != sizeof(*val)) || (fdt32_to_cpu(*val) == (uint32_t)-1)) in overlay_get_target_phandle()
121 int len; in overlay_phandle_add_offset() local
123 val = fdt_getprop(fdt, node, name, &len); in overlay_phandle_add_offset()
125 return len; in overlay_phandle_add_offset()
127 if (len != sizeof(*val)) in overlay_phandle_add_offset()
433 int len; in overlay_fixup_phandle() local
436 &label, &len); in overlay_fixup_phandle()
438 if (len == -FDT_ERR_NOTFOUND) in overlay_fixup_phandle()
[all …]
Dfdt_ro.c14 const char *s, int len) in fdt_nodename_eq_() argument
19 if (!p || olen < len) in fdt_nodename_eq_()
23 if (memcmp(p, s, len) != 0) in fdt_nodename_eq_()
26 if (p[len] == '\0') in fdt_nodename_eq_()
28 else if (!memchr(s, '@', len) && (p[len] == '@')) in fdt_nodename_eq_()
38 size_t len; in fdt_get_string() local
58 len = totalsize - absoffset; in fdt_get_string()
66 if ((fdt_size_dt_strings(fdt) - stroffset) < len) in fdt_get_string()
67 len = fdt_size_dt_strings(fdt) - stroffset; in fdt_get_string()
75 if (sw_stroffset < len) in fdt_get_string()
[all …]
Dfdt_rw.c132 int len = strlen(s) + 1; in fdt_find_add_string_() local
144 err = fdt_splice_string_(fdt, len); in fdt_find_add_string_()
151 memcpy(new, s, len); in fdt_find_add_string_()
185 int len, struct fdt_property **prop) in fdt_resize_property_() argument
195 FDT_TAGALIGN(len)))) in fdt_resize_property_()
198 (*prop)->len = cpu_to_fdt32(len); in fdt_resize_property_()
203 int len, struct fdt_property **prop) in fdt_add_property_() argument
219 proplen = sizeof(**prop) + FDT_TAGALIGN(len); in fdt_add_property_()
231 (*prop)->len = cpu_to_fdt32(len); in fdt_add_property_()
259 int len, void **prop_data) in fdt_setprop_placeholder() argument
[all …]
Dfdt_sw.c94 static void *fdt_grab_space_(void *fdt, size_t len) in fdt_grab_space_() argument
102 if ((offset + len < offset) || (offset + len > spaceleft)) in fdt_grab_space_()
105 fdt_set_size_dt_struct(fdt, offset + len); in fdt_grab_space_()
254 unsigned int len = strlen(s) + 1; in fdt_add_string_() local
257 offset = strtabsize + len; in fdt_add_string_()
262 memcpy(strtab - offset, s, len); in fdt_add_string_()
263 fdt_set_size_dt_strings(fdt, strtabsize + len); in fdt_add_string_()
271 int len = strlen(s) + 1; in fdt_del_last_string_() local
273 fdt_set_size_dt_strings(fdt, strtabsize - len); in fdt_del_last_string_()
293 int fdt_property_placeholder(void *fdt, const char *name, int len, void **valp) in fdt_property_placeholder() argument
[all …]
Dfdt_addresses.c18 int len; in fdt_cells() local
20 c = fdt_getprop(fdt, nodeoffset, name, &len); in fdt_cells()
22 return len; in fdt_cells()
24 if (len != sizeof(*c)) in fdt_cells()
Dfdt.c139 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len) in fdt_offset_ptr() argument
149 || ((absoffset + len) < absoffset) in fdt_offset_ptr()
150 || (absoffset + len) > fdt_totalsize(fdt)) in fdt_offset_ptr()
154 if (((uoffset + len) < uoffset) in fdt_offset_ptr()
155 || ((offset + len) > fdt_size_dt_struct(fdt))) in fdt_offset_ptr()
309 int len = strlen(s) + 1; in fdt_find_string_() local
310 const char *last = strtab + tabsize - len; in fdt_find_string_()
314 if (memcmp(p, s, len) == 0) in fdt_find_string_()
/scripts/
Dkallsyms.c34 unsigned int len; member
203 unsigned int len; in read_symbol() local
233 len = strlen(name) + 1; in read_symbol()
235 sym = malloc(sizeof(*sym) + len + 1); in read_symbol()
242 sym->len = len; in read_symbol()
358 static int expand_symbol(const unsigned char *data, int len, char *result) in expand_symbol() argument
362 while (len) { in expand_symbol()
376 len--; in expand_symbol()
474 printf("\t.byte 0x%02x", table[i]->len); in write_src()
475 for (k = 0; k < table[i]->len; k++) in write_src()
[all …]
Dextract-module-sig.pl35 my $len = sysread(FD, $buf, $st[7]);
36 die "$modfile" unless (defined($len));
37 die "Short read on $modfile\n" unless ($len == $st[7]);
40 print STDERR "Read ", $len, " bytes from module file\n";
43 if ($len < 12 + length($magic_number));
48 my $p = $len - length($magic_number);
51 die "Magic number not found at $len\n"
53 print STDERR "Found magic number at $len\n";
Dextract-sys-certs.pl38 my $len = Math::BigInt->new("0x" . $3);
46 len => $len,
110 my $s_len = $sec->{len};
149 my $len = sysread(FD, $buf, $size);
150 die "$vmlinux" if (!defined($len));
151 die "Short read on $vmlinux\n" if ($len != $size);
156 $len = syswrite(FD, $buf, $size);
157 die "$keyring" if (!defined($len));
158 die "Short write on $keyring\n" if ($len != $size);
Djobserver-exec43 if len(jobs):
48 claim = len(jobs) + 1
63 if len(jobs):
/scripts/kconfig/lxdialog/
Dinputbox.c36 int show_x, len, pos; in dialog_inputbox() local
88 len = strlen(instr); in dialog_inputbox()
89 pos = len; in dialog_inputbox()
91 if (len >= box_width) { in dialog_inputbox()
92 show_x = len - box_width + 1; in dialog_inputbox()
98 input_x = len; in dialog_inputbox()
125 if (pos < len) { in dialog_inputbox()
126 for (i = pos - 1; i < len; i++) { in dialog_inputbox()
132 len--; in dialog_inputbox()
133 instr[len] = '\0'; in dialog_inputbox()
[all …]
/scripts/basic/
Dfixdep.c129 unsigned int len; member
150 static int is_defined_config(const char *name, int len, unsigned int hash) in is_defined_config() argument
155 if (aux->hash == hash && aux->len == len && in is_defined_config()
156 memcmp(aux->name, name, len) == 0) in is_defined_config()
165 static void define_config(const char *name, int len, unsigned int hash) in define_config() argument
167 struct item *aux = malloc(sizeof(*aux) + len); in define_config()
173 memcpy(aux->name, name, len); in define_config()
174 aux->len = len; in define_config()
263 static int is_ignored_file(const char *s, int len) in is_ignored_file() argument
265 return str_ends_with(s, len, "include/generated/autoconf.h") || in is_ignored_file()
[all …]
/scripts/mod/
Dsumversion.c170 const unsigned char *data, unsigned int len) in md4_update() argument
174 mctx->byte_count += len; in md4_update()
176 if (avail > len) { in md4_update()
178 data, len); in md4_update()
187 len -= avail; in md4_update()
189 while (len >= sizeof(mctx->block)) { in md4_update()
193 len -= sizeof(mctx->block); in md4_update()
196 memcpy(mctx->block, data, len); in md4_update()
199 static void md4_final_ascii(struct md4_ctx *mctx, char *out, unsigned int len) in md4_final_ascii() argument
221 snprintf(out, len, "%08X%08X%08X%08X", in md4_final_ascii()
[all …]
/scripts/kconfig/
Dnconf.gui.c177 int len = get_line_length(line); in fill_window() local
178 strncpy(tmp, line, min(len, x)); in fill_window()
179 tmp[len] = '\0'; in fill_window()
223 int len = get_line_length(line); in btn_dialog() local
224 if (msg_width < len) in btn_dialog()
225 msg_width = len; in btn_dialog()
335 int len = get_line_length(line); in dialog_inputbox() local
336 prompt_width = max(prompt_width, len); in dialog_inputbox()
385 int len = strlen(result); in dialog_inputbox() local
399 len-cursor_position+1); in dialog_inputbox()
[all …]
/scripts/genksyms/
Dkeywords.c68 static int is_reserved_word(register const char *str, register unsigned int len) in is_reserved_word() argument
74 if (len == l && !memcmp(str, r->name, len)) in is_reserved_word()
/scripts/selinux/genheaders/
Dgenheaders.c100 int len = strlen(map->name), l = sizeof(s) - 1; in main() local
101 if (len >= l && memcmp(map->name + len - l, s, l) == 0) in main()
127 int len = strlen(map->name); in main() local
135 39-len, map->perms[j], 1U<<j); in main()

123