get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1319417,
    "url": "http://patchwork.ozlabs.org/api/patches/1319417/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200630002746.64140-1-anthony.l.nguyen@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": "<20200630002746.64140-1-anthony.l.nguyen@intel.com>",
    "list_archive_url": null,
    "date": "2020-06-30T00:27:45",
    "name": "[1/2] ice: avoid unnecessary single-member variable-length structs",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "6eff3a39a82f18dd83393f26e1587efc3131d94b",
    "submitter": {
        "id": 68875,
        "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api",
        "name": "Tony Nguyen",
        "email": "anthony.l.nguyen@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/20200630002746.64140-1-anthony.l.nguyen@intel.com/mbox/",
    "series": [
        {
            "id": 186543,
            "url": "http://patchwork.ozlabs.org/api/series/186543/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=186543",
            "date": "2020-06-30T00:27:46",
            "name": "[1/2] ice: avoid unnecessary single-member variable-length structs",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/186543/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1319417/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1319417/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@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"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.137; helo=fraxinus.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=<UNKNOWN>)",
            "ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 49wlfK2KHxz9sQx\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 30 Jun 2020 10:31:37 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id DDDF0874FB;\n\tTue, 30 Jun 2020 00:31:35 +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 NftY191x5Ont; Tue, 30 Jun 2020 00:31:32 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 02709870B2;\n\tTue, 30 Jun 2020 00:31:30 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n by ash.osuosl.org (Postfix) with ESMTP id 7981B1BF2CD\n for <intel-wired-lan@lists.osuosl.org>; Tue, 30 Jun 2020 00:31:28 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by whitealder.osuosl.org (Postfix) with ESMTP id 75C3B8852D\n for <intel-wired-lan@lists.osuosl.org>; Tue, 30 Jun 2020 00:31:28 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id DF6AfS1DPyQQ for <intel-wired-lan@lists.osuosl.org>;\n Tue, 30 Jun 2020 00:31:23 +0000 (UTC)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by whitealder.osuosl.org (Postfix) with ESMTPS id 691D88851D\n for <intel-wired-lan@lists.osuosl.org>; Tue, 30 Jun 2020 00:31:23 +0000 (UTC)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 29 Jun 2020 17:31:22 -0700",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.241.65])\n by orsmga007.jf.intel.com with ESMTP; 29 Jun 2020 17:31:22 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "IronPort-SDR": [
            "\n vB3gbxqKRIk6DUnNOa8cyOJJPzjvcufD7o4bQwmPEN+ZVZM8EpKg4pTXFVzqnHrwCIQBUzvaHp\n mnakY72TfjaQ==",
            "\n c66dVHVldXRHG9zEZh65Mqkn7BQVx6GpSnRlPIYE88FI8CRvXmNDnI9Z6d8UiNLDNTwSEOJJ3+\n rNtelSCqstnA=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9666\"; a=\"147662195\"",
            "E=Sophos;i=\"5.75,296,1589266800\"; d=\"scan'208\";a=\"147662195\"",
            "E=Sophos;i=\"5.75,296,1589266800\"; d=\"scan'208\";a=\"320372872\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Tony Nguyen <anthony.l.nguyen@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Mon, 29 Jun 2020 17:27:45 -0700",
        "Message-Id": "<20200630002746.64140-1-anthony.l.nguyen@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH 1/2] ice: avoid unnecessary single-member\n variable-length structs",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "From: Bruce Allan <bruce.w.allan@intel.com>\n\nThere are a number of structures that consist of a one-element array as the\nonly struct member.  Some of those are unused so remove them. Others are\nused to index into a buffer/array consisting of a variable number of a\ndifferent data or structure type.  Those are unnecessary since we can use\nsimple pointer arithmetic or index directly into the buffer to access\nindividual elements of the buffer/array.\n\nAdditional code cleanups were done near areas affected by this change.\n\nSigned-off-by: Bruce Allan <bruce.w.allan@intel.com>\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\n .../net/ethernet/intel/ice/ice_adminq_cmd.h   | 39 +-----------\n drivers/net/ethernet/intel/ice/ice_common.c   | 29 ++++-----\n drivers/net/ethernet/intel/ice/ice_common.h   |  2 +-\n drivers/net/ethernet/intel/ice/ice_dcb.c      |  4 +-\n drivers/net/ethernet/intel/ice/ice_sched.c    | 61 ++++++++-----------\n drivers/net/ethernet/intel/ice/ice_sched.h    |  2 +-\n drivers/net/ethernet/intel/ice/ice_switch.c   | 14 ++---\n 7 files changed, 51 insertions(+), 100 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\nindex 92f82f2a8af4..a55dc1594daa 100644\n--- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\n+++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\n@@ -215,13 +215,6 @@ struct ice_aqc_get_sw_cfg_resp_elem {\n #define ICE_AQC_GET_SW_CONF_RESP_IS_VF\t\tBIT(15)\n };\n \n-/* The response buffer is as follows. Note that the length of the\n- * elements array varies with the length of the command response.\n- */\n-struct ice_aqc_get_sw_cfg_resp {\n-\tstruct ice_aqc_get_sw_cfg_resp_elem elements[1];\n-};\n-\n /* These resource type defines are used for all switch resource\n  * commands where a resource type is required, such as:\n  * Get Resource Allocation command (indirect 0x0204)\n@@ -695,14 +688,6 @@ struct ice_aqc_sched_elem_cmd {\n \t__le32 addr_low;\n };\n \n-/* This is the buffer for:\n- * Suspend Nodes (indirect 0x0409)\n- * Resume Nodes (indirect 0x040A)\n- */\n-struct ice_aqc_suspend_resume_elem {\n-\t__le32 teid[1];\n-};\n-\n struct ice_aqc_elem_info_bw {\n \t__le16 bw_profile_idx;\n \t__le16 bw_alloc;\n@@ -756,14 +741,6 @@ struct ice_aqc_add_elem {\n \tstruct ice_aqc_txsched_elem_data generic[1];\n };\n \n-struct ice_aqc_conf_elem {\n-\tstruct ice_aqc_txsched_elem_data generic[1];\n-};\n-\n-struct ice_aqc_get_elem {\n-\tstruct ice_aqc_txsched_elem_data generic[1];\n-};\n-\n struct ice_aqc_get_topo_elem {\n \tstruct ice_aqc_txsched_topo_grp_info_hdr hdr;\n \tstruct ice_aqc_txsched_elem_data\n@@ -835,10 +812,6 @@ struct ice_aqc_rl_profile_elem {\n \t__le16 rl_encode;\n };\n \n-struct ice_aqc_rl_profile_generic_elem {\n-\tstruct ice_aqc_rl_profile_elem generic[1];\n-};\n-\n /* Query Scheduler Resource Allocation (indirect 0x0412)\n  * This indirect command retrieves the scheduler resources allocated by\n  * EMP Firmware to the given PF.\n@@ -1584,10 +1557,6 @@ struct ice_aqc_dis_txq_item {\n \t\t\t(1 << ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S)\n };\n \n-struct ice_aqc_dis_txq {\n-\tstruct ice_aqc_dis_txq_item qgrps[1];\n-};\n-\n /* Configure Firmware Logging Command (indirect 0xFF09)\n  * Logging Information Read Response (indirect 0xFF10)\n  * Note: The 0xFF10 command has no input parameters.\n@@ -1636,12 +1605,7 @@ enum ice_aqc_fw_logging_mod {\n \tICE_AQC_FW_LOG_ID_MAX,\n };\n \n-/* This is the buffer for both of the logging commands.\n- * The entry array size depends on the datalen parameter in the descriptor.\n- * There will be a total of datalen / 2 entries.\n- */\n-struct ice_aqc_fw_logging_data {\n-\t__le16 entry[1];\n+/* Defines for both above FW logging command/response buffers */\n #define ICE_AQC_FW_LOG_ID_S\t\t0\n #define ICE_AQC_FW_LOG_ID_M\t\t(0xFFF << ICE_AQC_FW_LOG_ID_S)\n \n@@ -1654,7 +1618,6 @@ struct ice_aqc_fw_logging_data {\n #define ICE_AQC_FW_LOG_INIT_EN\t\tBIT(13)\t/* Used by command */\n #define ICE_AQC_FW_LOG_FLOW_EN\t\tBIT(14)\t/* Used by command */\n #define ICE_AQC_FW_LOG_ERR_EN\t\tBIT(15)\t/* Used by command */\n-};\n \n /* Get/Clear FW Log (indirect 0xFF11) */\n struct ice_aqc_get_clear_fw_log {\ndiff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c\nindex e3cb7bd1ecab..622ab1f0e18f 100644\n--- a/drivers/net/ethernet/intel/ice/ice_common.c\n+++ b/drivers/net/ethernet/intel/ice/ice_common.c\n@@ -440,30 +440,24 @@ static void ice_cleanup_fltr_mgmt_struct(struct ice_hw *hw)\n \tdevm_kfree(ice_hw_to_dev(hw), sw);\n }\n \n-#define ICE_FW_LOG_DESC_SIZE(n)\t(sizeof(struct ice_aqc_fw_logging_data) + \\\n-\t(((n) - 1) * sizeof(((struct ice_aqc_fw_logging_data *)0)->entry)))\n-#define ICE_FW_LOG_DESC_SIZE_MAX\t\\\n-\tICE_FW_LOG_DESC_SIZE(ICE_AQC_FW_LOG_ID_MAX)\n-\n /**\n  * ice_get_fw_log_cfg - get FW logging configuration\n  * @hw: pointer to the HW struct\n  */\n static enum ice_status ice_get_fw_log_cfg(struct ice_hw *hw)\n {\n-\tstruct ice_aqc_fw_logging_data *config;\n \tstruct ice_aq_desc desc;\n \tenum ice_status status;\n+\t__le16 *config;\n \tu16 size;\n \n-\tsize = ICE_FW_LOG_DESC_SIZE_MAX;\n+\tsize = sizeof(*config) * ICE_AQC_FW_LOG_ID_MAX;\n \tconfig = devm_kzalloc(ice_hw_to_dev(hw), size, GFP_KERNEL);\n \tif (!config)\n \t\treturn ICE_ERR_NO_MEMORY;\n \n \tice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_fw_logging_info);\n \n-\tdesc.flags |= cpu_to_le16(ICE_AQ_FLAG_BUF);\n \tdesc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);\n \n \tstatus = ice_aq_send_cmd(hw, &desc, config, size, NULL);\n@@ -474,7 +468,7 @@ static enum ice_status ice_get_fw_log_cfg(struct ice_hw *hw)\n \t\tfor (i = 0; i < ICE_AQC_FW_LOG_ID_MAX; i++) {\n \t\t\tu16 v, m, flgs;\n \n-\t\t\tv = le16_to_cpu(config->entry[i]);\n+\t\t\tv = le16_to_cpu(config[i]);\n \t\t\tm = (v & ICE_AQC_FW_LOG_ID_M) >> ICE_AQC_FW_LOG_ID_S;\n \t\t\tflgs = (v & ICE_AQC_FW_LOG_EN_M) >> ICE_AQC_FW_LOG_EN_S;\n \n@@ -526,11 +520,11 @@ static enum ice_status ice_get_fw_log_cfg(struct ice_hw *hw)\n  */\n static enum ice_status ice_cfg_fw_log(struct ice_hw *hw, bool enable)\n {\n-\tstruct ice_aqc_fw_logging_data *data = NULL;\n \tstruct ice_aqc_fw_logging *cmd;\n \tenum ice_status status = 0;\n \tu16 i, chgs = 0, len = 0;\n \tstruct ice_aq_desc desc;\n+\t__le16 *data = NULL;\n \tu8 actv_evnts = 0;\n \tvoid *buf = NULL;\n \n@@ -571,8 +565,9 @@ static enum ice_status ice_cfg_fw_log(struct ice_hw *hw, bool enable)\n \t\t\t\tcontinue;\n \n \t\t\tif (!data) {\n-\t\t\t\tdata = devm_kzalloc(ice_hw_to_dev(hw),\n-\t\t\t\t\t\t    ICE_FW_LOG_DESC_SIZE_MAX,\n+\t\t\t\tdata = devm_kcalloc(ice_hw_to_dev(hw),\n+\t\t\t\t\t\t    sizeof(*data),\n+\t\t\t\t\t\t    ICE_AQC_FW_LOG_ID_MAX,\n \t\t\t\t\t\t    GFP_KERNEL);\n \t\t\t\tif (!data)\n \t\t\t\t\treturn ICE_ERR_NO_MEMORY;\n@@ -580,7 +575,7 @@ static enum ice_status ice_cfg_fw_log(struct ice_hw *hw, bool enable)\n \n \t\t\tval = i << ICE_AQC_FW_LOG_ID_S;\n \t\t\tval |= hw->fw_log.evnts[i].cfg << ICE_AQC_FW_LOG_EN_S;\n-\t\t\tdata->entry[chgs++] = cpu_to_le16(val);\n+\t\t\tdata[chgs++] = cpu_to_le16(val);\n \t\t}\n \n \t\t/* Only enable FW logging if at least one module is specified.\n@@ -599,7 +594,7 @@ static enum ice_status ice_cfg_fw_log(struct ice_hw *hw, bool enable)\n \t\t\t\tcmd->log_ctrl |= ICE_AQC_FW_LOG_UART_EN;\n \n \t\t\tbuf = data;\n-\t\t\tlen = ICE_FW_LOG_DESC_SIZE(chgs);\n+\t\t\tlen = sizeof(*data) * chgs;\n \t\t\tdesc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD);\n \t\t}\n \t}\n@@ -629,7 +624,7 @@ static enum ice_status ice_cfg_fw_log(struct ice_hw *hw, bool enable)\n \t\t\t\tcontinue;\n \t\t\t}\n \n-\t\t\tv = le16_to_cpu(data->entry[i]);\n+\t\t\tv = le16_to_cpu(data[i]);\n \t\t\tm = (v & ICE_AQC_FW_LOG_ID_M) >> ICE_AQC_FW_LOG_ID_S;\n \t\t\thw->fw_log.evnts[m].cur = hw->fw_log.evnts[m].cfg;\n \t\t}\n@@ -3690,14 +3685,14 @@ ice_stat_update32(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,\n  */\n enum ice_status\n ice_sched_query_elem(struct ice_hw *hw, u32 node_teid,\n-\t\t     struct ice_aqc_get_elem *buf)\n+\t\t     struct ice_aqc_txsched_elem_data *buf)\n {\n \tu16 buf_size, num_elem_ret = 0;\n \tenum ice_status status;\n \n \tbuf_size = sizeof(*buf);\n \tmemset(buf, 0, buf_size);\n-\tbuf->generic[0].node_teid = cpu_to_le32(node_teid);\n+\tbuf->node_teid = cpu_to_le32(node_teid);\n \tstatus = ice_aq_query_sched_elems(hw, 1, buf, buf_size, &num_elem_ret,\n \t\t\t\t\t  NULL);\n \tif (status || num_elem_ret != 1)\ndiff --git a/drivers/net/ethernet/intel/ice/ice_common.h b/drivers/net/ethernet/intel/ice/ice_common.h\nindex e72529e9f022..d1238f43e872 100644\n--- a/drivers/net/ethernet/intel/ice/ice_common.h\n+++ b/drivers/net/ethernet/intel/ice/ice_common.h\n@@ -155,5 +155,5 @@ ice_stat_update32(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,\n \t\t  u64 *prev_stat, u64 *cur_stat);\n enum ice_status\n ice_sched_query_elem(struct ice_hw *hw, u32 node_teid,\n-\t\t     struct ice_aqc_get_elem *buf);\n+\t\t     struct ice_aqc_txsched_elem_data *buf);\n #endif /* _ICE_COMMON_H_ */\ndiff --git a/drivers/net/ethernet/intel/ice/ice_dcb.c b/drivers/net/ethernet/intel/ice/ice_dcb.c\nindex adb8dab765c8..2cecc9d08005 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb.c\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb.c\n@@ -1362,7 +1362,7 @@ ice_update_port_tc_tree_cfg(struct ice_port_info *pi,\n \t\t\t    struct ice_aqc_port_ets_elem *buf)\n {\n \tstruct ice_sched_node *node, *tc_node;\n-\tstruct ice_aqc_get_elem elem;\n+\tstruct ice_aqc_txsched_elem_data elem;\n \tenum ice_status status = 0;\n \tu32 teid1, teid2;\n \tu8 i, j;\n@@ -1404,7 +1404,7 @@ ice_update_port_tc_tree_cfg(struct ice_port_info *pi,\n \t\t/* new TC */\n \t\tstatus = ice_sched_query_elem(pi->hw, teid2, &elem);\n \t\tif (!status)\n-\t\t\tstatus = ice_sched_add_node(pi, 1, &elem.generic[0]);\n+\t\t\tstatus = ice_sched_add_node(pi, 1, &elem);\n \t\tif (status)\n \t\t\tbreak;\n \t\t/* update the TC number */\ndiff --git a/drivers/net/ethernet/intel/ice/ice_sched.c b/drivers/net/ethernet/intel/ice/ice_sched.c\nindex 0475134295e4..294257b4d138 100644\n--- a/drivers/net/ethernet/intel/ice/ice_sched.c\n+++ b/drivers/net/ethernet/intel/ice/ice_sched.c\n@@ -129,7 +129,7 @@ ice_aqc_send_sched_elem_cmd(struct ice_hw *hw, enum ice_adminq_opc cmd_opc,\n  */\n enum ice_status\n ice_aq_query_sched_elems(struct ice_hw *hw, u16 elems_req,\n-\t\t\t struct ice_aqc_get_elem *buf, u16 buf_size,\n+\t\t\t struct ice_aqc_txsched_elem_data *buf, u16 buf_size,\n \t\t\t u16 *elems_ret, struct ice_sq_cd *cd)\n {\n \treturn ice_aqc_send_sched_elem_cmd(hw, ice_aqc_opc_get_sched_elems,\n@@ -149,8 +149,8 @@ enum ice_status\n ice_sched_add_node(struct ice_port_info *pi, u8 layer,\n \t\t   struct ice_aqc_txsched_elem_data *info)\n {\n+\tstruct ice_aqc_txsched_elem_data elem;\n \tstruct ice_sched_node *parent;\n-\tstruct ice_aqc_get_elem elem;\n \tstruct ice_sched_node *node;\n \tenum ice_status status;\n \tstruct ice_hw *hw;\n@@ -195,7 +195,7 @@ ice_sched_add_node(struct ice_port_info *pi, u8 layer,\n \tnode->parent = parent;\n \tnode->tx_sched_layer = layer;\n \tparent->children[parent->num_children++] = node;\n-\tmemcpy(&node->info, &elem.generic[0], sizeof(node->info));\n+\tnode->info = elem;\n \treturn 0;\n }\n \n@@ -423,7 +423,7 @@ ice_aq_add_sched_elems(struct ice_hw *hw, u16 grps_req,\n  */\n static enum ice_status\n ice_aq_cfg_sched_elems(struct ice_hw *hw, u16 elems_req,\n-\t\t       struct ice_aqc_conf_elem *buf, u16 buf_size,\n+\t\t       struct ice_aqc_txsched_elem_data *buf, u16 buf_size,\n \t\t       u16 *elems_cfgd, struct ice_sq_cd *cd)\n {\n \treturn ice_aqc_send_sched_elem_cmd(hw, ice_aqc_opc_cfg_sched_elems,\n@@ -443,8 +443,7 @@ ice_aq_cfg_sched_elems(struct ice_hw *hw, u16 elems_req,\n  * Suspend scheduling elements (0x0409)\n  */\n static enum ice_status\n-ice_aq_suspend_sched_elems(struct ice_hw *hw, u16 elems_req,\n-\t\t\t   struct ice_aqc_suspend_resume_elem *buf,\n+ice_aq_suspend_sched_elems(struct ice_hw *hw, u16 elems_req, __le32 *buf,\n \t\t\t   u16 buf_size, u16 *elems_ret, struct ice_sq_cd *cd)\n {\n \treturn ice_aqc_send_sched_elem_cmd(hw, ice_aqc_opc_suspend_sched_elems,\n@@ -464,8 +463,7 @@ ice_aq_suspend_sched_elems(struct ice_hw *hw, u16 elems_req,\n  * resume scheduling elements (0x040A)\n  */\n static enum ice_status\n-ice_aq_resume_sched_elems(struct ice_hw *hw, u16 elems_req,\n-\t\t\t  struct ice_aqc_suspend_resume_elem *buf,\n+ice_aq_resume_sched_elems(struct ice_hw *hw, u16 elems_req, __le32 *buf,\n \t\t\t  u16 buf_size, u16 *elems_ret, struct ice_sq_cd *cd)\n {\n \treturn ice_aqc_send_sched_elem_cmd(hw, ice_aqc_opc_resume_sched_elems,\n@@ -506,9 +504,9 @@ static enum ice_status\n ice_sched_suspend_resume_elems(struct ice_hw *hw, u8 num_nodes, u32 *node_teids,\n \t\t\t       bool suspend)\n {\n-\tstruct ice_aqc_suspend_resume_elem *buf;\n \tu16 i, buf_size, num_elem_ret = 0;\n \tenum ice_status status;\n+\t__le32 *buf;\n \n \tbuf_size = sizeof(*buf) * num_nodes;\n \tbuf = devm_kzalloc(ice_hw_to_dev(hw), buf_size, GFP_KERNEL);\n@@ -516,7 +514,7 @@ ice_sched_suspend_resume_elems(struct ice_hw *hw, u8 num_nodes, u32 *node_teids,\n \t\treturn ICE_ERR_NO_MEMORY;\n \n \tfor (i = 0; i < num_nodes; i++)\n-\t\tbuf->teid[i] = cpu_to_le32(node_teids[i]);\n+\t\tbuf[i] = cpu_to_le32(node_teids[i]);\n \n \tif (suspend)\n \t\tstatus = ice_aq_suspend_sched_elems(hw, num_nodes, buf,\n@@ -591,7 +589,7 @@ ice_alloc_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 new_numqs)\n  */\n static enum ice_status\n ice_aq_rl_profile(struct ice_hw *hw, enum ice_adminq_opc opcode,\n-\t\t  u16 num_profiles, struct ice_aqc_rl_profile_generic_elem *buf,\n+\t\t  u16 num_profiles, struct ice_aqc_rl_profile_elem *buf,\n \t\t  u16 buf_size, u16 *num_processed, struct ice_sq_cd *cd)\n {\n \tstruct ice_aqc_rl_profile *cmd;\n@@ -622,13 +620,11 @@ ice_aq_rl_profile(struct ice_hw *hw, enum ice_adminq_opc opcode,\n  */\n static enum ice_status\n ice_aq_add_rl_profile(struct ice_hw *hw, u16 num_profiles,\n-\t\t      struct ice_aqc_rl_profile_generic_elem *buf,\n-\t\t      u16 buf_size, u16 *num_profiles_added,\n-\t\t      struct ice_sq_cd *cd)\n+\t\t      struct ice_aqc_rl_profile_elem *buf, u16 buf_size,\n+\t\t      u16 *num_profiles_added, struct ice_sq_cd *cd)\n {\n-\treturn ice_aq_rl_profile(hw, ice_aqc_opc_add_rl_profiles,\n-\t\t\t\t num_profiles, buf,\n-\t\t\t\t buf_size, num_profiles_added, cd);\n+\treturn ice_aq_rl_profile(hw, ice_aqc_opc_add_rl_profiles, num_profiles,\n+\t\t\t\t buf, buf_size, num_profiles_added, cd);\n }\n \n /**\n@@ -644,13 +640,12 @@ ice_aq_add_rl_profile(struct ice_hw *hw, u16 num_profiles,\n  */\n static enum ice_status\n ice_aq_remove_rl_profile(struct ice_hw *hw, u16 num_profiles,\n-\t\t\t struct ice_aqc_rl_profile_generic_elem *buf,\n-\t\t\t u16 buf_size, u16 *num_profiles_removed,\n-\t\t\t struct ice_sq_cd *cd)\n+\t\t\t struct ice_aqc_rl_profile_elem *buf, u16 buf_size,\n+\t\t\t u16 *num_profiles_removed, struct ice_sq_cd *cd)\n {\n \treturn ice_aq_rl_profile(hw, ice_aqc_opc_remove_rl_profiles,\n-\t\t\t\t num_profiles, buf,\n-\t\t\t\t buf_size, num_profiles_removed, cd);\n+\t\t\t\t num_profiles, buf, buf_size,\n+\t\t\t\t num_profiles_removed, cd);\n }\n \n /**\n@@ -666,7 +661,7 @@ static enum ice_status\n ice_sched_del_rl_profile(struct ice_hw *hw,\n \t\t\t struct ice_aqc_rl_profile_info *rl_info)\n {\n-\tstruct ice_aqc_rl_profile_generic_elem *buf;\n+\tstruct ice_aqc_rl_profile_elem *buf;\n \tu16 num_profiles_removed;\n \tenum ice_status status;\n \tu16 num_profiles = 1;\n@@ -675,8 +670,7 @@ ice_sched_del_rl_profile(struct ice_hw *hw,\n \t\treturn ICE_ERR_IN_USE;\n \n \t/* Safe to remove profile ID */\n-\tbuf = (struct ice_aqc_rl_profile_generic_elem *)\n-\t\t&rl_info->profile;\n+\tbuf = &rl_info->profile;\n \tstatus = ice_aq_remove_rl_profile(hw, num_profiles, buf, sizeof(*buf),\n \t\t\t\t\t  &num_profiles_removed, NULL);\n \tif (status || num_profiles_removed != num_profiles)\n@@ -1867,7 +1861,7 @@ static void ice_sched_rm_unused_rl_prof(struct ice_port_info *pi)\n  * @node: pointer to node\n  * @info: node info to update\n  *\n- * It updates the HW DB, and local SW DB of node. It updates the scheduling\n+ * Update the HW DB, and local SW DB of node. Update the scheduling\n  * parameters of node from argument info data buffer (Info->data buf) and\n  * returns success or error on config sched element failure. The caller\n  * needs to hold scheduler lock.\n@@ -1876,18 +1870,18 @@ static enum ice_status\n ice_sched_update_elem(struct ice_hw *hw, struct ice_sched_node *node,\n \t\t      struct ice_aqc_txsched_elem_data *info)\n {\n-\tstruct ice_aqc_conf_elem buf;\n+\tstruct ice_aqc_txsched_elem_data buf;\n \tenum ice_status status;\n \tu16 elem_cfgd = 0;\n \tu16 num_elems = 1;\n \n-\tbuf.generic[0] = *info;\n+\tbuf = *info;\n \t/* Parent TEID is reserved field in this aq call */\n-\tbuf.generic[0].parent_teid = 0;\n+\tbuf.parent_teid = 0;\n \t/* Element type is reserved field in this aq call */\n-\tbuf.generic[0].data.elem_type = 0;\n+\tbuf.data.elem_type = 0;\n \t/* Flags is reserved field in this aq call */\n-\tbuf.generic[0].data.flags = 0;\n+\tbuf.data.flags = 0;\n \n \t/* Update HW DB */\n \t/* Configure element node */\n@@ -2131,9 +2125,9 @@ static struct ice_aqc_rl_profile_info *\n ice_sched_add_rl_profile(struct ice_port_info *pi,\n \t\t\t enum ice_rl_type rl_type, u32 bw, u8 layer_num)\n {\n-\tstruct ice_aqc_rl_profile_generic_elem *buf;\n \tstruct ice_aqc_rl_profile_info *rl_prof_elem;\n \tu16 profiles_added = 0, num_profiles = 1;\n+\tstruct ice_aqc_rl_profile_elem *buf;\n \tenum ice_status status;\n \tstruct ice_hw *hw;\n \tu8 profile_type;\n@@ -2182,8 +2176,7 @@ ice_sched_add_rl_profile(struct ice_port_info *pi,\n \trl_prof_elem->profile.max_burst_size = cpu_to_le16(hw->max_burst_size);\n \n \t/* Create new entry in HW DB */\n-\tbuf = (struct ice_aqc_rl_profile_generic_elem *)\n-\t\t&rl_prof_elem->profile;\n+\tbuf = &rl_prof_elem->profile;\n \tstatus = ice_aq_add_rl_profile(hw, num_profiles, buf, sizeof(*buf),\n \t\t\t\t       &profiles_added, NULL);\n \tif (status || profiles_added != num_profiles)\ndiff --git a/drivers/net/ethernet/intel/ice/ice_sched.h b/drivers/net/ethernet/intel/ice/ice_sched.h\nindex f0593cfb6521..0e55ae0d446f 100644\n--- a/drivers/net/ethernet/intel/ice/ice_sched.h\n+++ b/drivers/net/ethernet/intel/ice/ice_sched.h\n@@ -56,7 +56,7 @@ struct ice_sched_agg_info {\n /* FW AQ command calls */\n enum ice_status\n ice_aq_query_sched_elems(struct ice_hw *hw, u16 elems_req,\n-\t\t\t struct ice_aqc_get_elem *buf, u16 buf_size,\n+\t\t\t struct ice_aqc_txsched_elem_data *buf, u16 buf_size,\n \t\t\t u16 *elems_ret, struct ice_sq_cd *cd);\n enum ice_status ice_sched_init_port(struct ice_port_info *pi);\n enum ice_status ice_sched_query_res_alloc(struct ice_hw *hw);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c\nindex ff7d16ac693e..0414be3f47dd 100644\n--- a/drivers/net/ethernet/intel/ice/ice_switch.c\n+++ b/drivers/net/ethernet/intel/ice/ice_switch.c\n@@ -87,7 +87,7 @@ enum ice_status ice_init_def_sw_recp(struct ice_hw *hw)\n  * @num_elems: pointer to number of elements\n  * @cd: pointer to command details structure or NULL\n  *\n- * Get switch configuration (0x0200) to be placed in 'buff'.\n+ * Get switch configuration (0x0200) to be placed in buf.\n  * This admin command returns information such as initial VSI/port number\n  * and switch ID it belongs to.\n  *\n@@ -104,13 +104,13 @@ enum ice_status ice_init_def_sw_recp(struct ice_hw *hw)\n  * parsing the response buffer.\n  */\n static enum ice_status\n-ice_aq_get_sw_cfg(struct ice_hw *hw, struct ice_aqc_get_sw_cfg_resp *buf,\n+ice_aq_get_sw_cfg(struct ice_hw *hw, struct ice_aqc_get_sw_cfg_resp_elem *buf,\n \t\t  u16 buf_size, u16 *req_desc, u16 *num_elems,\n \t\t  struct ice_sq_cd *cd)\n {\n \tstruct ice_aqc_get_sw_cfg *cmd;\n-\tenum ice_status status;\n \tstruct ice_aq_desc desc;\n+\tenum ice_status status;\n \n \tice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_sw_cfg);\n \tcmd = &desc.params.get_sw_conf;\n@@ -550,7 +550,7 @@ ice_init_port_info(struct ice_port_info *pi, u16 vsi_port_num, u8 type,\n  */\n enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw)\n {\n-\tstruct ice_aqc_get_sw_cfg_resp *rbuf;\n+\tstruct ice_aqc_get_sw_cfg_resp_elem *rbuf;\n \tenum ice_status status;\n \tu16 req_desc = 0;\n \tu16 num_elems;\n@@ -568,19 +568,19 @@ enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw)\n \t * writing a non-zero value in req_desc\n \t */\n \tdo {\n+\t\tstruct ice_aqc_get_sw_cfg_resp_elem *ele;\n+\n \t\tstatus = ice_aq_get_sw_cfg(hw, rbuf, ICE_SW_CFG_MAX_BUF_LEN,\n \t\t\t\t\t   &req_desc, &num_elems, NULL);\n \n \t\tif (status)\n \t\t\tbreak;\n \n-\t\tfor (i = 0; i < num_elems; i++) {\n-\t\t\tstruct ice_aqc_get_sw_cfg_resp_elem *ele;\n+\t\tfor (i = 0, ele = rbuf; i < num_elems; i++, ele++) {\n \t\t\tu16 pf_vf_num, swid, vsi_port_num;\n \t\t\tbool is_vf = false;\n \t\t\tu8 res_type;\n \n-\t\t\tele = rbuf[i].elements;\n \t\t\tvsi_port_num = le16_to_cpu(ele->vsi_port_num) &\n \t\t\t\tICE_AQC_GET_SW_CONF_RESP_VSI_PORT_NUM_M;\n \n",
    "prefixes": [
        "1/2"
    ]
}