From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2FA3C06508 for ; Tue, 11 Jun 2019 16:01:57 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 460A62080A for ; Tue, 11 Jun 2019 16:01:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 460A62080A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9A3A41C5A0; Tue, 11 Jun 2019 17:55:13 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 305EA1C509 for ; Tue, 11 Jun 2019 17:54:29 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jun 2019 08:54:28 -0700 X-ExtLoop1: 1 Received: from lrong-srv-03.sh.intel.com ([10.67.119.177]) by orsmga001.jf.intel.com with ESMTP; 11 Jun 2019 08:54:27 -0700 From: Leyi Rong To: qi.z.zhang@intel.com Cc: dev@dpdk.org, Leyi Rong , Bruce Allan , Kevin Scott , Paul M Stillwell Jr Date: Tue, 11 Jun 2019 23:51:56 +0800 Message-Id: <20190611155221.2703-42-leyi.rong@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190611155221.2703-1-leyi.rong@intel.com> References: <20190604054248.68510-1-leyi.rong@intel.com> <20190611155221.2703-1-leyi.rong@intel.com> Subject: [dpdk-dev] [PATCH v2 41/66] net/ice/base: silent semantic parser warnings X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Eliminate some semantic warnings, static analysis warnings. Signed-off-by: Bruce Allan Signed-off-by: Kevin Scott Signed-off-by: Paul M Stillwell Jr Signed-off-by: Leyi Rong --- drivers/net/ice/base/ice_flex_pipe.c | 8 ++++---- drivers/net/ice/base/ice_flow.c | 5 +---- drivers/net/ice/base/ice_nvm.c | 4 ++-- drivers/net/ice/base/ice_protocol_type.h | 1 + drivers/net/ice/base/ice_switch.c | 8 +++----- drivers/net/ice/base/ice_type.h | 7 ++++++- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c index f7d6d9194..d5f0707b6 100644 --- a/drivers/net/ice/base/ice_flex_pipe.c +++ b/drivers/net/ice/base/ice_flex_pipe.c @@ -134,7 +134,7 @@ static struct ice_buf_table *ice_find_buf_table(struct ice_seg *ice_seg) nvms = (struct ice_nvm_table *)(ice_seg->device_table + LE32_TO_CPU(ice_seg->device_table_count)); - return (struct ice_buf_table *) + return (_FORCE_ struct ice_buf_table *) (nvms->vers + LE32_TO_CPU(nvms->table_count)); } @@ -2937,7 +2937,7 @@ static void ice_fill_tbl(struct ice_hw *hw, enum ice_block block_id, u32 sid) case ICE_SID_XLT2_ACL: case ICE_SID_XLT2_PE: xlt2 = (struct ice_xlt2_section *)sect; - src = (u8 *)xlt2->value; + src = (_FORCE_ u8 *)xlt2->value; sect_len = LE16_TO_CPU(xlt2->count) * sizeof(*hw->blk[block_id].xlt2.t); dst = (u8 *)hw->blk[block_id].xlt2.t; @@ -3889,7 +3889,7 @@ ice_update_fd_swap(struct ice_hw *hw, u16 prof_id, struct ice_fv_word *es) /* fill in the swap array */ si = hw->blk[ICE_BLK_FD].es.fvw - 1; - do { + while (si >= 0) { u8 indexes_used = 1; /* assume flat at this index */ @@ -3921,7 +3921,7 @@ ice_update_fd_swap(struct ice_hw *hw, u16 prof_id, struct ice_fv_word *es) } si -= indexes_used; - } while (si >= 0); + } /* for each set of 4 swap indexes, write the appropriate register */ for (j = 0; j < hw->blk[ICE_BLK_FD].es.fvw / 4; j++) { diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c index 795abe98f..48cfa897d 100644 --- a/drivers/net/ice/base/ice_flow.c +++ b/drivers/net/ice/base/ice_flow.c @@ -415,9 +415,6 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params) const ice_bitmap_t *src; u32 hdrs; - if (i > 0 && (i + 1) < prof->segs_cnt) - continue; - hdrs = prof->segs[i].hdrs; if (hdrs & ICE_FLOW_SEG_HDR_ETH) { @@ -1425,7 +1422,7 @@ enum ice_status ice_flow_rem_entry(struct ice_hw *hw, u64 entry_h) if (entry_h == ICE_FLOW_ENTRY_HANDLE_INVAL) return ICE_ERR_PARAM; - entry = ICE_FLOW_ENTRY_PTR((unsigned long)entry_h); + entry = ICE_FLOW_ENTRY_PTR(entry_h); /* Retain the pointer to the flow profile as the entry will be freed */ prof = entry->prof; diff --git a/drivers/net/ice/base/ice_nvm.c b/drivers/net/ice/base/ice_nvm.c index fa9c348ce..76cfedb29 100644 --- a/drivers/net/ice/base/ice_nvm.c +++ b/drivers/net/ice/base/ice_nvm.c @@ -127,7 +127,7 @@ ice_read_sr_word_aq(struct ice_hw *hw, u16 offset, u16 *data) status = ice_read_sr_aq(hw, offset, 1, data, true); if (!status) - *data = LE16_TO_CPU(*(__le16 *)data); + *data = LE16_TO_CPU(*(_FORCE_ __le16 *)data); return status; } @@ -185,7 +185,7 @@ ice_read_sr_buf_aq(struct ice_hw *hw, u16 offset, u16 *words, u16 *data) } while (words_read < *words); for (i = 0; i < *words; i++) - data[i] = LE16_TO_CPU(((__le16 *)data)[i]); + data[i] = LE16_TO_CPU(((_FORCE_ __le16 *)data)[i]); read_nvm_buf_aq_exit: *words = words_read; diff --git a/drivers/net/ice/base/ice_protocol_type.h b/drivers/net/ice/base/ice_protocol_type.h index e572dd320..82822fb74 100644 --- a/drivers/net/ice/base/ice_protocol_type.h +++ b/drivers/net/ice/base/ice_protocol_type.h @@ -189,6 +189,7 @@ struct ice_udp_tnl_hdr { u16 field; u16 proto_type; u16 vni; + u16 reserved; }; struct ice_nvgre { diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index faaedd4c8..77bcf9aa8 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -859,7 +859,7 @@ ice_aq_add_update_mir_rule(struct ice_hw *hw, u16 rule_type, u16 dest_vsi, return ICE_ERR_PARAM; buf_size = count * sizeof(__le16); - mr_list = (__le16 *)ice_malloc(hw, buf_size); + mr_list = (_FORCE_ __le16 *)ice_malloc(hw, buf_size); if (!mr_list) return ICE_ERR_NO_MEMORY; break; @@ -1459,7 +1459,6 @@ static int ice_ilog2(u64 n) return -1; } - /** * ice_fill_sw_rule - Helper function to fill switch rule structure * @hw: pointer to the hardware structure @@ -1479,7 +1478,6 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info, __be16 *off; u8 q_rgn; - if (opc == ice_aqc_opc_remove_sw_rules) { s_rule->pdata.lkup_tx_rx.act = 0; s_rule->pdata.lkup_tx_rx.index = @@ -1555,7 +1553,7 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info, daddr = f_info->l_data.ethertype_mac.mac_addr; /* fall-through */ case ICE_SW_LKUP_ETHERTYPE: - off = (__be16 *)(eth_hdr + ICE_ETH_ETHTYPE_OFFSET); + off = (_FORCE_ __be16 *)(eth_hdr + ICE_ETH_ETHTYPE_OFFSET); *off = CPU_TO_BE16(f_info->l_data.ethertype_mac.ethertype); break; case ICE_SW_LKUP_MAC_VLAN: @@ -1586,7 +1584,7 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info, ICE_NONDMA_TO_NONDMA); if (!(vlan_id > ICE_MAX_VLAN_ID)) { - off = (__be16 *)(eth_hdr + ICE_ETH_VLAN_TCI_OFFSET); + off = (_FORCE_ __be16 *)(eth_hdr + ICE_ETH_VLAN_TCI_OFFSET); *off = CPU_TO_BE16(vlan_id); } diff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h index 919ca7fa8..e0820b679 100644 --- a/drivers/net/ice/base/ice_type.h +++ b/drivers/net/ice/base/ice_type.h @@ -14,6 +14,10 @@ #define BITS_PER_BYTE 8 +#ifndef _FORCE_ +#define _FORCE_ +#endif + #define ICE_BYTES_PER_WORD 2 #define ICE_BYTES_PER_DWORD 4 #define ICE_MAX_TRAFFIC_CLASS 8 @@ -35,7 +39,7 @@ #endif #ifndef IS_ASCII -#define IS_ASCII(_ch) ((_ch) < 0x80) +#define IS_ASCII(_ch) ((_ch) < 0x80) #endif #include "ice_status.h" @@ -745,6 +749,7 @@ struct ice_hw { u8 pf_id; /* device profile info */ u16 max_burst_size; /* driver sets this value */ + /* Tx Scheduler values */ u16 num_tx_sched_layers; u16 num_tx_sched_phys_layers; -- 2.17.1