Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'bootconfig-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull bootconfig updates from Masami Hiramatsu:

- Do not put unneeded quotes on the extra command line items which was
inserted from the bootconfig.

- Remove redundant spaces from the extra command line.

* tag 'bootconfig-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
init/main.c: Minor cleanup for the setup_command_line() function
init/main.c: Remove redundant space from saved_command_line
bootconfig: do not put quotes on cmdline items unless necessary

+10 -7
+10 -7
init/main.c
··· 327 327 { 328 328 struct xbc_node *knode, *vnode; 329 329 char *end = buf + size; 330 - const char *val; 330 + const char *val, *q; 331 331 int ret; 332 332 333 333 xbc_node_for_each_key_value(root, knode, val) { ··· 345 345 continue; 346 346 } 347 347 xbc_array_for_each_value(vnode, val) { 348 - ret = snprintf(buf, rest(buf, end), "%s=\"%s\" ", 349 - xbc_namebuf, val); 348 + q = strpbrk(val, " \t\r\n") ? "\"" : ""; 349 + ret = snprintf(buf, rest(buf, end), "%s=%s%s%s ", 350 + xbc_namebuf, q, val, q); 350 351 if (ret < 0) 351 352 return ret; 352 353 buf += ret; ··· 628 627 629 628 if (extra_command_line) 630 629 xlen = strlen(extra_command_line); 631 - if (extra_init_args) 630 + if (extra_init_args) { 631 + extra_init_args = strim(extra_init_args); /* remove trailing space */ 632 632 ilen = strlen(extra_init_args) + 4; /* for " -- " */ 633 + } 633 634 634 - len = xlen + strlen(boot_command_line) + 1; 635 + len = xlen + strlen(boot_command_line) + ilen + 1; 635 636 636 - saved_command_line = memblock_alloc(len + ilen, SMP_CACHE_BYTES); 637 + saved_command_line = memblock_alloc(len, SMP_CACHE_BYTES); 637 638 if (!saved_command_line) 638 - panic("%s: Failed to allocate %zu bytes\n", __func__, len + ilen); 639 + panic("%s: Failed to allocate %zu bytes\n", __func__, len); 639 640 640 641 len = xlen + strlen(command_line) + 1; 641 642