chiark / gitweb /
Remove dead lines in various places
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 23 Feb 2014 00:26:27 +0000 (19:26 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 25 Feb 2014 00:24:14 +0000 (19:24 -0500)
As pointed-out by clang -Wunreachable-code.

No behaviour changes.

13 files changed:
src/bootchart/bootchart.c
src/bus-proxyd/bus-proxyd.c
src/core/service.c
src/journal/journal-file.c
src/journal/journald-server.c
src/journal/sd-journal.c
src/libsystemd/sd-event/sd-event.c
src/libsystemd/sd-rtnl/rtnl-message.c
src/login/logind.c
src/shared/install.c
src/shared/time-dst.c
src/udev/scsi_id/scsi_id.c
src/udev/udevadm-info.c

index 305a31ae9443a1579b83b79461bfb57ea14eb035..9f72d98126c1b4d8e02934b0e6fd0932835ea1ea 100644 (file)
@@ -220,7 +220,6 @@ static int parse_args(int argc, char *argv[]) {
                         fprintf(stderr, " --help,      -h          Display this message\n");
                         fprintf(stderr, "See bootchart.conf for more information.\n");
                         exit (EXIT_SUCCESS);
                         fprintf(stderr, " --help,      -h          Display this message\n");
                         fprintf(stderr, "See bootchart.conf for more information.\n");
                         exit (EXIT_SUCCESS);
-                        break;
                 default:
                         break;
                 }
                 default:
                         break;
                 }
index b9e4d9d2ace07a34b9b4fa6b1c727929dd2fef38..80f83e777fee9fc9bb66dc5e908016ad8d68e7d0 100644 (file)
@@ -774,8 +774,6 @@ int main(int argc, char *argv[]) {
                 }
         }
 
                 }
         }
 
-        r = 0;
-
 finish:
         sd_bus_flush(a);
         sd_bus_flush(b);
 finish:
         sd_bus_flush(a);
         sd_bus_flush(b);
index 697777425780512128cbcc0dca91b782169b898f..6de24ec5bd320e74b400fab3f22d8ec50b6aa03d 100644 (file)
@@ -1436,9 +1436,7 @@ static int service_search_main_pid(Service *s) {
                 log_warning_unit(UNIT(s)->id,
                                  "Failed to watch PID "PID_FMT" from service %s",
                                  pid, UNIT(s)->id);
                 log_warning_unit(UNIT(s)->id,
                                  "Failed to watch PID "PID_FMT" from service %s",
                                  pid, UNIT(s)->id);
-                return r;
-
-        return 0;
+        return r;
 }
 
 static void service_set_state(Service *s, ServiceState state) {
 }
 
 static void service_set_state(Service *s, ServiceState state) {
index 23c4d28e730482ff715085beb6bfe03338c61510..5876733598c46326134463eb6dea3e2a9d5790d2 100644 (file)
@@ -2210,8 +2210,6 @@ int journal_file_move_to_entry_by_monotonic_for_data(
 
                 z = q;
         }
 
                 z = q;
         }
