get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1285699,
    "url": "http://patchwork.ozlabs.org/api/patches/1285699/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200508004113.39725-7-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": "<20200508004113.39725-7-anthony.l.nguyen@intel.com>",
    "list_archive_url": null,
    "date": "2020-05-08T00:41:05",
    "name": "[S41,07/15] ice: Fix casting issues",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "741d447471391bc5eedb295525ea736f21475c0f",
    "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/20200508004113.39725-7-anthony.l.nguyen@intel.com/mbox/",
    "series": [
        {
            "id": 175527,
            "url": "http://patchwork.ozlabs.org/api/series/175527/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=175527",
            "date": "2020-05-08T00:41:10",
            "name": "[S41,01/15] ice: Add VF promiscuous support",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/175527/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1285699/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1285699/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.136; helo=silver.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 silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\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 49JBRH2LPQz9sSG\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  8 May 2020 10:44:11 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 9DE1C20455;\n\tFri,  8 May 2020 00:44:09 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id cquEp6XHl1kz; Fri,  8 May 2020 00:43:49 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 7445921537;\n\tFri,  8 May 2020 00:43:45 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n by ash.osuosl.org (Postfix) with ESMTP id 73A281BF2C4\n for <intel-wired-lan@lists.osuosl.org>; Fri,  8 May 2020 00:43:41 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by whitealder.osuosl.org (Postfix) with ESMTP id 6FE8B87A84\n for <intel-wired-lan@lists.osuosl.org>; Fri,  8 May 2020 00:43:41 +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 FyMDNYkbWvNe for <intel-wired-lan@lists.osuosl.org>;\n Fri,  8 May 2020 00:43:35 +0000 (UTC)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by whitealder.osuosl.org (Postfix) with ESMTPS id 0174F878C1\n for <intel-wired-lan@lists.osuosl.org>; Fri,  8 May 2020 00:43:34 +0000 (UTC)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 07 May 2020 17:43:34 -0700",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.241.65])\n by orsmga007.jf.intel.com with ESMTP; 07 May 2020 17:43:33 -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 vtzOkkSrH3//5tAyt94QWYcp9jb3XjhP0a6sxBZTNPMmYWNKvinjYTl9qc+uzs/mSebjgeNKcQ\n j+BcfXk0G/aA==",
            "\n 6N88vjc6rUrE2j8y6fW/n+jb+2z+R4JVntN+H9loKDgEmBwDuXGLSpnHQcD5yGtWMD8IILuWyP\n UCw8radjuwpA=="
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.73,365,1583222400\"; d=\"scan'208\";a=\"249468772\"",
        "From": "Tony Nguyen <anthony.l.nguyen@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Thu,  7 May 2020 17:41:05 -0700",
        "Message-Id": "<20200508004113.39725-7-anthony.l.nguyen@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20200508004113.39725-1-anthony.l.nguyen@intel.com>",
        "References": "<20200508004113.39725-1-anthony.l.nguyen@intel.com>",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH S41 07/15] ice: Fix casting issues",
        "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: Karol Kolacinski <karol.kolacinski@intel.com>\n\nChange min() macros to min_t() which has compare type specified and it\nhelps avoid precision loss.\n\nIn some cases there was precision loss during calls or assignments.\nSome fields in structs were unnecessarily large and gave multiple\nwarnings.\n\nThere were also some minor type differences which are now fixed as well as\nsome cases where a simple cast was needed.\n\nCallers were were passing data that is a u16 to\nice_sched_cfg_node_bw_alloc() but the function was truncating that to a u8.\nFix that by changing the function to take a u16.\n\nSigned-off-by: Karol Kolacinski <karol.kolacinski@intel.com>\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice.h          | 10 +++----\n drivers/net/ethernet/intel/ice/ice_base.c     | 24 ++++++++-------\n drivers/net/ethernet/intel/ice/ice_controlq.c |  2 +-\n drivers/net/ethernet/intel/ice/ice_ethtool.c  |  6 ++--\n .../net/ethernet/intel/ice/ice_flex_pipe.c    | 13 +++++----\n drivers/net/ethernet/intel/ice/ice_idc.c      |  5 ++--\n drivers/net/ethernet/intel/ice/ice_lib.c      | 29 ++++++++++---------\n drivers/net/ethernet/intel/ice/ice_main.c     | 13 +++++----\n drivers/net/ethernet/intel/ice/ice_sched.c    |  2 +-\n drivers/net/ethernet/intel/ice/ice_switch.c   | 12 ++++----\n drivers/net/ethernet/intel/ice/ice_txrx.c     | 19 ++++++------\n drivers/net/ethernet/intel/ice/ice_txrx_lib.c |  2 +-\n drivers/net/ethernet/intel/ice/ice_txrx_lib.h |  2 +-\n drivers/net/ethernet/intel/ice/ice_type.h     |  4 +--\n 14 files changed, 77 insertions(+), 66 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h\nindex b9860b8350ca..9926cc47755b 100644\n--- a/drivers/net/ethernet/intel/ice/ice.h\n+++ b/drivers/net/ethernet/intel/ice/ice.h\n@@ -251,8 +251,8 @@ struct ice_vsi {\n \tu32 tx_busy;\n \tu32 rx_buf_failed;\n \tu32 rx_page_failed;\n-\tint num_q_vectors;\n-\tint base_vector;\t\t/* IRQ base for OS reserved vectors */\n+\tu16 num_q_vectors;\n+\tu16 base_vector;\t\t/* IRQ base for OS reserved vectors */\n \tenum ice_vsi_type type;\n \tu16 vsi_num;\t\t\t/* HW (absolute) index of this VSI */\n \tu16 idx;\t\t\t/* software index in pf->vsi[] */\n@@ -399,11 +399,11 @@ struct ice_pf {\n \tu32 rdma_base_vector;\n \tstruct iidc_peer_dev *rdma_peer;\n \tu32 hw_csum_rx_error;\n-\tu32 oicr_idx;\t\t/* Other interrupt cause MSIX vector index */\n-\tu32 num_avail_sw_msix;\t/* remaining MSIX SW vectors left unclaimed */\n+\tu16 oicr_idx;\t\t/* Other interrupt cause MSIX vector index */\n+\tu16 num_avail_sw_msix;\t/* remaining MSIX SW vectors left unclaimed */\n \tu16 max_pf_txqs;\t/* Total Tx queues PF wide */\n \tu16 max_pf_rxqs;\t/* Total Rx queues PF wide */\n-\tu32 num_lan_msix;\t/* Total MSIX vectors for base driver */\n+\tu16 num_lan_msix;\t/* Total MSIX vectors for base driver */\n \tu16 num_lan_tx;\t\t/* num LAN Tx queues setup */\n \tu16 num_lan_rx;\t\t/* num LAN Rx queues setup */\n \tu16 next_vsi;\t\t/* Next free slot in pf->vsi[] - 0-based! */\ndiff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c\nindex ee1c698ff056..4c835c144907 100644\n--- a/drivers/net/ethernet/intel/ice/ice_base.c\n+++ b/drivers/net/ethernet/intel/ice/ice_base.c\n@@ -24,7 +24,7 @@ static int __ice_vsi_get_qs_contig(struct ice_qs_cfg *qs_cfg)\n \n \tbitmap_set(qs_cfg->pf_map, offset, qs_cfg->q_count);\n \tfor (i = 0; i < qs_cfg->q_count; i++)\n-\t\tqs_cfg->vsi_map[i + qs_cfg->vsi_map_offset] = i + offset;\n+\t\tqs_cfg->vsi_map[i + qs_cfg->vsi_map_offset] = (u16)(i + offset);\n \tmutex_unlock(qs_cfg->qs_mutex);\n \n \treturn 0;\n@@ -47,7 +47,7 @@ static int __ice_vsi_get_qs_sc(struct ice_qs_cfg *qs_cfg)\n \t\tif (index >= qs_cfg->pf_map_size)\n \t\t\tgoto err_scatter;\n \t\tset_bit(index, qs_cfg->pf_map);\n-\t\tqs_cfg->vsi_map[i + qs_cfg->vsi_map_offset] = index;\n+\t\tqs_cfg->vsi_map[i + qs_cfg->vsi_map_offset] = (u16)index;\n \t}\n \tmutex_unlock(qs_cfg->qs_mutex);\n \n@@ -96,7 +96,7 @@ static int ice_pf_rxq_wait(struct ice_pf *pf, int pf_q, bool ena)\n  * We allocate one q_vector and set default value for ITR setting associated\n  * with this q_vector. If allocation fails we return -ENOMEM.\n  */\n-static int ice_vsi_alloc_q_vector(struct ice_vsi *vsi, int v_idx)\n+static int ice_vsi_alloc_q_vector(struct ice_vsi *vsi, u16 v_idx)\n {\n \tstruct ice_pf *pf = vsi->back;\n \tstruct ice_q_vector *q_vector;\n@@ -376,7 +376,7 @@ int ice_setup_rx_ctx(struct ice_ring *ring)\n \t/* Max packet size for this queue - must not be set to a larger value\n \t * than 5 x DBUF\n \t */\n-\trlan_ctx.rxmax = min_t(u16, vsi->max_frame,\n+\trlan_ctx.rxmax = min_t(u32, vsi->max_frame,\n \t\t\t       chain_len * ring->rx_buf_len);\n \n \t/* Rx queue threshold in units of 64 */\n@@ -453,7 +453,7 @@ int __ice_vsi_get_qs(struct ice_qs_cfg *qs_cfg)\n \tif (ret) {\n \t\t/* contig failed, so try with scatter approach */\n \t\tqs_cfg->mapping_mode = ICE_VSI_MAP_SCATTER;\n-\t\tqs_cfg->q_count = min_t(u16, qs_cfg->q_count,\n+\t\tqs_cfg->q_count = min_t(unsigned int, qs_cfg->q_count,\n \t\t\t\t\tqs_cfg->scatter_count);\n \t\tret = __ice_vsi_get_qs_sc(qs_cfg);\n \t}\n@@ -526,7 +526,8 @@ int ice_vsi_wait_one_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx)\n int ice_vsi_alloc_q_vectors(struct ice_vsi *vsi)\n {\n \tstruct device *dev = ice_pf_to_dev(vsi->back);\n-\tint v_idx, err;\n+\tu16 v_idx;\n+\tint err;\n \n \tif (vsi->q_vectors[0]) {\n \t\tdev_dbg(dev, \"VSI %d has existing q_vectors\\n\", vsi->vsi_num);\n@@ -562,7 +563,7 @@ int ice_vsi_alloc_q_vectors(struct ice_vsi *vsi)\n void ice_vsi_map_rings_to_vectors(struct ice_vsi *vsi)\n {\n \tint q_vectors = vsi->num_q_vectors;\n-\tint tx_rings_rem, rx_rings_rem;\n+\tu16 tx_rings_rem, rx_rings_rem;\n \tint v_id;\n \n \t/* initially assigning remaining rings count to VSIs num queue value */\n@@ -571,10 +572,12 @@ void ice_vsi_map_rings_to_vectors(struct ice_vsi *vsi)\n \n \tfor (v_id = 0; v_id < q_vectors; v_id++) {\n \t\tstruct ice_q_vector *q_vector = vsi->q_vectors[v_id];\n-\t\tint tx_rings_per_v, rx_rings_per_v, q_id, q_base;\n+\t\tu8 tx_rings_per_v, rx_rings_per_v;\n+\t\tu16 q_id, q_base;\n \n \t\t/* Tx rings mapping to vector */\n-\t\ttx_rings_per_v = DIV_ROUND_UP(tx_rings_rem, q_vectors - v_id);\n+\t\ttx_rings_per_v = (u8)DIV_ROUND_UP(tx_rings_rem,\n+\t\t\t\t\t\t  q_vectors - v_id);\n \t\tq_vector->num_ring_tx = tx_rings_per_v;\n \t\tq_vector->tx.ring = NULL;\n \t\tq_vector->tx.itr_idx = ICE_TX_ITR;\n@@ -590,7 +593,8 @@ void ice_vsi_map_rings_to_vectors(struct ice_vsi *vsi)\n \t\ttx_rings_rem -= tx_rings_per_v;\n \n \t\t/* Rx rings mapping to vector */\n-\t\trx_rings_per_v = DIV_ROUND_UP(rx_rings_rem, q_vectors - v_id);\n+\t\trx_rings_per_v = (u8)DIV_ROUND_UP(rx_rings_rem,\n+\t\t\t\t\t\t  q_vectors - v_id);\n \t\tq_vector->num_ring_rx = rx_rings_per_v;\n \t\tq_vector->rx.ring = NULL;\n \t\tq_vector->rx.itr_idx = ICE_RX_ITR;\ndiff --git a/drivers/net/ethernet/intel/ice/ice_controlq.c b/drivers/net/ethernet/intel/ice/ice_controlq.c\nindex dd946866d7b8..9a865962296d 100644\n--- a/drivers/net/ethernet/intel/ice/ice_controlq.c\n+++ b/drivers/net/ethernet/intel/ice/ice_controlq.c\n@@ -1128,7 +1128,7 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq,\n \t}\n \tmemcpy(&e->desc, desc, sizeof(e->desc));\n \tdatalen = le16_to_cpu(desc->datalen);\n-\te->msg_len = min(datalen, e->buf_len);\n+\te->msg_len = min_t(u16, datalen, e->buf_len);\n \tif (e->msg_buf && e->msg_len)\n \t\tmemcpy(e->msg_buf, cq->rq.r.rq_bi[desc_idx].va, e->msg_len);\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c\nindex b814bc54f752..41a6aa4ebb02 100644\n--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c\n+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c\n@@ -2609,7 +2609,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)\n \tstruct ice_vsi *vsi = np->vsi;\n \tstruct ice_pf *pf = vsi->back;\n \tint i, timeout = 50, err = 0;\n-\tu32 new_rx_cnt, new_tx_cnt;\n+\tu16 new_rx_cnt, new_tx_cnt;\n \n \tif (ring->tx_pending > ICE_MAX_NUM_DESC ||\n \t    ring->tx_pending < ICE_MIN_NUM_DESC ||\n@@ -2661,8 +2661,8 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)\n \t\tif (ice_is_xdp_ena_vsi(vsi))\n \t\t\tfor (i = 0; i < vsi->num_xdp_txq; i++)\n \t\t\t\tvsi->xdp_rings[i]->count = new_tx_cnt;\n-\t\tvsi->num_tx_desc = new_tx_cnt;\n-\t\tvsi->num_rx_desc = new_rx_cnt;\n+\t\tvsi->num_tx_desc = (u16)new_tx_cnt;\n+\t\tvsi->num_rx_desc = (u16)new_rx_cnt;\n \t\tnetdev_dbg(netdev, \"Link is down, descriptor count change happens when link is brought up\\n\");\n \t\tgoto done;\n \t}\ndiff --git a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c\nindex 62e305511c7e..4dc72aef5381 100644\n--- a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c\n+++ b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c\n@@ -1694,7 +1694,7 @@ ice_create_tunnel(struct ice_hw *hw, enum ice_tunnel_type type, u16 port)\n \t */\n \tice_set_key((u8 *)&sect_rx->tcam[0].key, sizeof(sect_rx->tcam[0].key),\n \t\t    (u8 *)&port, NULL, NULL, NULL,\n-\t\t    offsetof(struct ice_boost_key_value, hv_dst_port_key),\n+\t\t    (u16)offsetof(struct ice_boost_key_value, hv_dst_port_key),\n \t\t    sizeof(sect_rx->tcam[0].key.key.hv_dst_port_key));\n \n \t/* exact copy of entry to Tx section entry */\n@@ -2329,9 +2329,10 @@ ice_find_prof_id(struct ice_hw *hw, enum ice_block blk,\n \t\t struct ice_fv_word *fv, u8 *prof_id)\n {\n \tstruct ice_es *es = &hw->blk[blk].es;\n-\tu16 off, i;\n+\tu16 off;\n+\tu8 i;\n \n-\tfor (i = 0; i < es->count; i++) {\n+\tfor (i = 0; i < (u8)es->count; i++) {\n \t\toff = i * es->fvw;\n \n \t\tif (memcmp(&es->t[off], fv, es->fvw * sizeof(*fv)))\n@@ -3461,7 +3462,7 @@ ice_add_prof(struct ice_hw *hw, enum ice_block blk, u64 id, u8 ptypes[],\n \tDECLARE_BITMAP(ptgs_used, ICE_XLT1_CNT);\n \tstruct ice_prof_map *prof;\n \tenum ice_status status;\n-\tu32 byte = 0;\n+\tu8 byte = 0;\n \tu8 prof_id;\n \n \tbitmap_zero(ptgs_used, ICE_XLT1_CNT);\n@@ -3496,7 +3497,7 @@ ice_add_prof(struct ice_hw *hw, enum ice_block blk, u64 id, u8 ptypes[],\n \n \t/* build list of ptgs */\n \twhile (bytes && prof->ptg_cnt < ICE_MAX_PTG_PER_PROFILE) {\n-\t\tu32 bit;\n+\t\tu8 bit;\n \n \t\tif (!ptypes[byte]) {\n \t\t\tbytes--;\n@@ -3530,7 +3531,7 @@ ice_add_prof(struct ice_hw *hw, enum ice_block blk, u64 id, u8 ptypes[],\n \t\t\t\tbreak;\n \n \t\t\t/* nothing left in byte, then exit */\n-\t\t\tm = ~((1 << (bit + 1)) - 1);\n+\t\t\tm = ~(u8)((1 << (bit + 1)) - 1);\n \t\t\tif (!(ptypes[byte] & m))\n \t\t\t\tbreak;\n \t\t}\ndiff --git a/drivers/net/ethernet/intel/ice/ice_idc.c b/drivers/net/ethernet/intel/ice/ice_idc.c\nindex d287728b3cc8..e96657c3ed89 100644\n--- a/drivers/net/ethernet/intel/ice/ice_idc.c\n+++ b/drivers/net/ethernet/intel/ice/ice_idc.c\n@@ -297,7 +297,7 @@ ice_check_peer_for_events(struct ice_peer_dev_int *src_peer_int, void *data)\n \tconst struct iidc_peer_ops *p_ops = new_peer->peer_ops;\n \tstruct ice_peer_dev_int *new_peer_int;\n \tstruct iidc_peer_dev *src_peer;\n-\tint i;\n+\tunsigned long i;\n \n \tsrc_peer = &src_peer_int->peer_dev;\n \tif (!ice_validate_peer_dev(new_peer) ||\n@@ -831,7 +831,8 @@ ice_peer_report_state_change(struct iidc_peer_dev *peer_dev,\n {\n \tstruct ice_peer_dev_int *peer_dev_int;\n \tstruct ice_peer_drv_int *peer_drv_int;\n-\tint e_type, drv_event = 0;\n+\tunsigned int e_type;\n+\tint drv_event = 0;\n \tstruct ice_pf *pf;\n \n \tif (!ice_validate_peer_dev(peer_dev) || !event)\ndiff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c\nindex ae2528762b07..fa029cda750f 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -37,7 +37,8 @@ const char *ice_vsi_type_str(enum ice_vsi_type vsi_type)\n  */\n static int ice_vsi_ctrl_all_rx_rings(struct ice_vsi *vsi, bool ena)\n {\n-\tint i, ret = 0;\n+\tint ret = 0;\n+\tu16 i;\n \n \tfor (i = 0; i < vsi->num_rxq; i++)\n \t\tice_vsi_ctrl_one_rx_ring(vsi, ena, i, false);\n@@ -576,8 +577,8 @@ static void ice_vsi_set_rss_params(struct ice_vsi *vsi)\n \tswitch (vsi->type) {\n \tcase ICE_VSI_PF:\n \t\t/* PF VSI will inherit RSS instance of PF */\n-\t\tvsi->rss_table_size = cap->rss_table_size;\n-\t\tvsi->rss_size = min_t(int, num_online_cpus(),\n+\t\tvsi->rss_table_size = (u16)cap->rss_table_size;\n+\t\tvsi->rss_size = min_t(u16, num_online_cpus(),\n \t\t\t\t      BIT(cap->rss_table_entry_width));\n \t\tvsi->rss_lut_type = ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF;\n \t\tbreak;\n@@ -695,15 +696,15 @@ static void ice_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)\n \t\t\t\tmax_rss = ICE_MAX_LG_RSS_QS;\n \t\t\telse\n \t\t\t\tmax_rss = ICE_MAX_RSS_QS_PER_VF;\n-\t\t\tqcount_rx = min_t(int, rx_numq_tc, max_rss);\n+\t\t\tqcount_rx = min_t(u16, rx_numq_tc, max_rss);\n \t\t\tif (!vsi->req_rxq)\n-\t\t\t\tqcount_rx = min_t(int, qcount_rx,\n+\t\t\t\tqcount_rx = min_t(u16, qcount_rx,\n \t\t\t\t\t\t  vsi->rss_size);\n \t\t}\n \t}\n \n \t/* find the (rounded up) power-of-2 of qcount */\n-\tpow = order_base_2(qcount_rx);\n+\tpow = (u16)order_base_2(qcount_rx);\n \n \tice_for_each_traffic_class(i) {\n \t\tif (!(vsi->tc_cfg.ena_tc & BIT(i))) {\n@@ -952,7 +953,7 @@ int ice_free_res(struct ice_res_tracker *res, u16 index, u16 id)\n  */\n static int ice_search_res(struct ice_res_tracker *res, u16 needed, u16 id)\n {\n-\tint start = 0, end = 0;\n+\tu16 start = 0, end = 0;\n \n \tif (needed > res->end)\n \t\treturn -ENOMEM;\n@@ -1035,6 +1036,7 @@ static int ice_vsi_setup_vector_base(struct ice_vsi *vsi)\n \tstruct ice_pf *pf = vsi->back;\n \tstruct device *dev;\n \tu16 num_q_vectors;\n+\tint base;\n \n \tdev = ice_pf_to_dev(pf);\n \t/* SRIOV doesn't grab irq_tracker entries for each VSI */\n@@ -1049,14 +1051,15 @@ static int ice_vsi_setup_vector_base(struct ice_vsi *vsi)\n \n \tnum_q_vectors = vsi->num_q_vectors;\n \t/* reserve slots from OS requested IRQs */\n-\tvsi->base_vector = ice_get_res(pf, pf->irq_tracker, num_q_vectors,\n-\t\t\t\t       vsi->idx);\n-\tif (vsi->base_vector < 0) {\n+\tbase = ice_get_res(pf, pf->irq_tracker, num_q_vectors, vsi->idx);\n+\n+\tif (base < 0) {\n \t\tdev_err(dev, \"%d MSI-X interrupts available. %s %d failed to get %d MSI-X vectors\\n\",\n \t\t\tice_get_free_res_count(pf->irq_tracker),\n \t\t\tice_vsi_type_str(vsi->type), vsi->idx, num_q_vectors);\n \t\treturn -ENOENT;\n \t}\n+\tvsi->base_vector = (u16)base;\n \tpf->num_avail_sw_msix -= num_q_vectors;\n \n \treturn 0;\n@@ -1096,7 +1099,7 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi)\n {\n \tstruct ice_pf *pf = vsi->back;\n \tstruct device *dev;\n-\tint i;\n+\tu16 i;\n \n \tdev = ice_pf_to_dev(pf);\n \t/* Allocate Tx rings */\n@@ -1189,7 +1192,7 @@ static int ice_vsi_cfg_rss_lut_key(struct ice_vsi *vsi)\n \tu8 *lut;\n \n \tdev = ice_pf_to_dev(pf);\n-\tvsi->rss_size = min_t(int, vsi->rss_size, vsi->num_rxq);\n+\tvsi->rss_size = min_t(u16, vsi->rss_size, vsi->num_rxq);\n \n \tlut = kzalloc(vsi->rss_table_size, GFP_KERNEL);\n \tif (!lut)\n@@ -1708,7 +1711,7 @@ void ice_vsi_cfg_msix(struct ice_vsi *vsi)\n {\n \tstruct ice_pf *pf = vsi->back;\n \tstruct ice_hw *hw = &pf->hw;\n-\tu32 txq = 0, rxq = 0;\n+\tu16 txq = 0, rxq = 0;\n \tint i, q;\n \n \tfor (i = 0; i < vsi->num_q_vectors; i++) {\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex 13cfdda7df97..0216f295c7ca 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -2252,7 +2252,7 @@ static int ice_req_irq_msix_misc(struct ice_pf *pf)\n \t\treturn oicr_idx;\n \n \tpf->num_avail_sw_msix -= 1;\n-\tpf->oicr_idx = oicr_idx;\n+\tpf->oicr_idx = (u16)oicr_idx;\n \n \terr = devm_request_irq(dev, pf->msix_entries[pf->oicr_idx].vector,\n \t\t\t       ice_misc_intr, 0, pf->int_name, pf);\n@@ -2649,7 +2649,8 @@ static int ice_setup_pf_sw(struct ice_pf *pf)\n static u16\n ice_get_avail_q_count(unsigned long *pf_qmap, struct mutex *lock, u16 size)\n {\n-\tu16 count = 0, bit;\n+\tunsigned long bit;\n+\tu16 count = 0;\n \n \tmutex_lock(lock);\n \tfor_each_clear_bit(bit, pf_qmap, size)\n@@ -2908,8 +2909,8 @@ static int ice_init_interrupt_scheme(struct ice_pf *pf)\n \t}\n \n \t/* populate SW interrupts pool with number of OS granted IRQs. */\n-\tpf->num_avail_sw_msix = vectors;\n-\tpf->irq_tracker->num_entries = vectors;\n+\tpf->num_avail_sw_msix = (u16)vectors;\n+\tpf->irq_tracker->num_entries = (u16)vectors;\n \tpf->irq_tracker->end = pf->irq_tracker->num_entries;\n \n \treturn 0;\n@@ -2941,9 +2942,9 @@ int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx)\n \t}\n \n \tif (new_tx)\n-\t\tvsi->req_txq = new_tx;\n+\t\tvsi->req_txq = (u16)new_tx;\n \tif (new_rx)\n-\t\tvsi->req_rxq = new_rx;\n+\t\tvsi->req_rxq = (u16)new_rx;\n \n \t/* set for the next time the netdev is started */\n \tif (!netif_running(vsi->netdev)) {\ndiff --git a/drivers/net/ethernet/intel/ice/ice_sched.c b/drivers/net/ethernet/intel/ice/ice_sched.c\nindex 2f618d051b56..e2bc7cfea254 100644\n--- a/drivers/net/ethernet/intel/ice/ice_sched.c\n+++ b/drivers/net/ethernet/intel/ice/ice_sched.c\n@@ -1976,7 +1976,7 @@ ice_sched_update_elem(struct ice_hw *hw, struct ice_sched_node *node,\n  */\n static enum ice_status\n ice_sched_cfg_node_bw_alloc(struct ice_hw *hw, struct ice_sched_node *node,\n-\t\t\t    enum ice_rl_type rl_type, u8 bw_alloc)\n+\t\t\t    enum ice_rl_type rl_type, u16 bw_alloc)\n {\n \tstruct ice_aqc_txsched_elem_data buf;\n \tstruct ice_aqc_txsched_elem *data;\ndiff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c\nindex eeb1b0e6f716..b672edeba7bc 100644\n--- a/drivers/net/ethernet/intel/ice/ice_switch.c\n+++ b/drivers/net/ethernet/intel/ice/ice_switch.c\n@@ -620,8 +620,8 @@ enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw)\n \t\t\t    ICE_AQC_GET_SW_CONF_RESP_IS_VF)\n \t\t\t\tis_vf = true;\n \n-\t\t\tres_type = le16_to_cpu(ele->vsi_port_num) >>\n-\t\t\t\tICE_AQC_GET_SW_CONF_RESP_TYPE_S;\n+\t\t\tres_type = (u8)(le16_to_cpu(ele->vsi_port_num) >>\n+\t\t\t\t\tICE_AQC_GET_SW_CONF_RESP_TYPE_S);\n \n \t\t\tif (res_type == ICE_AQC_GET_SW_CONF_RESP_VSI) {\n \t\t\t\t/* FW VSI is not needed. Just continue. */\n@@ -1645,12 +1645,12 @@ ice_add_mac(struct ice_hw *hw, struct list_head *m_list)\n \tstruct ice_aqc_sw_rules_elem *s_rule, *r_iter;\n \tstruct ice_fltr_list_entry *m_list_itr;\n \tstruct list_head *rule_head;\n-\tu16 elem_sent, total_elem_left;\n+\tu16 total_elem_left, s_rule_size;\n \tstruct ice_switch_info *sw;\n \tstruct mutex *rule_lock; /* Lock to protect filter rule list */\n \tenum ice_status status = 0;\n \tu16 num_unicast = 0;\n-\tu16 s_rule_size;\n+\tu8 elem_sent;\n \n \tif (!m_list || !hw)\n \t\treturn ICE_ERR_PARAM;\n@@ -1734,8 +1734,8 @@ ice_add_mac(struct ice_hw *hw, struct list_head *m_list)\n \t     total_elem_left -= elem_sent) {\n \t\tstruct ice_aqc_sw_rules_elem *entry = r_iter;\n \n-\t\telem_sent = min(total_elem_left,\n-\t\t\t\t(u16)(ICE_AQ_MAX_BUF_LEN / s_rule_size));\n+\t\telem_sent = min_t(u8, total_elem_left,\n+\t\t\t\t  (ICE_AQ_MAX_BUF_LEN / s_rule_size));\n \t\tstatus = ice_aq_sw_rules(hw, entry, elem_sent * s_rule_size,\n \t\t\t\t\t elem_sent, ice_aqc_opc_add_sw_rules,\n \t\t\t\t\t NULL);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c\nindex cb64436507d3..fb4e4c529e2d 100644\n--- a/drivers/net/ethernet/intel/ice/ice_txrx.c\n+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c\n@@ -803,7 +803,7 @@ static struct sk_buff *\n ice_build_skb(struct ice_ring *rx_ring, struct ice_rx_buf *rx_buf,\n \t      struct xdp_buff *xdp)\n {\n-\tunsigned int metasize = xdp->data - xdp->data_meta;\n+\tu8 metasize = xdp->data - xdp->data_meta;\n #if (PAGE_SIZE < 8192)\n \tunsigned int truesize = ice_rx_pg_size(rx_ring) / 2;\n #else\n@@ -918,7 +918,7 @@ ice_construct_skb(struct ice_ring *rx_ring, struct ice_rx_buf *rx_buf,\n  */\n static void ice_put_rx_buf(struct ice_ring *rx_ring, struct ice_rx_buf *rx_buf)\n {\n-\tu32 ntc = rx_ring->next_to_clean + 1;\n+\tu16 ntc = rx_ring->next_to_clean + 1;\n \n \t/* fetch, update, and store next to clean */\n \tntc = (ntc < rx_ring->count) ? ntc : 0;\n@@ -1528,7 +1528,7 @@ int ice_napi_poll(struct napi_struct *napi, int budget)\n \t\t * don't allow the budget to go below 1 because that would exit\n \t\t * polling early.\n \t\t */\n-\t\tbudget_per_ring = max(budget / q_vector->num_ring_rx, 1);\n+\t\tbudget_per_ring = max_t(int, budget / q_vector->num_ring_rx, 1);\n \telse\n \t\t/* Max of 1 Rx ring in this q_vector so give it the budget */\n \t\tbudget_per_ring = budget;\n@@ -2010,7 +2010,8 @@ int ice_tso(struct ice_tx_buf *first, struct ice_tx_offload_params *off)\n \t\tunsigned char *hdr;\n \t} l4;\n \tu64 cd_mss, cd_tso_len;\n-\tu32 paylen, l4_start;\n+\tu32 paylen;\n+\tu8 l4_start;\n \tint err;\n \n \tif (skb->ip_summed != CHECKSUM_PARTIAL)\n@@ -2046,7 +2047,7 @@ int ice_tso(struct ice_tx_buf *first, struct ice_tx_offload_params *off)\n \t\t\tl4.udp->len = 0;\n \n \t\t\t/* determine offset of outer transport header */\n-\t\t\tl4_start = l4.hdr - skb->data;\n+\t\t\tl4_start = (u8)(l4.hdr - skb->data);\n \n \t\t\t/* remove payload length from outer checksum */\n \t\t\tpaylen = skb->len - l4_start;\n@@ -2070,7 +2071,7 @@ int ice_tso(struct ice_tx_buf *first, struct ice_tx_offload_params *off)\n \t}\n \n \t/* determine offset of transport header */\n-\tl4_start = l4.hdr - skb->data;\n+\tl4_start = (u8)(l4.hdr - skb->data);\n \n \t/* remove payload length from checksum */\n \tpaylen = skb->len - l4_start;\n@@ -2079,12 +2080,12 @@ int ice_tso(struct ice_tx_buf *first, struct ice_tx_offload_params *off)\n \t\tcsum_replace_by_diff(&l4.udp->check,\n \t\t\t\t     (__force __wsum)htonl(paylen));\n \t\t/* compute length of UDP segmentation header */\n-\t\toff->header_len = sizeof(l4.udp) + l4_start;\n+\t\toff->header_len = (u8)sizeof(l4.udp) + l4_start;\n \t} else {\n \t\tcsum_replace_by_diff(&l4.tcp->check,\n \t\t\t\t     (__force __wsum)htonl(paylen));\n \t\t/* compute length of TCP segmentation header */\n-\t\toff->header_len = (l4.tcp->doff * 4) + l4_start;\n+\t\toff->header_len = (u8)((l4.tcp->doff * 4) + l4_start);\n \t}\n \n \t/* update gso_segs and bytecount */\n@@ -2315,7 +2316,7 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_ring *tx_ring)\n \n \tif (offload.cd_qw1 & ICE_TX_DESC_DTYPE_CTX) {\n \t\tstruct ice_tx_ctx_desc *cdesc;\n-\t\tint i = tx_ring->next_to_use;\n+\t\tu16 i = tx_ring->next_to_use;\n \n \t\t/* grab the next descriptor */\n \t\tcdesc = ICE_TX_CTX_DESC(tx_ring, i);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_txrx_lib.c b/drivers/net/ethernet/intel/ice/ice_txrx_lib.c\nindex 1f9c3d24cde7..9d6512f96b8c 100644\n--- a/drivers/net/ethernet/intel/ice/ice_txrx_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_txrx_lib.c\n@@ -8,7 +8,7 @@\n  * @rx_ring: ring to bump\n  * @val: new head index\n  */\n-void ice_release_rx_desc(struct ice_ring *rx_ring, u32 val)\n+void ice_release_rx_desc(struct ice_ring *rx_ring, u16 val)\n {\n \tu16 prev_ntu = rx_ring->next_to_use & ~0x7;\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_txrx_lib.h b/drivers/net/ethernet/intel/ice/ice_txrx_lib.h\nindex ba9164dad9ae..af0fca5b91ff 100644\n--- a/drivers/net/ethernet/intel/ice/ice_txrx_lib.h\n+++ b/drivers/net/ethernet/intel/ice/ice_txrx_lib.h\n@@ -49,7 +49,7 @@ static inline void ice_xdp_ring_update_tail(struct ice_ring *xdp_ring)\n void ice_finalize_xdp_rx(struct ice_ring *rx_ring, unsigned int xdp_res);\n int ice_xmit_xdp_buff(struct xdp_buff *xdp, struct ice_ring *xdp_ring);\n int ice_xmit_xdp_ring(void *data, u16 size, struct ice_ring *xdp_ring);\n-void ice_release_rx_desc(struct ice_ring *rx_ring, u32 val);\n+void ice_release_rx_desc(struct ice_ring *rx_ring, u16 val);\n void\n ice_process_skb_fields(struct ice_ring *rx_ring,\n \t\t       union ice_32b_rx_flex_desc *rx_desc,\ndiff --git a/drivers/net/ethernet/intel/ice/ice_type.h b/drivers/net/ethernet/intel/ice/ice_type.h\nindex 5abfd01113ed..002eb6506303 100644\n--- a/drivers/net/ethernet/intel/ice/ice_type.h\n+++ b/drivers/net/ethernet/intel/ice/ice_type.h\n@@ -505,8 +505,8 @@ struct ice_hw {\n \tu16 max_burst_size;\t/* driver sets this value */\n \n \t/* Tx Scheduler values */\n-\tu16 num_tx_sched_layers;\n-\tu16 num_tx_sched_phys_layers;\n+\tu8 num_tx_sched_layers;\n+\tu8 num_tx_sched_phys_layers;\n \tu8 flattened_layers;\n \tu8 max_cgds;\n \tu8 sw_entry_point_layer;\n",
    "prefixes": [
        "S41",
        "07/15"
    ]
}