mtd: fix build with GCC 14
[openwrt/openwrt.git] / target / linux / generic / hack-6.6 / 920-device_tree_cmdline.patch
1 From e08bcbbaa52fcc41f02743fd2e62a33255ce52da Mon Sep 17 00:00:00 2001
2 From: OpenWrt community <openwrt-devel@lists.openwrt.org>
3 Date: Wed, 13 Jul 2022 13:52:28 +0200
4 Subject: [PATCH] of/ftd: add device tree cmdline
5
6 ---
7 drivers/of/fdt.c | 3 +++
8 1 file changed, 3 insertions(+)
9
10 --- a/drivers/of/fdt.c
11 +++ b/drivers/of/fdt.c
12 @@ -1185,6 +1185,9 @@ int __init early_init_dt_scan_chosen(cha
13 p = of_get_flat_dt_prop(node, "bootargs", &l);
14 if (p != NULL && l > 0)
15 strscpy(cmdline, p, min(l, COMMAND_LINE_SIZE));
16 + p = of_get_flat_dt_prop(node, "bootargs-append", &l);
17 + if (p != NULL && l > 0)
18 + strlcat(cmdline, p, min_t(int, strlen(cmdline) + (int)l, COMMAND_LINE_SIZE));
19
20 handle_cmdline:
21 /*