From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0DDE0A0548; Sun, 10 Oct 2021 06:08:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 867CF40042; Sun, 10 Oct 2021 06:08:01 +0200 (CEST) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by mails.dpdk.org (Postfix) with ESMTP id E120540040 for ; Sun, 10 Oct 2021 06:08:00 +0200 (CEST) Received: by mail-pj1-f42.google.com with SMTP id ls18-20020a17090b351200b001a00250584aso11687980pjb.4 for ; Sat, 09 Oct 2021 21:08:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:mime-version; bh=jDerTe2W3SvgKX+N0XaH2GgOVYqLFhkcEqsLXWPPEn0=; b=dql6H1jwACAwc552C7KPE34FhkG4MKMeALHx80vyW9bHEPaUJTgSPtVJQGtQpIWciS DFdtUbBSrdA7/IqKQnC6ciwHGJ3Bk8nT5l1xkntPi935+Yc3GqSqxow7e1OYQOVJ/wF1 yS+W8h5pwqZcOddPrV25IxXHm+4f/tD4szECY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=jDerTe2W3SvgKX+N0XaH2GgOVYqLFhkcEqsLXWPPEn0=; b=OTVtuLgN3RfNnea7dD95PJeQ9Au1RU9gxb4TxkldaGnweekccAsX8tpOzwVC5/haya e48CiXVZYsVmFA0R3fDfkwXv2kdj1jlbDCndiic9suWE5t14CrTGavdw97V8eo9JPncf DTqnYG9myWmDGOlGw7kBJ/h5ajIcQ3Eo3S+vlC+9GQ9G9g7J4jct55Ur811G6PVU4qXP fzy7rIlRijRF4c7I65Z4sFjjrvLPEKqDLMh2wrKU/ADw7zPw7bXp2BfAPRUBwjn0k+ot gRd9L7eQ2pMgy35d7yg6vXtL8sSIFU+Uo6HJKIgKDiE9MMI89TNHLGYbSJ7hhIZpPCXs 8u+A== X-Gm-Message-State: AOAM530us+FsoHL/MDIWA0+VO0TulMljkpLKrlktQAVnA+BWx4PujM4G t7OhtZW2OIlyDDiPr/jOh0mVnPd/4MqVZ2WyiGKa2OPvux7LytoqsUVar1A6vr2EuP/I3u5bXnU Loi36dmDH2Yxbt8JSVzMlL33pyAk02gWLb97VvbjZ+SAw0hF564C99LWA/0etFWE= X-Google-Smtp-Source: ABdhPJyNC7YRfFBOejc9m84jnMTY8jal8zIR5muio8nFcrcX7GMma9ZxJ9wTSUuBylX3VIf7pXvXYA== X-Received: by 2002:a17:902:dacf:b0:13e:ab53:87dc with SMTP id q15-20020a170902dacf00b0013eab5387dcmr17561206plx.78.1633838878598; Sat, 09 Oct 2021 21:07:58 -0700 (PDT) Received: from localhost.localdomain ([136.52.99.246]) by smtp.gmail.com with ESMTPSA id q35sm15052737pjk.41.2021.10.09.21.07.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Oct 2021 21:07:58 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: Shahaji Bhosle Date: Sat, 9 Oct 2021 21:07:55 -0700 Message-Id: <20211010040755.3882-1-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="00000000000002460c05cdf7c2d8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-dev] [PATCH] net/bnxt: fix clang compiler warnings X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" --00000000000002460c05cdf7c2d8 Content-Transfer-Encoding: 8bit From: Shahaji Bhosle Fix an error reported during CLANG compilation. -Wtautological-constant-out-of-range-compare for enums $ export CC=clang $ meson --werror --buildtype=debugoptimized build && ninja-build -C build " [..] ../../root/dpdk/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c:140:18: error: comparison of constant 2147483648 with expression of type 'const enum rte_flow_item_type' is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (item->type >= (uint32_t) ~~~~~~~~~~ ^ ~~~~~~~~~~ ../../root/dpdk/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c:142:19: error: comparison of constant 2147483650 with expression of type 'const enum rte_flow_item_type' is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (item->type >= ~~~~~~~~~~ ^ ../../root/dpdk/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c:188:25: error: comparison of constant 2147483648 with expression of type 'const enum rte_flow_action_type' is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (action_item->type >= ~~~~~~~~~~~~~~~~~ ^ ../../root/dpdk/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c:190:26: error: comparison of constant 2147483650 with expression of type 'const enum rte_flow_action_type' is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (action_item->type >= ~~~~~~~~~~~~~~~~~ ^ 4 errors generated. " Bugzilla ID: 821 Fixes: bdf4a3c6316b ("net/bnxt: support tunnel offload") Signed-off-by: Shahaji Bhosle Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c index 3a9c9bba27..b589f2281e 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c @@ -137,9 +137,9 @@ bnxt_ulp_rte_parser_hdr_parse(const struct rte_flow_item pattern[], /* Parse all the items in the pattern */ while (item && item->type != RTE_FLOW_ITEM_TYPE_END) { - if (item->type >= (uint32_t) - BNXT_RTE_FLOW_ITEM_TYPE_END) { - if (item->type >= + if ((uint32_t)item->type >= + (uint32_t)BNXT_RTE_FLOW_ITEM_TYPE_END) { + if ((uint32_t)item->type >= (uint32_t)BNXT_RTE_FLOW_ITEM_TYPE_LAST) goto hdr_parser_error; /* get the header information */ @@ -185,9 +185,9 @@ bnxt_ulp_rte_parser_act_parse(const struct rte_flow_action actions[], /* Parse all the items in the pattern */ while (action_item && action_item->type != RTE_FLOW_ACTION_TYPE_END) { - if (action_item->type >= + if ((uint32_t)action_item->type >= (uint32_t)BNXT_RTE_FLOW_ACTION_TYPE_END) { - if (action_item->type >= + if ((uint32_t)action_item->type >= (uint32_t)BNXT_RTE_FLOW_ACTION_TYPE_LAST) goto act_parser_error; /* get the header information from bnxt actinfo table */ -- 2.30.1 (Apple Git-130) --00000000000002460c05cdf7c2d8--