Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2147599/?format=api
{ "id": 2147599, "url": "http://patchwork.ozlabs.org/api/patches/2147599/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20251009123034.2441110-1-jerome.forissier@linaro.org/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20251009123034.2441110-1-jerome.forissier@linaro.org>", "list_archive_url": null, "date": "2025-10-09T12:30:14", "name": "net: make dhcp_run() common for NET and NET_LWIP", "commit_ref": "4b8e78585171787794611205d661b97bc5f4dd83", "pull_url": null, "state": "accepted", "archived": false, "hash": "4b8a18778247dc6465df8e7ba8f6011f70c63301", "submitter": { "id": 69192, "url": "http://patchwork.ozlabs.org/api/people/69192/?format=api", "name": "Jerome Forissier", "email": "jerome.forissier@linaro.org" }, "delegate": { "id": 157425, "url": "http://patchwork.ozlabs.org/api/users/157425/?format=api", "username": "jforissier", "first_name": "Jerome", "last_name": "Forissier", "email": "jerome.forissier@linaro.org" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20251009123034.2441110-1-jerome.forissier@linaro.org/mbox/", "series": [ { "id": 476902, "url": "http://patchwork.ozlabs.org/api/series/476902/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=476902", "date": "2025-10-09T12:30:14", "name": "net: make dhcp_run() common for NET and NET_LWIP", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/476902/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2147599/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2147599/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=F114A8r2;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linaro.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.b=\"F114A8r2\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linaro.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=jerome.forissier@linaro.org" ], "Received": [ "from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4cj8PN0ctfz1yGS\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 9 Oct 2025 23:31:20 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id E88E583A3A;\n\tThu, 9 Oct 2025 14:31:12 +0200 (CEST)", "by phobos.denx.de (Postfix, from userid 109)\n id B431E83A3A; Thu, 9 Oct 2025 14:31:11 +0200 (CEST)", "from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com\n [IPv6:2a00:1450:4864:20::42d])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 5D81C83A2B\n for <u-boot@lists.denx.de>; Thu, 9 Oct 2025 14:31:09 +0200 (CEST)", "by mail-wr1-x42d.google.com with SMTP id\n ffacd0b85a97d-4060b4b1200so980271f8f.3\n for <u-boot@lists.denx.de>; Thu, 09 Oct 2025 05:31:09 -0700 (PDT)", "from builder.. ([2a01:e0a:3cb:7bb0:86ff:a12c:54e9:8445])\n by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-46faf183b6dsm45516265e9.17.2025.10.09.05.31.07\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 09 Oct 2025 05:31:08 -0700 (PDT)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1760013068; x=1760617868; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=h7+r3HsiC4p/YM7GWsnZZEWU/tAK1fazg2r57gcHHEE=;\n b=F114A8r2ms4UqGoLgGqSJmu2pjwT6vTJYegISOqv/Pzr8E3fvB0OmhRvYcsEQS/bdF\n Hcz2L+lm0o08pz7pflNu7ESyngFrkO4hoQp0qHOyNGl/IHJTfSC+ci4dC7OkaKrG6Dax\n NDA6LUx8jyiUsyjYX93FNOQV/x5LVpz2vi9dnVM1EIsqsJFxK7aysD74CjbF/5u5o7Ka\n emCy/k/+B0f8p/yS59YjA/B8QM8NtyJ4uDauc5PqZphdsbo/Qlf92sYPB6rAIJmOS/+0\n zJTRRs0u6/ZT1DL3m/8HXjl7+tYUuU4nMrxyQHPQnn9caECfPftdLMqfYz7ZjpAl3NUn\n MbTw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1760013068; x=1760617868;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=h7+r3HsiC4p/YM7GWsnZZEWU/tAK1fazg2r57gcHHEE=;\n b=pqnyyhdIBLdmMkmCEU8AmQ2A7u4ZAlVErSWgdjWE/DS7jSGyHZsKpCnkNWgutCSk4W\n sAsc+gkTWWX9odsD6KPq9qO6oSOgKy3CQO752HtiQ6pnIXPRJuuBSpJbiVRSO6YuWzxY\n dZBJxngpS5S1I+x76AXOZGcW6lA8cODvaFaWw+b9FhCNPQXqlGvp4dhHwxq3f6Q1hM2y\n itwKZdAdKznfgQPGKLP1QTyirRniXucZBmEaotli6cHpB0nWHDHNB9leeYKg0iKCiE28\n sVZy9BicSPz/Y5wvjUGV9Xtr5n5lLWqeI3p+3XRuskQDj+RDCLJWVOcVjCPVsKU+dPsV\n qBZQ==", "X-Gm-Message-State": "AOJu0YyhtVj39Xd5hUCZ5CEnokFVp5hvLREs0IMEVg925aZ98uUzzcU+\n Ej38AVg3D/yfu3g5p47O2KI3s5nxd3VZGtaBbxDxZpFMJzB0I4i7YCR07mimGN1+19fnFwgKsHO\n cO5bYCO8=", "X-Gm-Gg": "ASbGncv6O0hxvEEy3GlhCjOFqU+uGO58opbl0IE232mHlHade8HnJ1KfBSaRtX0fQGp\n LwPz7Rcf2I+ni8brFxLPy0nyYqHcTViJXcBOTu+ItFbTxzaLFgr3ktnamXRRUKIcDhF56BZn2cy\n tRg2Za3nmHDmhCYb7Q2Kdx9tTkKinblhMoYsFE16Jn++AxPIWW2X5SZcQ0uiqV7EUT5pCszS2hz\n 1oUHTsv48QUFisHi9YER80cXMrAJBfPQJk1lw5l0oCRgRvmWYtqYCixvpS58GOKTaBiuiaa2B13\n LAk+nl+1HLK/CpEvyDGkhyi0VZ7ayFrZGcPolE3xHDKQKoqfSc0CRiMNcJhVePuo3tVJA2GlE36\n wLQCR6B9XtgtyvxqIf6pm9i0viIU+5owYIBrciuz40UjK1ZQazYR9bouKcHU=", "X-Google-Smtp-Source": "\n AGHT+IHV8NEecl4iCxTGJIPgQBhGe8rAdm2FLvLHuEEdmXwl+hgVq6WpEzPtfzNwgd6ai3SMtzoNFw==", "X-Received": "by 2002:a05:6000:401f:b0:3e9:a1cb:ea8f with SMTP id\n ffacd0b85a97d-4267260e2famr5315750f8f.52.1760013068428;\n Thu, 09 Oct 2025 05:31:08 -0700 (PDT)", "From": "Jerome Forissier <jerome.forissier@linaro.org>", "To": "U-Boot mailing list <u-boot@lists.denx.de>", "Cc": "Benjamin Hahn <B.Hahn@phytec.de>,\n Jerome Forissier <jerome.forissier@linaro.org>,\n Tom Rini <trini@konsulko.com>, Adriano Cordova <adrianox@gmail.com>,\n Heinrich Schuchardt <xypron.glpk@gmx.de>,\n Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n Joe Hershberger <joe.hershberger@ni.com>,\n Ramon Fried <rfried.dev@gmail.com>, Simon Glass <sjg@chromium.org>,\n Tim Harvey <tharvey@gateworks.com>,\n Wolfgang Wallner <wolfgang.wallner@br-automation.com>", "Subject": "[PATCH] net: make dhcp_run() common for NET and NET_LWIP", "Date": "Thu, 9 Oct 2025 14:30:14 +0200", "Message-ID": "<20251009123034.2441110-1-jerome.forissier@linaro.org>", "X-Mailer": "git-send-email 2.48.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.39", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>", "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de", "X-Virus-Status": "Clean" }, "content": "THere are currently two implementations of dhcp_run(): one in cmd/net.c\nfor NET and one in net/lwip/dhcp.c for NET_LWIP. There is no\njustification for that. Therefore, move the NET version into\nnet/net-common.c to be used by both stacks, and drop the NET_LWIP\nversion which by the way does not look totally correct.\n\nSigned-off-by: Jerome Forissier <jerome.forissier@linaro.org>\nSuggested-by: Tom Rini <trini@konsulko.com>\n---\n\n cmd/net.c | 36 ++----------------------------------\n include/net-common.h | 10 ++++++++++\n include/net-lwip.h | 1 -\n net/lwip/dhcp.c | 22 ----------------------\n net/net-common.c | 35 +++++++++++++++++++++++++++++++++++\n 5 files changed, 47 insertions(+), 57 deletions(-)", "diff": "diff --git a/cmd/net.c b/cmd/net.c\nindex 886735ea14f6..24099764493e 100644\n--- a/cmd/net.c\n+++ b/cmd/net.c\n@@ -134,8 +134,8 @@ U_BOOT_CMD(dhcp6,\t3,\t1,\tdo_dhcp6,\n #endif\n \n #if defined(CONFIG_CMD_DHCP)\n-static int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc,\n-\t\t char *const argv[])\n+int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc,\n+\t char *const argv[])\n {\n \treturn netboot_common(DHCP, cmdtp, argc, argv);\n }\n@@ -145,38 +145,6 @@ U_BOOT_CMD(\n \t\"boot image via network using DHCP/TFTP protocol\",\n \t\"[loadAddress] [[hostIPaddr:]bootfilename]\"\n );\n-\n-int dhcp_run(ulong addr, const char *fname, bool autoload)\n-{\n-\tchar *dhcp_argv[] = {\"dhcp\", NULL, (char *)fname, NULL};\n-\tstruct cmd_tbl cmdtp = {};\t/* dummy */\n-\tchar file_addr[17];\n-\tint old_autoload;\n-\tint ret, result;\n-\n-\tlog_debug(\"addr=%lx, fname=%s, autoload=%d\\n\", addr, fname, autoload);\n-\told_autoload = env_get_yesno(\"autoload\");\n-\tret = env_set(\"autoload\", autoload ? \"y\" : \"n\");\n-\tif (ret)\n-\t\treturn log_msg_ret(\"en1\", -EINVAL);\n-\n-\tif (autoload) {\n-\t\tsprintf(file_addr, \"%lx\", addr);\n-\t\tdhcp_argv[1] = file_addr;\n-\t}\n-\n-\tresult = do_dhcp(&cmdtp, 0, !autoload ? 1 : fname ? 3 : 2, dhcp_argv);\n-\n-\tret = env_set(\"autoload\", old_autoload == -1 ? NULL :\n-\t\t old_autoload ? \"y\" : \"n\");\n-\tif (ret)\n-\t\treturn log_msg_ret(\"en2\", -EINVAL);\n-\n-\tif (result)\n-\t\treturn log_msg_ret(\"res\", -ENOENT);\n-\n-\treturn 0;\n-}\n #endif\n \n #if defined(CONFIG_CMD_NFS)\ndiff --git a/include/net-common.h b/include/net-common.h\nindex 1112af381a98..78d98e5bba07 100644\n--- a/include/net-common.h\n+++ b/include/net-common.h\n@@ -479,6 +479,16 @@ int net_loop(enum proto_t protocol);\n */\n int dhcp_run(ulong addr, const char *fname, bool autoload);\n \n+/**\n+ * do_dhcp - Run the dhcp command\n+ *\n+ * @cmdtp: Unused\n+ * @flag: Command flags (CMD_FLAG_...)\n+ * @argc: Number of arguments\n+ * @argv: List of arguments\n+ * Return: result (see enum command_ret_t)\n+ */\n+int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);\n \n /**\n * do_ping - Run the ping command\ndiff --git a/include/net-lwip.h b/include/net-lwip.h\nindex e88e2186635b..c910def5719e 100644\n--- a/include/net-lwip.h\n+++ b/include/net-lwip.h\n@@ -50,7 +50,6 @@ int net_lwip_dns_resolve(char *name_or_ip, ip_addr_t *ip);\n */\n bool wget_validate_uri(char *uri);\n \n-int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);\n int do_dns(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);\n int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]);\n \ndiff --git a/net/lwip/dhcp.c b/net/lwip/dhcp.c\nindex 531bf2c67057..b798014ebcb9 100644\n--- a/net/lwip/dhcp.c\n+++ b/net/lwip/dhcp.c\n@@ -150,25 +150,3 @@ int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])\n \n \treturn CMD_RET_SUCCESS;\n }\n-\n-int dhcp_run(ulong addr, const char *fname, bool autoload)\n-{\n-\tchar *dhcp_argv[] = {\"dhcp\", NULL, };\n-#ifdef CONFIG_CMD_TFTPBOOT\n-\tchar *tftp_argv[] = {\"tftpboot\", boot_file_name, NULL, };\n-#endif\n-\tstruct cmd_tbl cmdtp = {};\t/* dummy */\n-\n-\tif (autoload) {\n-#ifdef CONFIG_CMD_TFTPBOOT\n-\t\t/* Assume DHCP was already performed */\n-\t\tif (boot_file_name[0])\n-\t\t\treturn do_tftpb(&cmdtp, 0, 2, tftp_argv);\n-\t\treturn 0;\n-#else\n-\t\treturn -EOPNOTSUPP;\n-#endif\n-\t}\n-\n-\treturn do_dhcp(&cmdtp, 0, 1, dhcp_argv);\n-}\ndiff --git a/net/net-common.c b/net/net-common.c\nindex b064557d5241..442b05975581 100644\n--- a/net/net-common.c\n+++ b/net/net-common.c\n@@ -1,6 +1,7 @@\n // SPDX-License-Identifier: GPL-2.0\n \n #include <dm/uclass.h>\n+#include <env.h>\n #include <net-common.h>\n #include <linux/time.h>\n #include <rtc.h>\n@@ -48,3 +49,37 @@ void net_sntp_set_rtc(u32 seconds)\n \t tm.tm_year, tm.tm_mon, tm.tm_mday,\n \t tm.tm_hour, tm.tm_min, tm.tm_sec);\n }\n+\n+#if defined(CONFIG_CMD_DHCP)\n+int dhcp_run(ulong addr, const char *fname, bool autoload)\n+{\n+\tchar *dhcp_argv[] = {\"dhcp\", NULL, (char *)fname, NULL};\n+\tstruct cmd_tbl cmdtp = {};\t/* dummy */\n+\tchar file_addr[17];\n+\tint old_autoload;\n+\tint ret, result;\n+\n+\tlog_debug(\"addr=%lx, fname=%s, autoload=%d\\n\", addr, fname, autoload);\n+\told_autoload = env_get_yesno(\"autoload\");\n+\tret = env_set(\"autoload\", autoload ? \"y\" : \"n\");\n+\tif (ret)\n+\t\treturn log_msg_ret(\"en1\", -EINVAL);\n+\n+\tif (autoload) {\n+\t\tsprintf(file_addr, \"%lx\", addr);\n+\t\tdhcp_argv[1] = file_addr;\n+\t}\n+\n+\tresult = do_dhcp(&cmdtp, 0, !autoload ? 1 : fname ? 3 : 2, dhcp_argv);\n+\n+\tret = env_set(\"autoload\", old_autoload == -1 ? NULL :\n+\t\t old_autoload ? \"y\" : \"n\");\n+\tif (ret)\n+\t\treturn log_msg_ret(\"en2\", -EINVAL);\n+\n+\tif (result)\n+\t\treturn log_msg_ret(\"res\", -ENOENT);\n+\n+\treturn 0;\n+}\n+#endif\n", "prefixes": [] }