net/nfp: remove useless range checks
authorMaxime Gouin <maxime.gouin@6wind.com>
Wed, 5 Jan 2022 10:32:03 +0000 (11:32 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 21 Jan 2022 13:49:41 +0000 (14:49 +0100)
commita52c79642ab4296763189dd8efadbb679d32c9a0
treeb2d39b2b2f85c0db665c628e481262cb9af3dbc6
parent9e2cf57e2969a7248c1dbfb2e0c6d5c185b8addf
net/nfp: remove useless range checks

Reported by code analysis tool C++test (version 10.4):

> /build/dpdk-20.11/drivers/net/nfp/nfpcore/nfp_target.h
> 375   Condition "island < 1" is always evaluated to false
> 415   Condition "island < 1" is always evaluated to false
> 547   Condition "target < 0" is always evaluated to false

All of these conditions have the same error. They call
NFP_CPP_ID_ISLAND_of or NFP_CPP_ID_TARGET_of which return a uint8_t and
put the result in "island" or "target" which are integers. These
variables can only contain values between 0 and 255.

Fixes: c7e9729da6b5 ("net/nfp: support CPP")
Cc: stable@dpdk.org
Signed-off-by: Maxime Gouin <maxime.gouin@6wind.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/nfp/nfpcore/nfp_target.h