[lttng-dev] [PATCH lttng-tools] Fix: macro compares unsigned to 0 (no effect)

Jérémie Galarneau jeremie.galarneau at efficios.com
Tue May 17 20:42:22 UTC 2016


Merged, thanks!

Jérémie

On Tue, May 17, 2016 at 9:01 AM, Mathieu Desnoyers
<mathieu.desnoyers at efficios.com> wrote:
> Found by Coverity:
>
> CID 1262117 (#1 of 1): Macro compares unsigned to 0
> (NO_EFFECT)unsigned_compare: This greater-than-or-equal-to-zero
> comparison of an unsigned value is always true. events->nb_fd >= 0U.
>
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
> ---
>  src/common/compat/compat-epoll.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/src/common/compat/compat-epoll.c b/src/common/compat/compat-epoll.c
> index 58f50cc..6259fd3 100644
> --- a/src/common/compat/compat-epoll.c
> +++ b/src/common/compat/compat-epoll.c
> @@ -208,7 +208,6 @@ int compat_epoll_wait(struct lttng_poll_event *events, int timeout)
>                 ERR("Wrong arguments in compat_epoll_wait");
>                 goto error;
>         }
> -       assert(events->nb_fd >= 0);
>
>         if (events->nb_fd == 0) {
>                 errno = EINVAL;
> --
> 2.1.4
>



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com


More information about the lttng-dev mailing list