get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1112495/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1112495,
    "url": "http://patchwork.ozlabs.org/api/patches/1112495/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/openwrt/patch/20190608155442.16632-1-yszhou4tech@gmail.com/",
    "project": {
        "id": 45,
        "url": "http://patchwork.ozlabs.org/api/projects/45/?format=api",
        "name": "OpenWrt development",
        "link_name": "openwrt",
        "list_id": "openwrt-devel.lists.openwrt.org",
        "list_email": "openwrt-devel@lists.openwrt.org",
        "web_url": "http://openwrt.org/",
        "scm_url": "git://git.openwrt.org/openwrt.git",
        "webscm_url": "https://dev.openwrt.org/browser",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20190608155442.16632-1-yszhou4tech@gmail.com>",
    "list_archive_url": null,
    "date": "2019-06-08T15:54:41",
    "name": "[OpenWrt-Devel,1/2] generic: support mtd-mac-address-ascii",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "d0a9c37879417d6c616f64d0da299fbc98926bb2",
    "submitter": {
        "id": 65295,
        "url": "http://patchwork.ozlabs.org/api/people/65295/?format=api",
        "name": "Yousong Zhou",
        "email": "yszhou4tech@gmail.com"
    },
    "delegate": {
        "id": 54624,
        "url": "http://patchwork.ozlabs.org/api/users/54624/?format=api",
        "username": "yousong",
        "first_name": "Yousong",
        "last_name": "Zhou",
        "email": "yszhou4tech@gmail.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/openwrt/patch/20190608155442.16632-1-yszhou4tech@gmail.com/mbox/",
    "series": [
        {
            "id": 112624,
            "url": "http://patchwork.ozlabs.org/api/series/112624/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/openwrt/list/?series=112624",
            "date": "2019-06-08T15:54:41",
            "name": "[OpenWrt-Devel,1/2] generic: support mtd-mac-address-ascii",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/112624/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1112495/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1112495/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org\n\t(client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org;\n\tenvelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=gmail.com",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"DgB0tfxW\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"W8lWbVpf\"; dkim-atps=neutral"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n\t[IPv6:2607:7c80:54:e::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (4096 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 45LkWl6RJPz9s9y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun,  9 Jun 2019 01:55:47 +1000 (AEST)",
            "from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux))\n\tid 1hZdgk-0006Mh-9m; Sat, 08 Jun 2019 15:55:26 +0000",
            "from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544])\n\tby bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux))\n\tid 1hZdgg-0006Lp-8b\n\tfor openwrt-devel@lists.openwrt.org; Sat, 08 Jun 2019 15:55:24 +0000",
            "by mail-pg1-x544.google.com with SMTP id s27so2739737pgl.2\n\tfor <openwrt-devel@lists.openwrt.org>;\n\tSat, 08 Jun 2019 08:55:21 -0700 (PDT)",
            "from titan.hq.cloud.yunionyun.com\n\t(165.116.92.34.bc.googleusercontent.com. [34.92.116.165])\n\tby smtp.gmail.com with ESMTPSA id\n\td19sm5004249pjs.22.2019.06.08.08.55.16\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSat, 08 Jun 2019 08:55:19 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To\n\t:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:\n\tResent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:\n\tList-Owner; bh=0PU7zXxDmE+9IK1D16ldENyN4wjeqs2SNpaL+xvMHsM=;\n\tb=DgB0tfxW8ghZ/r\n\ttpt//q9EgKYLfmGKv/0VzdOUI9o5XKsWTVDZbHpfV8LYplnAfNSpliE/FhQfrsYhJ0vgAM4yYGOqf\n\tZP1wDOe3Ed5SfMSFEE2SmcxzYNHXZd70hf6E8kStDY6hvFzaNo9V+RL6Br8ui7FEgcnFAZrExvfOq\n\tWEmmiaqlfw+PAPYnyY4rKn1QUUZ8CrhxELWchwZSZ80LbYFCiDTY9sVrwI7dM0ePC3CubHTGKoADf\n\trt3S4XeUKKGYmuQT7sUpubJBlL9N220NYKTIHVhKBw9DLLa5Bn+wX8b646WfPY/X6JEnn4PRLlJF8\n\ttD1TdPAcD8Otq18bi3gA==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=vRuSzZJ2udnIanvxPfht+IotIMgE8IeO6sgC0whkc7w=;\n\tb=W8lWbVpf7u+9jN+kkb57WK2rAJxKaqg/d80y5CSgK+2WxVYibc3qkBs//EaIrkFr5E\n\tIvvkaYNCI2UfH7SrJz7Y8vTliU6fAGC5R2XQKwbXPsSVCILfUChgPU8lCQU56F1OP18r\n\tqQYCv9ocQmCT42Lc9uR0HZ8cJiM1MRXYLSM5wk5wHCrHwEO/Ca+dhIImu5jBlzbonekk\n\tod+iCZHoeCWA+ImOd6a3+I5Ial2xsOZuNucgX85j8CKE7s2hZEtqtN5e9lc/B8oSAc+t\n\t2zVCHHjwFdJmN70uh0fh7g0CUVYYpXuXLcPWu6JCShGgkCxke1iAVqcNnisLN3Jo9wbB\n\tChVQ=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=vRuSzZJ2udnIanvxPfht+IotIMgE8IeO6sgC0whkc7w=;\n\tb=k0qw/dxQWlUOqMBHT6qHeEAOcBFVXBh4Ab3NPZE2BNS1RS37MWNgQlg9dnwJ73op2A\n\t+l9B/NaM9bYcuwQHUNytwDVdnoSSib3p8+tM6Z234Ur0Fpgrw31tmqLrSLYms5yQeb5a\n\tWBHXXjZ7R0szAyhDamksBPlDFh6r0f3fAtDLsj5n6Tz+jy0mngn2VNyZ6KP62pBUOCQz\n\tASIStThDY6YKve7P/rubyP/g45hJia1zHk9Abq3P3ZLTRlVykGb5OcGGzckigo+zumvL\n\tZd781Bw48Y0YVNIDhqECFspIoGb78IRBO1+8z/2kTMrRMvCwZS2spPG6CKgmagWjRjJS\n\tMN4A==",
        "X-Gm-Message-State": "APjAAAX+1TnYGc1QrLW6rdIME00ngdztKRWmwBRoOoYKmqtgCSBAcf9Y\n\tc8vCn28ZTSqTO4UNAyfg3Ww=",
        "X-Google-Smtp-Source": "APXvYqz7+Bq6bnHreW9SXbPQy4XzsnnWcopQoBFKXRTrq4KIu/dHi3j8cXC6mG/lbHtQy0NeqJ7skQ==",
        "X-Received": "by 2002:a63:6ec6:: with SMTP id\n\tj189mr2484465pgc.168.1560009320628; \n\tSat, 08 Jun 2019 08:55:20 -0700 (PDT)",
        "From": "Yousong Zhou <yszhou4tech@gmail.com>",
        "To": "ynezz@true.cz",
        "Date": "Sat,  8 Jun 2019 15:54:41 +0000",
        "Message-Id": "<20190608155442.16632-1-yszhou4tech@gmail.com>",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20190608_085522_336964_C2BD6669 ",
        "X-CRM114-Status": "GOOD (  12.45  )",
        "X-Spam-Score": "-0.2 (/)",
        "X-Spam-Report": "SpamAssassin version 3.4.2 on bombadil.infradead.org summary:\n\tContent analysis details:   (-0.2 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/,\n\tno trust [2607:f8b0:4864:20:0:0:0:544 listed in]\n\t[list.dnswl.org]\n\t0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n\tprovider (yszhou4tech[at]gmail.com)\n\t0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from\n\tenvelope-from domain\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.0 T_FILL_THIS_FORM_SHORT Fill in a short form with personal\n\tinformation",
        "Subject": "[OpenWrt-Devel] [PATCH 1/2] generic: support mtd-mac-address-ascii",
        "X-BeenThere": "openwrt-devel@lists.openwrt.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<openwrt-devel.lists.openwrt.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/openwrt-devel>, \n\t<mailto:openwrt-devel-request@lists.openwrt.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/openwrt-devel/>",
        "List-Post": "<mailto:openwrt-devel@lists.openwrt.org>",
        "List-Help": "<mailto:openwrt-devel-request@lists.openwrt.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/openwrt-devel>, \n\t<mailto:openwrt-devel-request@lists.openwrt.org?subject=subscribe>",
        "Cc": "Yousong Zhou <yszhou4tech@gmail.com>, openwrt-devel@lists.openwrt.org",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"openwrt-devel\" <openwrt-devel-bounces@lists.openwrt.org>",
        "Errors-To": "openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org"
    },
    "content": "It supports formats of both 001122334455 and 00:11:22:33:44:55\n\nSigned-off-by: Yousong Zhou <yszhou4tech@gmail.com>\n---\n ...et-sched-Introduce-act_ctinfo-action.patch |  18 ----\n ...et-sched-Introduce-act_ctinfo-action.patch |  20 ----\n .../generic/hack-4.9/220-gc_sections.patch    |   2 +-\n .../681-NET-add-of_get_mac_address_mtd.patch  |  94 ++++++++++++----\n .../681-NET-add-of_get_mac_address_mtd.patch  |  94 ++++++++++++----\n .../681-NET-add-of_get_mac_address_mtd.patch  | 100 ++++++++++++++----\n 6 files changed, 229 insertions(+), 99 deletions(-)",
    "diff": "diff --git a/target/linux/generic/backport-4.14/380-v5.3-net-sched-Introduce-act_ctinfo-action.patch b/target/linux/generic/backport-4.14/380-v5.3-net-sched-Introduce-act_ctinfo-action.patch\nindex 26063985c0..cd729a93b1 100644\n--- a/target/linux/generic/backport-4.14/380-v5.3-net-sched-Introduce-act_ctinfo-action.patch\n+++ b/target/linux/generic/backport-4.14/380-v5.3-net-sched-Introduce-act_ctinfo-action.patch\n@@ -55,9 +55,6 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>\n  create mode 100644 include/uapi/linux/tc_act/tc_ctinfo.h\n  create mode 100644 net/sched/act_ctinfo.c\n \n-diff --git a/include/net/tc_act/tc_ctinfo.h b/include/net/tc_act/tc_ctinfo.h\n-new file mode 100644\n-index 000000000000..d6a688571672\n --- /dev/null\n +++ b/include/net/tc_act/tc_ctinfo.h\n @@ -0,0 +1,28 @@\n@@ -89,8 +86,6 @@ index 000000000000..d6a688571672\n +#define to_ctinfo(a) ((struct tcf_ctinfo *)a)\n +\n +#endif /* __NET_TC_CTINFO_H */\n-diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h\n-index 46c506615f4a..408b02fbb34a 100644\n --- a/include/uapi/linux/pkt_cls.h\n +++ b/include/uapi/linux/pkt_cls.h\n @@ -66,7 +66,8 @@ enum {\n@@ -103,9 +98,6 @@ index 46c506615f4a..408b02fbb34a 100644\n  };\n  \n  #define TCA_ID_MAX __TCA_ID_MAX\n-diff --git a/include/uapi/linux/tc_act/tc_ctinfo.h b/include/uapi/linux/tc_act/tc_ctinfo.h\n-new file mode 100644\n-index 000000000000..da803e05a89b\n --- /dev/null\n +++ b/include/uapi/linux/tc_act/tc_ctinfo.h\n @@ -0,0 +1,34 @@\n@@ -143,8 +135,6 @@ index 000000000000..da803e05a89b\n +};\n +\n +#endif\n-diff --git a/net/sched/Kconfig b/net/sched/Kconfig\n-index e70ed26485a2..962d90f72f54 100644\n --- a/net/sched/Kconfig\n +++ b/net/sched/Kconfig\n @@ -808,6 +808,19 @@ config NET_ACT_CONNMARK\n@@ -167,8 +157,6 @@ index e70ed26485a2..962d90f72f54 100644\n  config NET_ACT_SKBMOD\n          tristate \"skb data modification action\"\n          depends on NET_CLS_ACT\n-diff --git a/net/sched/Makefile b/net/sched/Makefile\n-index 9e43a4721ef8..44ee5b87b895 100644\n --- a/net/sched/Makefile\n +++ b/net/sched/Makefile\n @@ -21,6 +21,7 @@ obj-$(CONFIG_NET_ACT_CSUM)\t+= act_csum.o\n@@ -179,9 +167,6 @@ index 9e43a4721ef8..44ee5b87b895 100644\n  obj-$(CONFIG_NET_ACT_SKBMOD)\t+= act_skbmod.o\n  obj-$(CONFIG_NET_ACT_IFE)\t+= act_ife.o\n  obj-$(CONFIG_NET_IFE_SKBMARK)\t+= act_meta_mark.o\n-diff --git a/net/sched/act_ctinfo.c b/net/sched/act_ctinfo.c\n-new file mode 100644\n-index 000000000000..e65344e32801\n --- /dev/null\n +++ b/net/sched/act_ctinfo.c\n @@ -0,0 +1,394 @@\n@@ -579,6 +564,3 @@ index 000000000000..e65344e32801\n +MODULE_AUTHOR(\"Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>\");\n +MODULE_DESCRIPTION(\"Conntrack mark to DSCP restoring\");\n +MODULE_LICENSE(\"GPL\");\n--- \n-2.20.1 (Apple Git-117)\n-\ndiff --git a/target/linux/generic/backport-4.19/380-v5.3-net-sched-Introduce-act_ctinfo-action.patch b/target/linux/generic/backport-4.19/380-v5.3-net-sched-Introduce-act_ctinfo-action.patch\nindex 632f41ef98..cc4a621bb4 100644\n--- a/target/linux/generic/backport-4.19/380-v5.3-net-sched-Introduce-act_ctinfo-action.patch\n+++ b/target/linux/generic/backport-4.19/380-v5.3-net-sched-Introduce-act_ctinfo-action.patch\n@@ -71,9 +71,6 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>\n  create mode 100644 include/uapi/linux/tc_act/tc_ctinfo.h\n  create mode 100644 net/sched/act_ctinfo.c\n \n-diff --git a/include/net/tc_act/tc_ctinfo.h b/include/net/tc_act/tc_ctinfo.h\n-new file mode 100644\n-index 000000000000..d6a688571672\n --- /dev/null\n +++ b/include/net/tc_act/tc_ctinfo.h\n @@ -0,0 +1,28 @@\n@@ -105,8 +102,6 @@ index 000000000000..d6a688571672\n +#define to_ctinfo(a) ((struct tcf_ctinfo *)a)\n +\n +#endif /* __NET_TC_CTINFO_H */\n-diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h\n-index be382fb0592d..71e10c5a96a0 100644\n --- a/include/uapi/linux/pkt_cls.h\n +++ b/include/uapi/linux/pkt_cls.h\n @@ -68,7 +68,8 @@ enum {\n@@ -119,9 +114,6 @@ index be382fb0592d..71e10c5a96a0 100644\n  };\n  \n  #define TCA_ID_MAX __TCA_ID_MAX\n-diff --git a/include/uapi/linux/tc_act/tc_ctinfo.h b/include/uapi/linux/tc_act/tc_ctinfo.h\n-new file mode 100644\n-index 000000000000..da803e05a89b\n --- /dev/null\n +++ b/include/uapi/linux/tc_act/tc_ctinfo.h\n @@ -0,0 +1,34 @@\n@@ -159,8 +151,6 @@ index 000000000000..da803e05a89b\n +};\n +\n +#endif\n-diff --git a/net/sched/Kconfig b/net/sched/Kconfig\n-index e95741388311..1d79d5dba6e4 100644\n --- a/net/sched/Kconfig\n +++ b/net/sched/Kconfig\n @@ -866,6 +866,23 @@ config NET_ACT_CONNMARK\n@@ -187,8 +177,6 @@ index e95741388311..1d79d5dba6e4 100644\n  config NET_ACT_SKBMOD\n          tristate \"skb data modification action\"\n          depends on NET_CLS_ACT\n-diff --git a/net/sched/Makefile b/net/sched/Makefile\n-index f0403f49edcb..bb3c2bc44af7 100644\n --- a/net/sched/Makefile\n +++ b/net/sched/Makefile\n @@ -21,6 +21,7 @@ obj-$(CONFIG_NET_ACT_CSUM)\t+= act_csum.o\n@@ -199,9 +187,6 @@ index f0403f49edcb..bb3c2bc44af7 100644\n  obj-$(CONFIG_NET_ACT_SKBMOD)\t+= act_skbmod.o\n  obj-$(CONFIG_NET_ACT_IFE)\t+= act_ife.o\n  obj-$(CONFIG_NET_IFE_SKBMARK)\t+= act_meta_mark.o\n-diff --git a/net/sched/act_ctinfo.c b/net/sched/act_ctinfo.c\n-new file mode 100644\n-index 000000000000..8975cb4976aa\n --- /dev/null\n +++ b/net/sched/act_ctinfo.c\n @@ -0,0 +1,395 @@\n@@ -600,8 +585,6 @@ index 000000000000..8975cb4976aa\n +MODULE_AUTHOR(\"Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>\");\n +MODULE_DESCRIPTION(\"Connection tracking mark actions\");\n +MODULE_LICENSE(\"GPL\");\n-diff --git a/tools/testing/selftests/tc-testing/config b/tools/testing/selftests/tc-testing/config\n-index 203302065458..9d1fddcfb887 100644\n --- a/tools/testing/selftests/tc-testing/config\n +++ b/tools/testing/selftests/tc-testing/config\n @@ -37,6 +37,7 @@ CONFIG_NET_ACT_SKBEDIT=m\n@@ -612,6 +595,3 @@ index 203302065458..9d1fddcfb887 100644\n  CONFIG_NET_ACT_CONNMARK=m\n  CONFIG_NET_ACT_SKBMOD=m\n  CONFIG_NET_ACT_IFE=m\n--- \n-2.20.1 (Apple Git-117)\n-\ndiff --git a/target/linux/generic/hack-4.9/220-gc_sections.patch b/target/linux/generic/hack-4.9/220-gc_sections.patch\nindex 732e38aaf0..945220ea06 100644\n--- a/target/linux/generic/hack-4.9/220-gc_sections.patch\n+++ b/target/linux/generic/hack-4.9/220-gc_sections.patch\n@@ -22,7 +22,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>\n --- a/Makefile\n +++ b/Makefile\n @@ -401,6 +401,11 @@ KBUILD_CFLAGS_MODULE  := -DMODULE\n- KBUILD_LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds $(if $(CONFIG_PROFILING),,-s)\n+ KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds\n  GCC_PLUGINS_CFLAGS :=\n  \n +ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION\ndiff --git a/target/linux/generic/pending-4.14/681-NET-add-of_get_mac_address_mtd.patch b/target/linux/generic/pending-4.14/681-NET-add-of_get_mac_address_mtd.patch\nindex 2b89a05238..301cd87ded 100644\n--- a/target/linux/generic/pending-4.14/681-NET-add-of_get_mac_address_mtd.patch\n+++ b/target/linux/generic/pending-4.14/681-NET-add-of_get_mac_address_mtd.patch\n@@ -32,17 +32,62 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>\n  {\n  \tstruct property *pp = of_find_property(np, name, NULL);\n  \n-@@ -47,6 +48,79 @@ static const void *of_get_mac_addr(struc\n+@@ -47,6 +48,133 @@ static const void *of_get_mac_addr(struc\n  \treturn NULL;\n  }\n  \n++typedef int(*mtd_mac_address_read)(struct mtd_info *mtd, loff_t from, u_char *buf);\n++\n++static int read_mtd_mac_address(struct mtd_info *mtd, loff_t from, u_char *mac)\n++{\n++\tint retlen;\n++\n++\treturn mtd_read(mtd, from, 6, &retlen, mac);\n++}\n++\n++static int read_mtd_mac_address_ascii(struct mtd_info *mtd, loff_t from, u_char *mac)\n++{\n++\tint retlen;\n++\tchar buf[17];\n++\n++\tif (mtd_read(mtd, from, 12, &retlen, buf)) {\n++\t\treturn -1;\n++\t}\n++\tif (sscanf(buf, \"%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx\",\n++\t\t\t&mac[0], &mac[1], &mac[2], &mac[3],\n++\t\t\t&mac[4], &mac[5]) == 6) {\n++\t\treturn 0;\n++\t}\n++\tif (mtd_read(mtd, from+12, 5, &retlen, buf+12)) {\n++\t\treturn -1;\n++\t}\n++\tif (sscanf(buf, \"%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx\",\n++\t\t\t&mac[0], &mac[1], &mac[2], &mac[3],\n++\t\t\t&mac[4], &mac[5]) == 6) {\n++\t\treturn 0;\n++\t}\n++\treturn -1;\n++}\n++\n++static struct mtd_mac_address_property {\n++\tchar *name;\n++\tmtd_mac_address_read read;\n++} mtd_mac_address_properties[] = {\n++\t{\n++\t\t.name = \"mtd-mac-address\",\n++\t\t.read = read_mtd_mac_address,\n++\t}, {\n++\t\t.name = \"mtd-mac-address-ascii\",\n++\t\t.read = read_mtd_mac_address_ascii,\n++\t},\n++};\n++\n +static const void *of_get_mac_address_mtd(struct device_node *np)\n +{\n +#ifdef CONFIG_MTD\n +\tstruct device_node *mtd_np = NULL;\n +\tstruct property *prop;\n-+\tsize_t retlen;\n-+\tint size, ret;\n++\tint size, ret = -1;\n +\tstruct mtd_info *mtd;\n +\tconst char *part;\n +\tconst __be32 *list;\n@@ -51,28 +96,37 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>\n +\tu8 mac[ETH_ALEN];\n +\tvoid *addr;\n +\tu32 inc_idx;\n++\tint i;\n +\n-+\tlist = of_get_property(np, \"mtd-mac-address\", &size);\n-+\tif (!list || (size != (2 * sizeof(*list))))\n-+\t\treturn NULL;\n++\tfor (i = 0; i < ARRAY_SIZE(mtd_mac_address_properties); i++) {\n++\t\tlist = of_get_property(np, mtd_mac_address_properties[i].name, &size);\n++\t\tif (!list || (size != (2 * sizeof(*list))))\n++\t\t\tcontinue;\n +\n-+\tphandle = be32_to_cpup(list++);\n-+\tif (phandle)\n-+\t\tmtd_np = of_find_node_by_phandle(phandle);\n++\t\tphandle = be32_to_cpup(list++);\n++\t\tif (phandle)\n++\t\t\tmtd_np = of_find_node_by_phandle(phandle);\n +\n-+\tif (!mtd_np)\n-+\t\treturn NULL;\n++\t\tif (!mtd_np)\n++\t\t\tcontinue;\n +\n-+\tpart = of_get_property(mtd_np, \"label\", NULL);\n-+\tif (!part)\n-+\t\tpart = mtd_np->name;\n++\t\tpart = of_get_property(mtd_np, \"label\", NULL);\n++\t\tif (!part)\n++\t\t\tpart = mtd_np->name;\n +\n-+\tmtd = get_mtd_device_nm(part);\n-+\tif (IS_ERR(mtd))\n-+\t\treturn NULL;\n++\t\tmtd = get_mtd_device_nm(part);\n++\t\tif (IS_ERR(mtd))\n++\t\t\tcontinue;\n +\n-+\tret = mtd_read(mtd, be32_to_cpup(list), 6, &retlen, mac);\n-+\tput_mtd_device(mtd);\n++\t\tret = mtd_mac_address_properties[i].read(mtd, be32_to_cpup(list), mac);\n++\t\tput_mtd_device(mtd);\n++\t\tif (!ret) {\n++\t\t\tbreak;\n++\t\t}\n++\t}\n++\tif (ret) {\n++\t\treturn NULL;\n++\t}\n +\n +\tif (of_property_read_u32(np, \"mtd-mac-address-increment-byte\", &inc_idx))\n +\t\tinc_idx = 5;\n@@ -112,7 +166,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>\n  /**\n   * Search the device tree for the best MAC address to use.  'mac-address' is\n   * checked first, because that is supposed to contain to \"most recent\" MAC\n-@@ -64,11 +138,18 @@ static const void *of_get_mac_addr(struc\n+@@ -64,11 +192,18 @@ static const void *of_get_mac_addr(struc\n   * addresses.  Some older U-Boots only initialized 'local-mac-address'.  In\n   * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists\n   * but is all zeros.\ndiff --git a/target/linux/generic/pending-4.19/681-NET-add-of_get_mac_address_mtd.patch b/target/linux/generic/pending-4.19/681-NET-add-of_get_mac_address_mtd.patch\nindex 13f5640590..fa019eab00 100644\n--- a/target/linux/generic/pending-4.19/681-NET-add-of_get_mac_address_mtd.patch\n+++ b/target/linux/generic/pending-4.19/681-NET-add-of_get_mac_address_mtd.patch\n@@ -32,17 +32,62 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>\n  {\n  \tstruct property *pp = of_find_property(np, name, NULL);\n  \n-@@ -48,6 +49,79 @@ static const void *of_get_mac_addr(struc\n+@@ -48,6 +49,133 @@ static const void *of_get_mac_addr(struc\n  \treturn NULL;\n  }\n  \n++typedef int(*mtd_mac_address_read)(struct mtd_info *mtd, loff_t from, u_char *buf);\n++\n++static int read_mtd_mac_address(struct mtd_info *mtd, loff_t from, u_char *mac)\n++{\n++\tint retlen;\n++\n++\treturn mtd_read(mtd, from, 6, &retlen, mac);\n++}\n++\n++static int read_mtd_mac_address_ascii(struct mtd_info *mtd, loff_t from, u_char *mac)\n++{\n++\tint retlen;\n++\tchar buf[17];\n++\n++\tif (mtd_read(mtd, from, 12, &retlen, buf)) {\n++\t\treturn -1;\n++\t}\n++\tif (sscanf(buf, \"%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx\",\n++\t\t\t&mac[0], &mac[1], &mac[2], &mac[3],\n++\t\t\t&mac[4], &mac[5]) == 6) {\n++\t\treturn 0;\n++\t}\n++\tif (mtd_read(mtd, from+12, 5, &retlen, buf+12)) {\n++\t\treturn -1;\n++\t}\n++\tif (sscanf(buf, \"%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx\",\n++\t\t\t&mac[0], &mac[1], &mac[2], &mac[3],\n++\t\t\t&mac[4], &mac[5]) == 6) {\n++\t\treturn 0;\n++\t}\n++\treturn -1;\n++}\n++\n++static struct mtd_mac_address_property {\n++\tchar *name;\n++\tmtd_mac_address_read read;\n++} mtd_mac_address_properties[] = {\n++\t{\n++\t\t.name = \"mtd-mac-address\",\n++\t\t.read = read_mtd_mac_address,\n++\t}, {\n++\t\t.name = \"mtd-mac-address-ascii\",\n++\t\t.read = read_mtd_mac_address_ascii,\n++\t},\n++};\n++\n +static const void *of_get_mac_address_mtd(struct device_node *np)\n +{\n +#ifdef CONFIG_MTD\n +\tstruct device_node *mtd_np = NULL;\n +\tstruct property *prop;\n-+\tsize_t retlen;\n-+\tint size, ret;\n++\tint size, ret = -1;\n +\tstruct mtd_info *mtd;\n +\tconst char *part;\n +\tconst __be32 *list;\n@@ -51,28 +96,37 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>\n +\tu8 mac[ETH_ALEN];\n +\tvoid *addr;\n +\tu32 inc_idx;\n++\tint i;\n +\n-+\tlist = of_get_property(np, \"mtd-mac-address\", &size);\n-+\tif (!list || (size != (2 * sizeof(*list))))\n-+\t\treturn NULL;\n++\tfor (i = 0; i < ARRAY_SIZE(mtd_mac_address_properties); i++) {\n++\t\tlist = of_get_property(np, mtd_mac_address_properties[i].name, &size);\n++\t\tif (!list || (size != (2 * sizeof(*list))))\n++\t\t\tcontinue;\n +\n-+\tphandle = be32_to_cpup(list++);\n-+\tif (phandle)\n-+\t\tmtd_np = of_find_node_by_phandle(phandle);\n++\t\tphandle = be32_to_cpup(list++);\n++\t\tif (phandle)\n++\t\t\tmtd_np = of_find_node_by_phandle(phandle);\n +\n-+\tif (!mtd_np)\n-+\t\treturn NULL;\n++\t\tif (!mtd_np)\n++\t\t\tcontinue;\n +\n-+\tpart = of_get_property(mtd_np, \"label\", NULL);\n-+\tif (!part)\n-+\t\tpart = mtd_np->name;\n++\t\tpart = of_get_property(mtd_np, \"label\", NULL);\n++\t\tif (!part)\n++\t\t\tpart = mtd_np->name;\n +\n-+\tmtd = get_mtd_device_nm(part);\n-+\tif (IS_ERR(mtd))\n-+\t\treturn NULL;\n++\t\tmtd = get_mtd_device_nm(part);\n++\t\tif (IS_ERR(mtd))\n++\t\t\tcontinue;\n +\n-+\tret = mtd_read(mtd, be32_to_cpup(list), 6, &retlen, mac);\n-+\tput_mtd_device(mtd);\n++\t\tret = mtd_mac_address_properties[i].read(mtd, be32_to_cpup(list), mac);\n++\t\tput_mtd_device(mtd);\n++\t\tif (!ret) {\n++\t\t\tbreak;\n++\t\t}\n++\t}\n++\tif (ret) {\n++\t\treturn NULL;\n++\t}\n +\n +\tif (of_property_read_u32(np, \"mtd-mac-address-increment-byte\", &inc_idx))\n +\t\tinc_idx = 5;\n@@ -112,7 +166,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>\n  /**\n   * Search the device tree for the best MAC address to use.  'mac-address' is\n   * checked first, because that is supposed to contain to \"most recent\" MAC\n-@@ -65,11 +139,18 @@ static const void *of_get_mac_addr(struc\n+@@ -65,11 +193,18 @@ static const void *of_get_mac_addr(struc\n   * addresses.  Some older U-Boots only initialized 'local-mac-address'.  In\n   * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists\n   * but is all zeros.\ndiff --git a/target/linux/generic/pending-4.9/681-NET-add-of_get_mac_address_mtd.patch b/target/linux/generic/pending-4.9/681-NET-add-of_get_mac_address_mtd.patch\nindex b29b5f11b0..301cd87ded 100644\n--- a/target/linux/generic/pending-4.9/681-NET-add-of_get_mac_address_mtd.patch\n+++ b/target/linux/generic/pending-4.9/681-NET-add-of_get_mac_address_mtd.patch\n@@ -32,17 +32,62 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>\n  {\n  \tstruct property *pp = of_find_property(np, name, NULL);\n  \n-@@ -47,6 +48,73 @@ static const void *of_get_mac_addr(struc\n+@@ -47,6 +48,133 @@ static const void *of_get_mac_addr(struc\n  \treturn NULL;\n  }\n  \n++typedef int(*mtd_mac_address_read)(struct mtd_info *mtd, loff_t from, u_char *buf);\n++\n++static int read_mtd_mac_address(struct mtd_info *mtd, loff_t from, u_char *mac)\n++{\n++\tint retlen;\n++\n++\treturn mtd_read(mtd, from, 6, &retlen, mac);\n++}\n++\n++static int read_mtd_mac_address_ascii(struct mtd_info *mtd, loff_t from, u_char *mac)\n++{\n++\tint retlen;\n++\tchar buf[17];\n++\n++\tif (mtd_read(mtd, from, 12, &retlen, buf)) {\n++\t\treturn -1;\n++\t}\n++\tif (sscanf(buf, \"%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx\",\n++\t\t\t&mac[0], &mac[1], &mac[2], &mac[3],\n++\t\t\t&mac[4], &mac[5]) == 6) {\n++\t\treturn 0;\n++\t}\n++\tif (mtd_read(mtd, from+12, 5, &retlen, buf+12)) {\n++\t\treturn -1;\n++\t}\n++\tif (sscanf(buf, \"%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx\",\n++\t\t\t&mac[0], &mac[1], &mac[2], &mac[3],\n++\t\t\t&mac[4], &mac[5]) == 6) {\n++\t\treturn 0;\n++\t}\n++\treturn -1;\n++}\n++\n++static struct mtd_mac_address_property {\n++\tchar *name;\n++\tmtd_mac_address_read read;\n++} mtd_mac_address_properties[] = {\n++\t{\n++\t\t.name = \"mtd-mac-address\",\n++\t\t.read = read_mtd_mac_address,\n++\t}, {\n++\t\t.name = \"mtd-mac-address-ascii\",\n++\t\t.read = read_mtd_mac_address_ascii,\n++\t},\n++};\n++\n +static const void *of_get_mac_address_mtd(struct device_node *np)\n +{\n +#ifdef CONFIG_MTD\n +\tstruct device_node *mtd_np = NULL;\n +\tstruct property *prop;\n-+\tsize_t retlen;\n-+\tint size, ret;\n++\tint size, ret = -1;\n +\tstruct mtd_info *mtd;\n +\tconst char *part;\n +\tconst __be32 *list;\n@@ -50,31 +95,46 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>\n +\tu32 mac_inc = 0;\n +\tu8 mac[ETH_ALEN];\n +\tvoid *addr;\n++\tu32 inc_idx;\n++\tint i;\n +\n-+\tlist = of_get_property(np, \"mtd-mac-address\", &size);\n-+\tif (!list || (size != (2 * sizeof(*list))))\n-+\t\treturn NULL;\n++\tfor (i = 0; i < ARRAY_SIZE(mtd_mac_address_properties); i++) {\n++\t\tlist = of_get_property(np, mtd_mac_address_properties[i].name, &size);\n++\t\tif (!list || (size != (2 * sizeof(*list))))\n++\t\t\tcontinue;\n +\n-+\tphandle = be32_to_cpup(list++);\n-+\tif (phandle)\n-+\t\tmtd_np = of_find_node_by_phandle(phandle);\n++\t\tphandle = be32_to_cpup(list++);\n++\t\tif (phandle)\n++\t\t\tmtd_np = of_find_node_by_phandle(phandle);\n +\n-+\tif (!mtd_np)\n-+\t\treturn NULL;\n++\t\tif (!mtd_np)\n++\t\t\tcontinue;\n++\n++\t\tpart = of_get_property(mtd_np, \"label\", NULL);\n++\t\tif (!part)\n++\t\t\tpart = mtd_np->name;\n +\n-+\tpart = of_get_property(mtd_np, \"label\", NULL);\n-+\tif (!part)\n-+\t\tpart = mtd_np->name;\n++\t\tmtd = get_mtd_device_nm(part);\n++\t\tif (IS_ERR(mtd))\n++\t\t\tcontinue;\n +\n-+\tmtd = get_mtd_device_nm(part);\n-+\tif (IS_ERR(mtd))\n++\t\tret = mtd_mac_address_properties[i].read(mtd, be32_to_cpup(list), mac);\n++\t\tput_mtd_device(mtd);\n++\t\tif (!ret) {\n++\t\t\tbreak;\n++\t\t}\n++\t}\n++\tif (ret) {\n +\t\treturn NULL;\n++\t}\n +\n-+\tret = mtd_read(mtd, be32_to_cpup(list), 6, &retlen, mac);\n-+\tput_mtd_device(mtd);\n++\tif (of_property_read_u32(np, \"mtd-mac-address-increment-byte\", &inc_idx))\n++\t\tinc_idx = 5;\n++\tif (inc_idx > 5)\n++\t\treturn NULL;\n +\n +\tif (!of_property_read_u32(np, \"mtd-mac-address-increment\", &mac_inc))\n-+\t\tmac[5] += mac_inc;\n++\t\tmac[inc_idx] += mac_inc;\n +\n +\tif (!is_valid_ether_addr(mac))\n +\t\treturn NULL;\n@@ -106,7 +166,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>\n  /**\n   * Search the device tree for the best MAC address to use.  'mac-address' is\n   * checked first, because that is supposed to contain to \"most recent\" MAC\n-@@ -64,11 +132,18 @@ static const void *of_get_mac_addr(struc\n+@@ -64,11 +192,18 @@ static const void *of_get_mac_addr(struc\n   * addresses.  Some older U-Boots only initialized 'local-mac-address'.  In\n   * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists\n   * but is all zeros.\n",
    "prefixes": [
        "OpenWrt-Devel",
        "1/2"
    ]
}