-
-        return 0;
 }
 
 int journal_file_move_to_entry_by_seqnum_for_data(
 }
 
 int journal_file_move_to_entry_by_seqnum_for_data(
index 96ef66db5fa95b1b14c08b9a6f938e98632259bb..2a90b443b175af054a7e54cd06a081dbe07245c7 100644 (file)
@@ -1131,15 +1131,13 @@ int process_datagram(sd_event_source *es, int fd, uint32_t revents, void *userda
                 union {
                         struct cmsghdr cmsghdr;
 
                 union {
                         struct cmsghdr cmsghdr;
 
-                        /* We use NAME_MAX space for the
-                         * SELinux label here. The kernel
-                         * currently enforces no limit, but
-                         * according to suggestions from the
-                         * SELinux people this will change and
-                         * it will probably be identical to
-                         * NAME_MAX. For now we use that, but
-                         * this should be updated one day when
-                         * the final limit is known.*/
+                        /* We use NAME_MAX space for the SELinux label
+                         * here. The kernel currently enforces no
+                         * limit, but according to suggestions from
+                         * the SELinux people this will change and it
+                         * will probably be identical to NAME_MAX. For
+                         * now we use that, but this should be updated
+                         * one day when the final limit is known.*/
                         uint8_t buf[CMSG_SPACE(sizeof(struct ucred)) +
                                     CMSG_SPACE(sizeof(struct timeval)) +
                                     CMSG_SPACE(sizeof(int)) + /* fd */
                         uint8_t buf[CMSG_SPACE(sizeof(struct ucred)) +
                                     CMSG_SPACE(sizeof(struct timeval)) +
                                     CMSG_SPACE(sizeof(int)) + /* fd */
@@ -1216,8 +1214,6 @@ int process_datagram(sd_event_source *es, int fd, uint32_t revents, void *userda
 
                 close_many(fds, n_fds);
         }
 
                 close_many(fds, n_fds);
         }
-
-        return 0;
 }
 
 static int dispatch_sigusr1(sd_event_source *es, const struct signalfd_siginfo *si, void *userdata) {
 }
 
 static int dispatch_sigusr1(sd_event_source *es, const struct signalfd_siginfo *si, void *userdata) {
index 3740a9a84035c1c5926371a3c503f27936d415dc..ef455e901da9a3ee62328e2510a18554f5e60e18 100644 (file)
@@ -2293,8 +2293,6 @@ _public_ int sd_journal_process(sd_journal *j) {
                         l -= step;
                 }
         }
                         l -= step;
                 }
         }
-
-        return determine_change(j);
 }
 
 _public_ int sd_journal_wait(sd_journal *j, uint64_t timeout_usec) {
 }
 
 _public_ int sd_journal_wait(sd_journal *j, uint64_t timeout_usec) {
index 253923d8fa3a9c635e6c8168794407a2b8f6cf0f..db7643347f3f45c9f2e8584548a43d48c0c93088 100644 (file)
@@ -1814,8 +1814,6 @@ static int process_signal(sd_event *e, uint32_t events) {
                 if (r < 0)
                         return r;
         }
                 if (r < 0)
                         return r;
         }
-
-        return 0;
 }
 
 static int source_dispatch(sd_event_source *s) {
 }
 
 static int source_dispatch(sd_event_source *s) {
index 8c20b8e7655eb44346a08c9baa38ba6d8a37eb31..dc749479939fc8b7d05c548f8243e23dab349c57 100644 (file)
@@ -480,7 +480,7 @@ int sd_rtnl_message_append_u16(sd_rtnl_message *m, unsigned short type, uint16_t
                                 break;
                         else
                                 return -ENOTSUP;
                                 break;
                         else
                                 return -ENOTSUP;
-                        break;
+
                 default:
                         return -ENOTSUP;
         }
                 default:
                         return -ENOTSUP;
         }
@@ -932,10 +932,6 @@ int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret) {
 
         if (k > 0)
                 switch (m->hdr->nlmsg_type) {
 
         if (k > 0)
                 switch (m->hdr->nlmsg_type) {
-                        struct ifinfomsg *ifi;
-                        struct ifaddrmsg *ifa;
-                        struct rtmsg *rtm;
-
                         /* check that the size matches the message type */
                         case NLMSG_ERROR:
                                 if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr)))
                         /* check that the size matches the message type */
                         case NLMSG_ERROR:
                                 if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr)))
@@ -948,6 +944,8 @@ int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret) {
                                 if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct ifinfomsg)))
                                         k = -EIO;
                                 else {
                                 if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct ifinfomsg)))
                                         k = -EIO;
                                 else {
+                                        struct ifinfomsg *ifi;
+
                                         ifi = NLMSG_DATA(m->hdr);
                                         UPDATE_RTA(m, IFLA_RTA(ifi));
                                 }
                                         ifi = NLMSG_DATA(m->hdr);
                                         UPDATE_RTA(m, IFLA_RTA(ifi));
                                 }
