Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/83656/?format=api
http://patches.dpdk.org/api/patches/83656/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201104070350.28224-5-stephen@networkplumber.org/", "project": { "id": 1, "url": "http://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": "<20201104070350.28224-5-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20201104070350.28224-5-stephen@networkplumber.org", "date": "2020-11-04T07:03:48", "name": "[v2,4/6] dpdk-devbind: do not use len(x) to test for empty", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "a23ea8f2d9e9831634daea996ccd7fdc6a781bab", "submitter": { "id": 27, "url": "http://patches.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20201104070350.28224-5-stephen@networkplumber.org/mbox/", "series": [ { "id": 13648, "url": "http://patches.dpdk.org/api/series/13648/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=13648", "date": "2020-11-04T07:03:44", "name": "dpdk-devbind: python lint cleanups", "version": 2, "mbox": "http://patches.dpdk.org/series/13648/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/83656/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/83656/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 97D6DA04E7;\n\tWed, 4 Nov 2020 08:05:09 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 1021AC820;\n\tWed, 4 Nov 2020 08:04:04 +0100 (CET)", "from mail-pl1-f181.google.com (mail-pl1-f181.google.com\n [209.85.214.181]) by dpdk.org (Postfix) with ESMTP id 6375BC800\n for <dev@dpdk.org>; Wed, 4 Nov 2020 08:04:00 +0100 (CET)", "by mail-pl1-f181.google.com with SMTP id p4so2520155plr.1\n for <dev@dpdk.org>; Tue, 03 Nov 2020 23:04:00 -0800 (PST)", "from hermes.corp.microsoft.com (204-195-22-127.wavecable.com.\n [204.195.22.127])\n by smtp.gmail.com with ESMTPSA id z21sm1181177pfa.158.2020.11.03.23.03.56\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 03 Nov 2020 23:03:57 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=HVmy6jIyBJ3FxEhLvU+pl0hzRKROkGn/d3GPRV8rMps=;\n b=RBYmDP44cfeKkhwst0B+dFIuDh+OwCQIybFt1PKEs6XuaHIfIq/zBNBTiLhiUz6Xbf\n 9OWhkn0fCwxRK9BMBGho31zGuDyxCUdkLsEPMb/i7em/Ey/b/QVP8c/37nm+y4V161fH\n +/z/Wy6bGKXhko+v+cZoCs4z2uLUk1L9/t3aSlA0ZTAAcPC11BMj+aXafWtnXawpqbsQ\n zHKotGus1d5oD2KnIhKPYjuy6R7iC2NTOJal2eJnXyT3b2PNbKIQrdHCIyv1tmZ5YHno\n 05MfTFc+R4DAKtFGGlPglFnCsnVzZyLBNaeDhTEwR6EKwoerm0uUjVaFLXNTpUf8Okcv\n b79g==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=HVmy6jIyBJ3FxEhLvU+pl0hzRKROkGn/d3GPRV8rMps=;\n b=bT4DSrqvMLJxnDqPubBfpaMqge+ZPwxfjI7XvAbMaq956COZeTGrEo9hag6XgvaXhq\n PO7/TndQO4GpUSkh2gia5M9FYMoFAU0SuLv/rMJVnBaLp7Ss3YvdMujnorq+xuSuIR/1\n CC32eB53g9FlEYpJd2bK3TrnnWe47HoEKq+9XrtHRy8u+kNtt3EacHef6MtCCebNEwN/\n snl7kcDchJQZGgG3cA7gHpjeDAw0+ERUx9hgnw2b0gS7A+ngwK4RSrxgvv/06xltvXC4\n 8Op7mgOSInMC3uBz8sFmD5uWw4Ip2+AYKYSEFKsfRWOXZQRTxd4udr7F/DazpchwRsVM\n iy8g==", "X-Gm-Message-State": "AOAM531BSnJVatkmYfkzOwEzavt83qvxk2YgqvFyvh91K5t/e9PXQX1g\n /17sCoFwyv3qQ1xF05K4FJnZSF/X6lm0HlN5", "X-Google-Smtp-Source": "\n ABdhPJyGXOWSoKHRStYeH2Lyv2SKf8wgV5sv5w93OlUblzsxkHfeCSJFkIKz9t2hkMiXmMNeOkVGrQ==", "X-Received": "by 2002:a17:902:82c3:b029:d6:c377:c87d with SMTP id\n u3-20020a17090282c3b02900d6c377c87dmr14917077plz.37.1604473438098;\n Tue, 03 Nov 2020 23:03:58 -0800 (PST)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "dev@dpdk.org", "Cc": "Stephen Hemminger <stephen@networkplumber.org>", "Date": "Tue, 3 Nov 2020 23:03:48 -0800", "Message-Id": "<20201104070350.28224-5-stephen@networkplumber.org>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20201104070350.28224-1-stephen@networkplumber.org>", "References": "<20200906013133.26360-12-stephen@networkplumber.org>\n <20201104070350.28224-1-stephen@networkplumber.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v2 4/6] dpdk-devbind: do not use len(x) to test\n\tfor empty", "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Python lint warns about using len(SEQUENCE) to determine if sequence is empty.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n usertools/dpdk-devbind.py | 14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)", "diff": "diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py\nindex 4148b66b6841..afe93a217d79 100755\n--- a/usertools/dpdk-devbind.py\n+++ b/usertools/dpdk-devbind.py\n@@ -143,7 +143,7 @@ def get_pci_device_details(dev_id, probe_lspci):\n extra_info = subprocess.check_output([\"lspci\", \"-vmmks\", dev_id]).splitlines()\n # parse lspci details\n for line in extra_info:\n- if len(line) == 0:\n+ if not line:\n continue\n name, value = line.decode(\"utf8\").split(\"\\t\", 1)\n name = name.strip(\":\") + \"_str\"\n@@ -178,7 +178,7 @@ def get_device_details(devices_type):\n dev = {}\n dev_lines = subprocess.check_output([\"lspci\", \"-Dvmmnnk\"]).splitlines()\n for dev_line in dev_lines:\n- if len(dev_line) == 0:\n+ if not dev_line:\n if device_type_match(dev, devices_type):\n # Replace \"Driver\" with \"Driver_str\" to have consistency of\n # of dictionary key names\n@@ -193,7 +193,7 @@ def get_device_details(devices_type):\n else:\n name, value = dev_line.decode(\"utf8\").split(\"\\t\", 1)\n value_list = value.rsplit(' ', 1)\n- if len(value_list) > 1:\n+ if value_list:\n # String stored in <name>_str\n dev[name.rstrip(\":\") + '_str'] = value_list[0]\n # Numeric IDs\n@@ -496,7 +496,7 @@ def display_devices(title, dev_list, extra_params=None):\n strings = [] # this holds the strings to print. We sort before printing\n print(\"\\n%s\" % title)\n print(\"=\"*len(title))\n- if len(dev_list) == 0:\n+ if not dev_list:\n strings.append(\"<none>\")\n else:\n for dev in dev_list:\n@@ -539,17 +539,17 @@ def show_device_status(devices_type, device_name, if_field=False):\n return\n \n # print each category separately, so we can clearly see what's used by DPDK\n- if len(dpdk_drv) != 0:\n+ if dpdk_drv:\n display_devices(\"%s devices using DPDK-compatible driver\" % device_name,\n dpdk_drv, \"drv=%(Driver_str)s unused=%(Module_str)s\")\n- if len(kernel_drv) != 0:\n+ if kernel_drv:\n if_text = \"\"\n if if_field:\n if_text = \"if=%(Interface)s \"\n display_devices(\"%s devices using kernel driver\" % device_name, kernel_drv,\n if_text + \"drv=%(Driver_str)s \"\n \"unused=%(Module_str)s %(Active)s\")\n- if len(no_drv) != 0:\n+ if no_drv:\n display_devices(\"Other %s devices\" % device_name, no_drv,\n \"unused=%(Module_str)s\")\n \n", "prefixes": [ "v2", "4/6" ] }{ "id": 83656, "url": "