get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 597213,
    "url": "http://patchwork.ozlabs.org/api/patches/597213/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160314180557.8397.64521.stgit@mdrustad-wks.jf.intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20160314180557.8397.64521.stgit@mdrustad-wks.jf.intel.com>",
    "list_archive_url": null,
    "date": "2016-03-14T18:05:57",
    "name": "[V2,4/5] ixgbe: Clean up interface for firmware commands",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "d8f451e458bedbc9965c992dfc1783e32fdb786b",
    "submitter": {
        "id": 13252,
        "url": "http://patchwork.ozlabs.org/api/people/13252/?format=api",
        "name": "Rustad, Mark D",
        "email": "mark.d.rustad@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160314180557.8397.64521.stgit@mdrustad-wks.jf.intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/597213/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/597213/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Received": [
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ozlabs.org (Postfix) with ESMTP id 3qP5KG3s8vz9sdt\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 15 Mar 2016 05:06:10 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id B912F90FC9;\n\tMon, 14 Mar 2016 18:06:09 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id PBa6yG6B9IUn; Mon, 14 Mar 2016 18:06:07 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id F214C90F9B;\n\tMon, 14 Mar 2016 18:06:06 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id A65D11C0BA9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 14 Mar 2016 18:06:03 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 87B59A5C06\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 14 Mar 2016 18:06:03 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id RiiwGgs67Mkw for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 14 Mar 2016 18:05:58 +0000 (UTC)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 58DFF89ECD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 14 Mar 2016 18:05:58 +0000 (UTC)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby orsmga103.jf.intel.com with ESMTP; 14 Mar 2016 11:05:57 -0700",
            "from mdrustad-wks.jf.intel.com ([134.134.3.229])\n\tby fmsmga002.fm.intel.com with ESMTP; 14 Mar 2016 11:05:57 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.24,336,1455004800\"; d=\"scan'208\";a=\"936875553\"",
        "From": "Mark D Rustad <mark.d.rustad@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Mon, 14 Mar 2016 11:05:57 -0700",
        "Message-ID": "<20160314180557.8397.64521.stgit@mdrustad-wks.jf.intel.com>",
        "In-Reply-To": "<20160314180316.8397.65394.stgit@mdrustad-wks.jf.intel.com>",
        "References": "<20160314180316.8397.65394.stgit@mdrustad-wks.jf.intel.com>",
        "User-Agent": "StGit/unknown-version",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH V2 4/5] ixgbe: Clean up interface for\n\tfirmware commands",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "Clean up the interface for issuing firmware commands to use a\nvoid * instead of a u32 *. This eliminates a number of casts.\nAlso clean up ixgbe_host_interface_command in a few other ways,\neliminating comparisons with 0, redundant parens and minor\nformatting issues.\n\nSigned-off-by: Mark Rustad <mark.d.rustad@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_common.c |   39 ++++++++++++-----------\n drivers/net/ethernet/intel/ixgbe/ixgbe_common.h |    4 +-\n drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c   |   13 +++-----\n 3 files changed, 28 insertions(+), 28 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c\nindex a2ca9ef0daab..b8cdff7fe673 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c\n@@ -3483,15 +3483,19 @@ static u8 ixgbe_calculate_checksum(u8 *buffer, u32 length)\n  *  Communicates with the manageability block.  On success return 0\n  *  else return IXGBE_ERR_HOST_INTERFACE_COMMAND.\n  **/\n-s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,\n+s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer,\n \t\t\t\t u32 length, u32 timeout,\n \t\t\t\t bool return_data)\n {\n-\tu32 hicr, i, bi, fwsts;\n \tu32 hdr_size = sizeof(struct ixgbe_hic_hdr);\n+\tu32 hicr, i, bi, fwsts;\n \tu16 buf_len, dword_len;\n+\tunion {\n+\t\tstruct ixgbe_hic_hdr hdr;\n+\t\tu32 u32arr[1];\n+\t} *bp = buffer;\n \n-\tif (length == 0 || length > IXGBE_HI_MAX_BLOCK_BYTE_LENGTH) {\n+\tif (!length || length > IXGBE_HI_MAX_BLOCK_BYTE_LENGTH) {\n \t\thw_dbg(hw, \"Buffer length failure buffersize-%d.\\n\", length);\n \t\treturn IXGBE_ERR_HOST_INTERFACE_COMMAND;\n \t}\n@@ -3502,26 +3506,25 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,\n \n \t/* Check that the host interface is enabled. */\n \thicr = IXGBE_READ_REG(hw, IXGBE_HICR);\n-\tif ((hicr & IXGBE_HICR_EN) == 0) {\n+\tif (!(hicr & IXGBE_HICR_EN)) {\n \t\thw_dbg(hw, \"IXGBE_HOST_EN bit disabled.\\n\");\n \t\treturn IXGBE_ERR_HOST_INTERFACE_COMMAND;\n \t}\n \n \t/* Calculate length in DWORDs. We must be DWORD aligned */\n-\tif ((length % (sizeof(u32))) != 0) {\n+\tif (length % sizeof(u32)) {\n \t\thw_dbg(hw, \"Buffer length failure, not aligned to dword\");\n \t\treturn IXGBE_ERR_INVALID_ARGUMENT;\n \t}\n \n \tdword_len = length >> 2;\n \n-\t/*\n-\t * The device driver writes the relevant command block\n+\t/* The device driver writes the relevant command block\n \t * into the ram area.\n \t */\n \tfor (i = 0; i < dword_len; i++)\n \t\tIXGBE_WRITE_REG_ARRAY(hw, IXGBE_FLEX_MNG,\n-\t\t\t\t      i, cpu_to_le32(buffer[i]));\n+\t\t\t\t      i, cpu_to_le32(bp->u32arr[i]));\n \n \t/* Setting this bit tells the ARC that a new command is pending. */\n \tIXGBE_WRITE_REG(hw, IXGBE_HICR, hicr | IXGBE_HICR_C);\n@@ -3534,8 +3537,8 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,\n \t}\n \n \t/* Check command successful completion. */\n-\tif ((timeout != 0 && i == timeout) ||\n-\t    (!(IXGBE_READ_REG(hw, IXGBE_HICR) & IXGBE_HICR_SV))) {\n+\tif ((timeout && i == timeout) ||\n+\t    !(IXGBE_READ_REG(hw, IXGBE_HICR) & IXGBE_HICR_SV)) {\n \t\thw_dbg(hw, \"Command has failed with no status valid.\\n\");\n \t\treturn IXGBE_ERR_HOST_INTERFACE_COMMAND;\n \t}\n@@ -3548,13 +3551,13 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,\n \n \t/* first pull in the header so we know the buffer length */\n \tfor (bi = 0; bi < dword_len; bi++) {\n-\t\tbuffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);\n-\t\tle32_to_cpus(&buffer[bi]);\n+\t\tbp->u32arr[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);\n+\t\tle32_to_cpus(&bp->u32arr[bi]);\n \t}\n \n \t/* If there is any thing in data position pull it in */\n-\tbuf_len = ((struct ixgbe_hic_hdr *)buffer)->buf_len;\n-\tif (buf_len == 0)\n+\tbuf_len = bp->hdr.buf_len;\n+\tif (!buf_len)\n \t\treturn 0;\n \n \tif (length < round_up(buf_len, 4) + hdr_size) {\n@@ -3565,10 +3568,10 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,\n \t/* Calculate length in DWORDs, add 3 for odd lengths */\n \tdword_len = (buf_len + 3) >> 2;\n \n-\t/* Pull in the rest of the buffer (bi is where we left off)*/\n+\t/* Pull in the rest of the buffer (bi is where we left off) */\n \tfor (; bi <= dword_len; bi++) {\n-\t\tbuffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);\n-\t\tle32_to_cpus(&buffer[bi]);\n+\t\tbp->u32arr[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);\n+\t\tle32_to_cpus(&bp->u32arr[bi]);\n \t}\n \n \treturn 0;\n@@ -3612,7 +3615,7 @@ s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,\n \tfw_cmd.pad2 = 0;\n \n \tfor (i = 0; i <= FW_CEM_MAX_RETRIES; i++) {\n-\t\tret_val = ixgbe_host_interface_command(hw, (u32 *)&fw_cmd,\n+\t\tret_val = ixgbe_host_interface_command(hw, &fw_cmd,\n \t\t\t\t\t\t       sizeof(fw_cmd),\n \t\t\t\t\t\t       IXGBE_HI_COMMAND_TIMEOUT,\n \t\t\t\t\t\t       true);\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h\nindex 2e290150ab54..6f8e6a56e242 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h\n@@ -111,8 +111,8 @@ void ixgbe_set_vlan_anti_spoofing(struct ixgbe_hw *hw, bool enable, int vf);\n s32 ixgbe_get_device_caps_generic(struct ixgbe_hw *hw, u16 *device_caps);\n s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,\n \t\t\t\t u8 build, u8 ver);\n-s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,\n-\t\t\t\t u32 length, u32 timeout, bool return_data);\n+s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *, u32 length,\n+\t\t\t\t u32 timeout, bool return_data);\n void ixgbe_clear_tx_pending(struct ixgbe_hw *hw);\n bool ixgbe_mng_present(struct ixgbe_hw *hw);\n bool ixgbe_mng_enabled(struct ixgbe_hw *hw);\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\nindex 5affac123b75..65832fa30426 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\n@@ -437,8 +437,7 @@ static s32 ixgbe_read_ee_hostif_data_X550(struct ixgbe_hw *hw, u16 offset,\n \t/* one word */\n \tbuffer.length = cpu_to_be16(sizeof(u16));\n \n-\tstatus = ixgbe_host_interface_command(hw, (u32 *)&buffer,\n-\t\t\t\t\t      sizeof(buffer),\n+\tstatus = ixgbe_host_interface_command(hw, &buffer, sizeof(buffer),\n \t\t\t\t\t      IXGBE_HI_COMMAND_TIMEOUT, false);\n \tif (status)\n \t\treturn status;\n@@ -488,7 +487,7 @@ static s32 ixgbe_read_ee_hostif_buffer_X550(struct ixgbe_hw *hw,\n \t\tbuffer.address = cpu_to_be32((offset + current_word) * 2);\n \t\tbuffer.length = cpu_to_be16(words_to_read * 2);\n \n-\t\tstatus = ixgbe_host_interface_command(hw, (u32 *)&buffer,\n+\t\tstatus = ixgbe_host_interface_command(hw, &buffer,\n \t\t\t\t\t\t      sizeof(buffer),\n \t\t\t\t\t\t      IXGBE_HI_COMMAND_TIMEOUT,\n \t\t\t\t\t\t      false);\n@@ -771,8 +770,7 @@ static s32 ixgbe_write_ee_hostif_data_X550(struct ixgbe_hw *hw, u16 offset,\n \tbuffer.data = data;\n \tbuffer.address = cpu_to_be32(offset * 2);\n \n-\tstatus = ixgbe_host_interface_command(hw, (u32 *)&buffer,\n-\t\t\t\t\t      sizeof(buffer),\n+\tstatus = ixgbe_host_interface_command(hw, &buffer, sizeof(buffer),\n \t\t\t\t\t      IXGBE_HI_COMMAND_TIMEOUT, false);\n \treturn status;\n }\n@@ -814,8 +812,7 @@ static s32 ixgbe_update_flash_X550(struct ixgbe_hw *hw)\n \tbuffer.req.buf_lenl = FW_SHADOW_RAM_DUMP_LEN;\n \tbuffer.req.checksum = FW_DEFAULT_CHECKSUM;\n \n-\tstatus = ixgbe_host_interface_command(hw, (u32 *)&buffer,\n-\t\t\t\t\t      sizeof(buffer),\n+\tstatus = ixgbe_host_interface_command(hw, &buffer, sizeof(buffer),\n \t\t\t\t\t      IXGBE_HI_COMMAND_TIMEOUT, false);\n \treturn status;\n }\n@@ -864,7 +861,7 @@ static void ixgbe_disable_rx_x550(struct ixgbe_hw *hw)\n \t\tfw_cmd.hdr.checksum = FW_DEFAULT_CHECKSUM;\n \t\tfw_cmd.port_number = hw->bus.lan_id;\n \n-\t\tstatus = ixgbe_host_interface_command(hw, (u32 *)&fw_cmd,\n+\t\tstatus = ixgbe_host_interface_command(hw, &fw_cmd,\n \t\t\t\t\tsizeof(struct ixgbe_hic_disable_rxen),\n \t\t\t\t\tIXGBE_HI_COMMAND_TIMEOUT, true);\n \n",
    "prefixes": [
        "V2",
        "4/5"
    ]
}