[PATCH 2/2] libqcdm: remove useless checks on always true condition

Aleksander Morgado aleksander at aleksander.es
Sat Oct 27 09:15:21 UTC 2018


On 10/27/18 8:00 AM, Ben Chan wrote:
> result.c: In function ‘qcdm_result_add_u8_array’:
> result.c:338:36: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
>      qcdm_return_if_fail (array_len >= 0);
> 
> result.c: In function ‘qcdm_result_add_u16_array’:
> result.c:418:36: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
>      qcdm_return_if_fail (array_len >= 0);
>                                     ^

Pushed, thanks.

> ---
>  libqcdm/src/result.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/libqcdm/src/result.c b/libqcdm/src/result.c
> index 83c61804..65f6c6a5 100644
> --- a/libqcdm/src/result.c
> +++ b/libqcdm/src/result.c
> @@ -335,7 +335,6 @@ qcdm_result_add_u8_array (QcdmResult *r,
>      qcdm_return_if_fail (r->refcount > 0);
>      qcdm_return_if_fail (key != NULL);
>      qcdm_return_if_fail (array != NULL);
> -    qcdm_return_if_fail (array_len >= 0);
>  
>      v = val_new_u8_array (key, array, array_len);
>      qcdm_return_if_fail (v != NULL);
> @@ -415,7 +414,6 @@ qcdm_result_add_u16_array (QcdmResult *r,
>      qcdm_return_if_fail (r->refcount > 0);
>      qcdm_return_if_fail (key != NULL);
>      qcdm_return_if_fail (array != NULL);
> -    qcdm_return_if_fail (array_len >= 0);
>  
>      v = val_new_u16_array (key, array, array_len);
>      qcdm_return_if_fail (v != NULL);
> 


-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list