On Tue, Dec 23, 2014 at 5:39 AM, Maxim Uvarov <[email protected]>
wrote:
>
> CID 85006:  Operands don't affect result  (CONSTANT_EXPRESSION_RESULT)
>     "handle.pool_id >= 16" is always false regardless of the values of
>     its operands. This occurs as the logical second operand of '||'.
>
> Signed-off-by: Maxim Uvarov <[email protected]>
> ---
>  platform/linux-generic/include/odp_buffer_inlines.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/platform/linux-generic/include/odp_buffer_inlines.h
> b/platform/linux-generic/include/odp_buffer_inlines.h
> index f880445..a28e1f1 100644
> --- a/platform/linux-generic/include/odp_buffer_inlines.h
> +++ b/platform/linux-generic/include/odp_buffer_inlines.h
> @@ -99,8 +99,8 @@ static inline odp_buffer_hdr_t
> *validate_buf(odp_buffer_t buf)
>         odp_buffer_hdr_t *buf_hdr;
>         handle.u32 = buf;
>
> -       /* For buffer handles, segment index must be 0 and pool id in
> range */
> -       if (handle.seg != 0 || handle.pool_id >= ODP_CONFIG_BUFFER_POOLS)
>

It is erroneous to delete this check.  The coverity warning is a false
positive that arises only in cases where ODP_CONFIG_BUFFER_POOLS happens to
be a power of two, which is the case here but is not necessarily true.


> +       /* For buffer handles, segment index must be 0 */
> +       if (handle.seg != 0)
>                 return NULL;
>
>         pool_entry_t *pool = odp_pool_to_entry(handle.pool_id);
> --
> 1.8.5.1.163.gd7aced9
>
>
> _______________________________________________
> lng-odp mailing list
> [email protected]
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to