[dpdk-dev] [PATCH] net/bnxt: fix clang compiler warnings
Ajit Khaparde
ajit.khaparde at broadcom.com
Mon Oct 11 19:55:22 CEST 2021
On Sat, Oct 9, 2021 at 9:07 PM Ajit Khaparde <ajit.khaparde at broadcom.com> wrote:
>
> From: Shahaji Bhosle <sbhosle at broadcom.com>
>
> 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 <sbhosle at broadcom.com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
Patch applied to dpdk-next-net-brcm. Thanks
More information about the dev
mailing list