Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/808692/?format=api
{ "id": 808692, "url": "http://patchwork.ozlabs.org/api/patches/808692/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170901134431.23179-1-colin.king@canonical.com/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170901134431.23179-1-colin.king@canonical.com>", "list_archive_url": null, "date": "2017-09-01T13:44:31", "name": "qlcnic: remove redundant zero check on retries counter", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "eaa950f303f2cb80b2520f1341b3111d0f667fb4", "submitter": { "id": 2900, "url": "http://patchwork.ozlabs.org/api/people/2900/?format=api", "name": "Colin Ian King", "email": "colin.king@canonical.com" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170901134431.23179-1-colin.king@canonical.com/mbox/", "series": [ { "id": 1032, "url": "http://patchwork.ozlabs.org/api/series/1032/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=1032", "date": "2017-09-01T13:44:31", "name": "qlcnic: remove redundant zero check on retries counter", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/1032/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/808692/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/808692/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xkL8C5227z9t2d\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 1 Sep 2017 23:44:43 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752175AbdIANof (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 1 Sep 2017 09:44:35 -0400", "from youngberry.canonical.com ([91.189.89.112]:42087 \"EHLO\n\tyoungberry.canonical.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751983AbdIANoe (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 1 Sep 2017 09:44:34 -0400", "from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost)\n\tby youngberry.canonical.com with esmtpsa\n\t(TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76)\n\t(envelope-from <colin.king@canonical.com>)\n\tid 1dnmFM-0006dk-Eq; Fri, 01 Sep 2017 13:44:32 +0000" ], "From": "Colin King <colin.king@canonical.com>", "To": "Harish Patil <harish.patil@cavium.com>,\n\tManish Chopra <manish.chopra@cavium.com>,\n\tDept-GELinuxNICDev@cavium.com, netdev@vger.kernel.org", "Cc": "kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org", "Subject": "[PATCH] qlcnic: remove redundant zero check on retries counter", "Date": "Fri, 1 Sep 2017 14:44:31 +0100", "Message-Id": "<20170901134431.23179-1-colin.king@canonical.com>", "X-Mailer": "git-send-email 2.14.1", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "8bit", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "From: Colin Ian King <colin.king@canonical.com>\n\nAt the end of the do while loop the integer counter retries will\nalways be zero and so the subsequent check to see if it is zero\nis always true and therefore redundant. Remove the redundant check\nand always return -EIO on this return path. Also unbreak the literal\nstring in dev_err message to clean up a checkpatch warning.\n\nDetected by CoverityScan, CID#744279 (\"Logically dead code\")\n\nSigned-off-by: Colin Ian King <colin.king@canonical.com>\n---\n drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c | 10 +++-------\n 1 file changed, 3 insertions(+), 7 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c\nindex be41e4c77b65..c48a0e2d4d7e 100644\n--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c\n+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c\n@@ -592,13 +592,9 @@ qlcnic_receive_peg_ready(struct qlcnic_adapter *adapter)\n \n \t} while (--retries);\n \n-\tif (!retries) {\n-\t\tdev_err(&adapter->pdev->dev, \"Receive Peg initialization not \"\n-\t\t\t \"complete, state: 0x%x.\\n\", val);\n-\t\treturn -EIO;\n-\t}\n-\n-\treturn 0;\n+\tdev_err(&adapter->pdev->dev, \"Receive Peg initialization not complete, state: 0x%x.\\n\",\n+\t\tval);\n+\treturn -EIO;\n }\n \n int\n", "prefixes": [] }