Clean code base from redundant verification
authorYannick Lamarre <ylamarre@efficios.com>
Thu, 25 Apr 2019 22:23:33 +0000 (18:23 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 4 May 2019 19:29:04 +0000 (15:29 -0400)
Remove redundant verification for file descriptors with 0 revents in
code base.

Signed-off-by: Yannick Lamarre <ylamarre@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
17 files changed:
src/bin/lttng-consumerd/health-consumerd.c
src/bin/lttng-relayd/health-relayd.c
src/bin/lttng-relayd/live.c
src/bin/lttng-relayd/main.c
src/bin/lttng-sessiond/agent-thread.c
src/bin/lttng-sessiond/client.c
src/bin/lttng-sessiond/dispatch.c
src/bin/lttng-sessiond/health.c
src/bin/lttng-sessiond/ht-cleanup.c
src/bin/lttng-sessiond/manage-apps.c
src/bin/lttng-sessiond/manage-consumer.c
src/bin/lttng-sessiond/manage-kernel.c
src/bin/lttng-sessiond/notification-thread.c
src/bin/lttng-sessiond/notify-apps.c
src/bin/lttng-sessiond/register.c
src/bin/lttng-sessiond/rotation-thread.c
src/common/consumer/consumer.c

index 15b71a1abc7cc68214972e56a0eb923e31098d78..dc8b32aa880d74b8685c16422917e430c1af2f70 100644 (file)
@@ -266,11 +266,6 @@ restart:
                        revents = LTTNG_POLL_GETEV(&events, i);
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
-                       if (!revents) {
-                               /* No activity for this FD (poll implementation). */
-                               continue;
-                       }
-
                        /* Thread quit pipe has been closed. Killing thread. */
                        ret = check_health_quit_pipe(pollfd, revents);
                        if (ret) {
index 9b4eefcd55f93e7ad6e9e5e018a398b76fc75f5a..4a2dc65a6430bed4d1404a8b69ce4a76df937148 100644 (file)
@@ -343,11 +343,6 @@ restart:
                        revents = LTTNG_POLL_GETEV(&events, i);
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
-                       if (!revents) {
-                               /* No activity for this FD (poll implementation). */
-                               continue;
-                       }
-
                        /* Thread quit pipe has been closed. Killing thread. */
                        ret = check_health_quit_pipe(pollfd, revents);
                        if (ret) {
index 9efab8a73d8e3b4932122d3d425a8d588d286e0d..9503ba470b70cd496291ec612f304c45446661d5 100644 (file)
@@ -543,11 +543,6 @@ restart:
                        revents = LTTNG_POLL_GETEV(&events, i);
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
-                       if (!revents) {
-                               /* No activity for this FD (poll implementation). */
-                               continue;
-                       }
-
                        /* Thread quit pipe has been closed. Killing thread. */
                        ret = check_thread_quit_pipe(pollfd, revents);
                        if (ret) {
@@ -2000,11 +1995,6 @@ restart:
 
                        health_code_update();
 
-                       if (!revents) {
-                               /* No activity for this FD (poll implementation). */
-                               continue;
-                       }
-
                        /* Thread quit pipe has been closed. Killing thread. */
                        ret = check_thread_quit_pipe(pollfd, revents);
                        if (ret) {
index e81bdeffc82b97790ddf99bf6bb473636b0f4064..0ee27efce03af5a5dfa7d6f07c8899c001626f10 100644 (file)
@@ -858,14 +858,6 @@ restart:
                        revents = LTTNG_POLL_GETEV(&events, i);
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
-                       if (!revents) {
-                               /*
-                                * No activity for this FD (poll
-                                * implementation).
-                                */
-                               continue;
-                       }
-
                        /* Thread quit pipe has been closed. Killing thread. */
                        ret = check_thread_quit_pipe(pollfd, revents);
                        if (ret) {
@@ -3813,14 +3805,6 @@ restart:
 
                        health_code_update();
 
-                       if (!revents) {
-                               /*
-                                * No activity for this FD (poll
-                                * implementation).
-                                */
-                               continue;
-                       }
-
                        /* Thread quit pipe has been closed. Killing thread. */
                        ret = check_thread_quit_pipe(pollfd, revents);
                        if (ret) {
index f7be1ef71f0bf809fad7ba50ee72faf82ed5de85..575f6aee934a504ddb6248d4e87610d622d0959c 100644 (file)
@@ -404,11 +404,6 @@ restart:
                        revents = LTTNG_POLL_GETEV(&events, i);
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
-                       if (!revents) {
-                               /* No activity for this FD (poll implementation). */
-                               continue;
-                       }
-
                        /* Thread quit pipe has been closed. Killing thread. */
                        if (pollfd == quit_pipe_read_fd) {
                                goto exit;
index f3002f910a1c278348caacb0cc043408b40d1d11..4565a18c31efe55f70e94293cd03d6962d574af4 100644 (file)
@@ -2090,11 +2090,6 @@ static void *thread_manage_clients(void *data)
 
                        health_code_update();
 
-                       if (!revents) {
-                               /* No activity for this FD (poll implementation). */
-                               continue;
-                       }
-
                        if (pollfd == thread_quit_pipe_fd) {
                                err = 0;
                                goto exit;
index 04b3954c070b956d826c36f52b177371ff386ec8..a637f23dea8e8e665b3a87b88644cc18a7337bb8 100644 (file)
@@ -144,11 +144,6 @@ static void sanitize_wait_queue(struct ust_reg_wait_queue *wait_queue)
                uint32_t revents = LTTNG_POLL_GETEV(&events, i);
                int pollfd = LTTNG_POLL_GETFD(&events, i);
 
-               if (!revents) {
-                       /* No activity for this FD (poll implementation). */
-                       continue;
-               }
-
                cds_list_for_each_entry_safe(wait_node, tmp_wait_node,
                                &wait_queue->head, head) {
                        if (pollfd == wait_node->app->sock &&
index 9474a8560a7b540fd3bb22284300cee6f64c28be..9ff6bd1ae1013d9b86e5e178f920ff7286e63114 100644 (file)
@@ -165,11 +165,6 @@ restart:
                        revents = LTTNG_POLL_GETEV(&events, i);
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
-                       if (!revents) {
-                               /* No activity for this FD (poll implementation). */
-                               continue;
-                       }
-
                        /* Event on the registration socket */
                        if (pollfd == sock) {
                                if (revents & LPOLLIN) {
index 91c0544c3c8a28c8c8391b1d5f76b0927a48bab5..02244f0cafedf4aa44236d346fe3c658b7e368e6 100644 (file)
@@ -155,11 +155,6 @@ static void *thread_ht_cleanup(void *data)
                        revents = LTTNG_POLL_GETEV(&events, i);
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
-                       if (!revents) {
-                               /* No activity for this FD (poll implementation). */
-                               continue;
-                       }
-
                        if (pollfd != ht_cleanup_pipe[0]) {
                                continue;
                        }
index f9ec356da775213eab133c2ad1f27d547f548d3b..356c147aaf83bb5c2b29f9667e8a83021f76aec2 100644 (file)
@@ -123,11 +123,6 @@ static void *thread_application_management(void *data)
 
                        health_code_update();
 
-                       if (!revents) {
-                               /* No activity for this FD (poll implementation). */
-                               continue;
-                       }
-
                        if (pollfd == quit_pipe_read_fd) {
                                err = 0;
                                goto exit;
index b710c61f80ed3d837aa03a92c511e0176e13fd10..fa802adc91e33cd7e3ba92edfc1546a5f50b9016 100644 (file)
@@ -134,11 +134,6 @@ void *thread_consumer_management(void *data)
 
                health_code_update();
 
-               if (!revents) {
-                       /* No activity for this FD (poll implementation). */
-                       continue;
-               }
-
                /* Thread quit pipe has been closed. Killing thread. */
                if (pollfd == quit_pipe_read_fd) {
                        err = 0;
@@ -298,11 +293,6 @@ void *thread_consumer_management(void *data)
 
                        health_code_update();
 
-                       if (!revents) {
-                               /* No activity for this FD (poll implementation). */
-                               continue;
-                       }
-
                        /*
                         * Thread quit pipe has been triggered, flag that we should stop
                         * but continue the current loop to handle potential data from
index 34887d7b1d12db660122b9cb3eedef1756b5073f..f656c9f5cc6fcdc1e4b16219d22a7c76c9a70592 100644 (file)
@@ -267,11 +267,6 @@ static void *thread_kernel_management(void *data)
 
                        health_code_update();
 
-                       if (!revents) {
-                               /* No activity for this FD (poll implementation). */
-                               continue;
-                       }
-
                        if (pollfd == quit_pipe_read_fd) {
                                err = 0;
                                goto exit;
index 7998f7e21fbcf73818472312889a6794abe095d3..8c2892bda85e9905f642f26d61c5c6eaf26dfeb7 100644 (file)
@@ -570,9 +570,6 @@ void *thread_notification(void *data)
                        int fd = LTTNG_POLL_GETFD(&state.events, i);
                        uint32_t revents = LTTNG_POLL_GETEV(&state.events, i);
 
-                       if (!revents) {
-                               continue;
-                       }
                        DBG("[notification-thread] Handling fd (%i) activity (%u)", fd, revents);
 
                        if (fd == state.notification_channel_socket) {
index bc7405c7b4bf4c586ad3393428f22b86280fb6a0..17f3cd0c8254f52cd0e57388d8dfe67105723f3e 100644 (file)
@@ -109,11 +109,6 @@ restart:
                        revents = LTTNG_POLL_GETEV(&events, i);
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
-                       if (!revents) {
-                               /* No activity for this FD (poll implementation). */
-                               continue;
-                       }
-
                        /* Thread quit pipe has been closed. Killing thread. */
                        if (pollfd == quit_pipe_read_fd) {
                                err = 0;
index 6ce25ad0f66a1f9af143b73e3937693d444bf334..e809834faa4632b961d19053145b39b23c0f9e9a 100644 (file)
@@ -239,11 +239,6 @@ static void *thread_application_registration(void *data)
                        revents = LTTNG_POLL_GETEV(&events, i);
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
-                       if (!revents) {
-                               /* No activity for this FD (poll implementation). */
-                               continue;
-                       }
-
                        /* Thread quit pipe has been closed. Killing thread. */
                        if (pollfd == quit_pipe_read_fd) {
                                err = 0;
index b86b166892ad917fff5ba7f40366d0aa9bd08bc0..6669372dd471210470138dbab6605907fa15019d 100644 (file)
@@ -974,10 +974,6 @@ void *thread_rotation(void *data)
                        int fd = LTTNG_POLL_GETFD(&thread.events, i);
                        uint32_t revents = LTTNG_POLL_GETEV(&thread.events, i);
 
-                       if (!revents) {
-                               /* No activity for this FD (poll implementation). */
-                               continue;
-                       }
                        DBG("[rotation-thread] Handling fd (%i) activity (%u)",
                                        fd, revents);
 
index 10273e66a18fe496d98b1407a30a2ae9c840c1ea..c70d95a58bfc91a3a053c1d160be6ec1f8a0bba6 100644 (file)
@@ -2396,11 +2396,6 @@ restart:
                        revents = LTTNG_POLL_GETEV(&events, i);
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
-                       if (!revents) {
-                               /* No activity for this FD (poll implementation). */
-                               continue;
-                       }
-
                        if (pollfd == lttng_pipe_get_readfd(ctx->consumer_metadata_pipe)) {
                                if (revents & LPOLLIN) {
                                        ssize_t pipe_len;
@@ -2990,11 +2985,6 @@ restart:
                        revents = LTTNG_POLL_GETEV(&events, i);
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
-                       if (!revents) {
-                               /* No activity for this FD (poll implementation). */
-                               continue;
-                       }
-
                        if (pollfd == ctx->consumer_channel_pipe[0]) {
                                if (revents & LPOLLIN) {
                                        enum consumer_channel_action action;
This page took 0.046586 seconds and 4 git commands to generate.