@@ -958,6 +956,8 @@ int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret) {
                                 if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct ifaddrmsg)))
                                         k = -EIO;
                                 else {
                                 if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct ifaddrmsg)))
                                         k = -EIO;
                                 else {
+                                        struct ifaddrmsg *ifa;
+
                                         ifa = NLMSG_DATA(m->hdr);
                                         UPDATE_RTA(m, IFA_RTA(ifa));
                                 }
                                         ifa = NLMSG_DATA(m->hdr);
                                         UPDATE_RTA(m, IFA_RTA(ifa));
                                 }
@@ -968,6 +968,8 @@ int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret) {
                                 if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct rtmsg)))
                                         k = -EIO;
                                 else {
                                 if (m->hdr->nlmsg_len < NLMSG_LENGTH(sizeof(struct rtmsg)))
                                         k = -EIO;
                                 else {
+                                        struct rtmsg *rtm;
+
                                         rtm = NLMSG_DATA(m->hdr);
                                         UPDATE_RTA(m, RTM_RTA(rtm));
                                 }
                                         rtm = NLMSG_DATA(m->hdr);
                                         UPDATE_RTA(m, RTM_RTA(rtm));
                                 }
index 3a514bbf81311cca8b43978519d9e1efb3659294..10f61aba388d8a42c0230239dc751e4e667d8473 100644 (file)
@@ -1078,8 +1078,6 @@ int manager_run(Manager *m) {
                 if (r < 0)
                         return r;
         }
                 if (r < 0)
                         return r;
         }
-
-        return 0;
 }
 
 static int manager_parse_config_file(Manager *m) {
 }
 
 static int manager_parse_config_file(Manager *m) {
index 1f9d7e2e3a99f9055082c5cc6668f5d858621ef2..f57b94d599daf574fd1d38898ef267f9ddbb7847 100644 (file)
@@ -469,8 +469,6 @@ static int find_symlinks_fd(
                                 return 1;
                 }
         }
                                 return 1;
                 }
         }
-
-        return r;
 }
 
 static int find_symlinks(
 }
 
 static int find_symlinks(
index 65e2998c983a5f9bab9343b1b5cfe15c58b03a05..ceca2fafae2f027288b5bc0677726a176e6b3784 100644 (file)
@@ -207,8 +207,8 @@ read_again:
                 if (type_idxs[i] >= num_types)
                         return -EINVAL;
 
                 if (type_idxs[i] >= num_types)
                         return -EINVAL;
 
-        if ((BYTE_ORDER != BIG_ENDIAN && (sizeof(time_t) == 4 || trans_width == 4)) ||
-            (BYTE_ORDER == BIG_ENDIAN && sizeof(time_t) == 8 && trans_width == 4)) {
+        if (BYTE_ORDER == BIG_ENDIAN ? sizeof(time_t) == 8 && trans_width == 4
+                                     : sizeof(time_t) == 4 || trans_width == 4) {
                 /* Decode the transition times, stored as 4-byte integers in
                    network (big-endian) byte order.  We work from the end of
                    the array so as not to clobber the next element to be
                 /* Decode the transition times, stored as 4-byte integers in
                    network (big-endian) byte order.  We work from the end of
                    the array so as not to clobber the next element to be
index 03bd3a9182f3efc6aeb4d95222cf3cd72df0e9d8..5511df882550b44313c987c7c64929acd38c2744 100644 (file)
@@ -396,7 +396,6 @@ static int set_options(struct udev *udev,
                 case 'V':
                         printf("%s\n", VERSION);
                         exit(0);
                 case 'V':
                         printf("%s\n", VERSION);
                         exit(0);
-                        break;
 
                 case 'x':
                         export = true;
 
                 case 'x':
                         export = true;
index 64bb537210d105ab2e8a437551e590008b02d947..8145e6f50c1a1ffe4f452b7e3cd8800c084fe8cf 100644 (file)
@@ -498,8 +498,7 @@ static int uinfo(struct udev *udev, int argc, char *argv[])
                         print_record(device);
                         break;
                 default:
                         print_record(device);
                         break;
                 default:
-                        fprintf(stderr, "unknown query type\n");
-                        break;
+                        assert_not_reached("unknown query type");
                 }
                 break;
         case ACTION_ATTRIBUTE_WALK:
                 }
                 break;
         case ACTION_ATTRIBUTE_WALK: