Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/50156/?format=api
https://patches.dpdk.org/api/patches/50156/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190206141015.4adedb33@hermes.lan/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20190206141015.4adedb33@hermes.lan>", "list_archive_url": "https://inbox.dpdk.org/dev/20190206141015.4adedb33@hermes.lan", "date": "2019-02-06T22:10:15", "name": "fslmc: remove unneeded strdup", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "2a0922111973aaf703392fe13bc5ce0ca19d132a", "submitter": { "id": 27, "url": "https://patches.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190206141015.4adedb33@hermes.lan/mbox/", "series": [ { "id": 3402, "url": "https://patches.dpdk.org/api/series/3402/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=3402", "date": "2019-02-06T22:10:15", "name": "fslmc: remove unneeded strdup", "version": 1, "mbox": "https://patches.dpdk.org/series/3402/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/50156/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/50156/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7E1781B468;\n\tWed, 6 Feb 2019 23:10:26 +0100 (CET)", "from mail-pg1-f196.google.com (mail-pg1-f196.google.com\n\t[209.85.215.196]) by dpdk.org (Postfix) with ESMTP id CB5FD1B450\n\tfor <dev@dpdk.org>; Wed, 6 Feb 2019 23:10:24 +0100 (CET)", "by mail-pg1-f196.google.com with SMTP id g189so3548267pgc.5\n\tfor <dev@dpdk.org>; Wed, 06 Feb 2019 14:10:24 -0800 (PST)", "from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\ta90sm10975959pfj.109.2019.02.06.14.10.23 for <dev@dpdk.org>\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 06 Feb 2019 14:10:23 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:subject:message-id:in-reply-to:references:mime-version\n\t:content-transfer-encoding;\n\tbh=sdYjYddmLrJQjqE6Xr/qMTu4XKmN9zNltihbvbMPtsg=;\n\tb=vyEFMjySNKS48Kw8bKCyu9Cxq+RpScoCEfx4bl2w63o0HOe1wN8BtdM/Q/G0FIKu0O\n\tp5apHNhlK9wGD9J2rhoK7s3jVMYlG6ycV2Uhhr51kH3d6SFpG09X6xZNK80Z0IEMP9vn\n\t8D4rYmbD9pj1EoHg++NiKIjbw2QGYDOqmVjkq26cowlm++vjxVdVB7rySjU9smcx4/A8\n\ty7Jcn0CcHxxwQ//zELo30q6Ng11ZJJgSz7Q0cBzkp1WrrjUX9xIsk0+ZBRkTQa4VFBaz\n\t2fVJzZ4PBhZAZ6H4x0eEsRdAYTMQ6FnaRWnCUJ1wVjqnCKuCGewRb9qAOqnnSJHXyD8X\n\t4hgg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:subject:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=sdYjYddmLrJQjqE6Xr/qMTu4XKmN9zNltihbvbMPtsg=;\n\tb=hBFgdHUvQWoyhBCYm5AOZLAlQw9r+ZuonOdsqd6Um2N4gGbmx2chaKJA2oQcs5GKWW\n\tIvAud3YJuMzZatAAttu/dBE9YIbCpwxDfxpV8K0Z5XYMHpOHb+y1FIpfbmBT+GsyQ4td\n\tFAjhFcr3eM+WU2MmP1Dlbim6bdM9g4yK6oXo/ROcyTfzI/SQWGYAxL4Ckh5z6Wgs++x8\n\tWW4uG7aM4J6d4coaCN6kfdheHzbAJReJOfUXRYpVAD09SBG8GbGj2bG45smewzMuSf8A\n\tXvZm/ZwUeD0t58JXf2aijyTg5FOzlg8yQs8XHSaR8RCUPs2QejcrxkiuSdrZhHIt8u9D\n\tsNZw==", "X-Gm-Message-State": "AHQUAubw4CTLa2AhuJZ2JBP2FI7j1MOUd7rYV6e6jbJ3g9k4d0dQb5sc\n\tPwqsXj0jyhAHb+q3Y1Nv7FmZL3RkgzY=", "X-Google-Smtp-Source": "AHgI3IZ2L39UIhDvoN4+ZO+bU/q/GQ5cc0uqjAggaqrQXXOtl8HyJEGzQw6Ym2Ih1y9HztISZwpEgw==", "X-Received": "by 2002:a62:2fc3:: with SMTP id\n\tv186mr12844958pfv.82.1549491023762; \n\tWed, 06 Feb 2019 14:10:23 -0800 (PST)", "Date": "Wed, 6 Feb 2019 14:10:15 -0800", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "dev@dpdk.org", "Message-ID": "<20190206141015.4adedb33@hermes.lan>", "In-Reply-To": "<20190206220414.9450-1-stephen@networkplumber.org>", "References": "<20190206220414.9450-1-stephen@networkplumber.org>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=US-ASCII", "Content-Transfer-Encoding": "7bit", "Subject": "[dpdk-dev] [PATCH] fslmc: remove unneeded strdup", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "The fslmc bus code was duplicating the device name and\ndoing extra initialization. The code can be simplified\nto just use the device name directly.\n\nCompile tested only; do not have this hardware.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\nThis patch assumes the previous log fix.\nSince it is only a cleanup does not need to go to stable.\n\n drivers/bus/fslmc/fslmc_bus.c | 38 +++++++++++------------------------\n 1 file changed, 12 insertions(+), 26 deletions(-)", "diff": "diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c\nindex a2525780cd08..eaa39a2093e0 100644\n--- a/drivers/bus/fslmc/fslmc_bus.c\n+++ b/drivers/bus/fslmc/fslmc_bus.c\n@@ -229,49 +229,35 @@ static int\n rte_fslmc_parse(const char *name, void *addr)\n {\n \tuint16_t dev_id;\n-\tchar *t_ptr = NULL, *dname = NULL;\n+\tchar *t_ptr;\n \n \t/* 'name' is expected to contain name of device, for example, dpio.1,\n \t * dpni.2, etc.\n \t */\n-\n-\tdname = strdup(name);\n-\tif (!dname)\n-\t\treturn -EINVAL;\n-\tt_ptr = dname;\n-\n-\tif (strncmp(\"dpni\", t_ptr, 4) &&\n-\t strncmp(\"dpseci\", t_ptr, 6) &&\n-\t strncmp(\"dpcon\", t_ptr, 5) &&\n-\t strncmp(\"dpbp\", t_ptr, 4) &&\n-\t strncmp(\"dpio\", t_ptr, 4) &&\n-\t strncmp(\"dpci\", t_ptr, 4) &&\n-\t strncmp(\"dpmcp\", t_ptr, 5) &&\n-\t strncmp(\"dpdmai\", t_ptr, 6) &&\n-\t strncmp(\"dpdmux\", t_ptr, 6)) {\n+\tif (strncmp(\"dpni\", name, 4) &&\n+\t strncmp(\"dpseci\", name, 6) &&\n+\t strncmp(\"dpcon\", name, 5) &&\n+\t strncmp(\"dpbp\", name, 4) &&\n+\t strncmp(\"dpio\", name, 4) &&\n+\t strncmp(\"dpci\", name, 4) &&\n+\t strncmp(\"dpmcp\", name, 5) &&\n+\t strncmp(\"dpdmai\", name, 6) &&\n+\t strncmp(\"dpdmux\", name, 6)) {\n \t\tDPAA2_BUS_DEBUG(\"Unknown or unsupported device (%s)\", name);\n \t\tgoto err_out;\n \t}\n \n \tt_ptr = strchr(name, '.');\n-\tif (!t_ptr) {\n-\t\tDPAA2_BUS_ERR(\"Incorrect device string observed (%s)\", t_ptr);\n-\t\tgoto err_out;\n-\t}\n-\n-\tt_ptr = (char *)(t_ptr + 1);\n-\tif (sscanf(t_ptr, \"%hu\", &dev_id) <= 0) {\n-\t\tDPAA2_BUS_ERR(\"Incorrect device string observed (%s)\", t_ptr);\n+\tif (!t_ptr || sscanf(t_ptr + 1, \"%hu\", &dev_id) != 1) {\n+\t\tDPAA2_BUS_ERR(\"Missing device id in device name (%s)\", name);\n \t\tgoto err_out;\n \t}\n-\tfree(dname);\n \n \tif (addr)\n \t\tstrcpy(addr, name);\n \n \treturn 0;\n err_out:\n-\tfree(dname);\n \treturn -EINVAL;\n }\n \n", "prefixes": [] }{ "id": 50156, "url": "