[clang-tidy] do not return in void functions

Found with readability-redundant-control-flow

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2020-04-18 21:23:13 -07:00
parent 13ae035211
commit bd89499e07
No known key found for this signature in database
GPG Key ID: 36D31CFA845F0E3B
17 changed files with 0 additions and 33 deletions

View File

@ -398,7 +398,6 @@ done:
inst->lockpath = NULL;
}
free(diskpath);
return;
}
static void unlock_disk(struct fsck_instance *inst)
@ -425,7 +424,6 @@ static void free_instance(struct fsck_instance *i)
free(i->lockpath);
mnt_unref_fs(i->fs);
free(i);
return;
}
static struct libmnt_fs *add_dummy_fs(const char *device)

View File

@ -293,7 +293,6 @@ check_mount(void) {
printf(_("check aborted.\n"));
exit(FSCK_EX_OK);
}
return;
}
@ -511,7 +510,6 @@ write_super_block(void) {
die(_("seek failed in write_super_block"));
if (MINIX_BLOCK_SIZE != write(device_fd, super_block_buffer, MINIX_BLOCK_SIZE))
die(_("unable to write super-block"));
return;
}
static void
@ -1017,7 +1015,6 @@ check_file(struct minix_inode *dir, unsigned int offset) {
if (inode && S_ISDIR(inode->i_mode))
recursive_check(ino);
name_depth--;
return;
}
static void
@ -1087,7 +1084,6 @@ check_file2(struct minix2_inode *dir, unsigned int offset) {
if (inode && S_ISDIR(inode->i_mode))
recursive_check2(ino);
name_depth--;
return;
}
static void

View File

@ -93,7 +93,6 @@ static void add_id(struct idcache *ic, char *name, unsigned long int id)
if (w <= 0)
w = ent->name ? strlen(ent->name) : 0;
ic->width = ic->width < w ? w : ic->width;
return;
}
void add_uid(struct idcache *cache, unsigned long int id)

View File

@ -177,7 +177,6 @@ void random_get_bytes(void *buf, size_t nbytes)
sizeof(ul_jrand_seed)-sizeof(unsigned short));
}
#endif
return;
}

View File

@ -267,7 +267,6 @@ set_pri:
if (removable)
dev->bid_flags |= BLKID_BID_FL_REMOVABLE;
}
return;
}
#define PROC_PARTITIONS "/proc/partitions"

View File

@ -161,7 +161,6 @@ void blkid__scan_dir(char *dirname, dev_t devno, struct dir_list **list,
add_to_dirlist(dirname, dp->d_name, list);
}
closedir(dir);
return;
}
/* Directories where we will try to search for device numbers */

View File

@ -1998,7 +1998,6 @@ void blkid_probe_set_wiper(blkid_probe pr, uint64_t off, uint64_t size)
chn->driver->name,
chn->driver->idinfos[chn->idx]->name,
pr->wipe_off, pr->wipe_size));
return;
}
/*

View File

@ -420,7 +420,6 @@ void blkid_read_cache(blkid_cache cache)
return;
errout:
close(fd);
return;
}
#ifdef TEST_PROGRAM

View File

@ -195,7 +195,6 @@ static void parse_argv(struct chfn_control *ctl, int argc, char **argv)
}
ctl->username = argv[optind];
}
return;
}
/*
@ -310,7 +309,6 @@ static void get_login_defs(struct chfn_control *ctl)
warnx(_("%s: CHFN_RESTRICT has unexpected value: %s"), _PATH_LOGINDEFS, s);
if (!ctl->allow_fullname && !ctl->allow_room && !ctl->allow_work && !ctl->allow_home)
errx(EXIT_FAILURE, _("%s: CHFN_RESTRICT does not allow any changes"), _PATH_LOGINDEFS);
return;
}
/*

View File

@ -1225,7 +1225,6 @@ static void fill_table(const void *u, const VISIT which, const int depth __attri
err(EXIT_FAILURE, _("failed to add output data"));
++n;
}
return;
}
#ifdef HAVE_LIBSYSTEMD
static void print_journal_tail(const char *journal_path, uid_t uid, size_t len, int time_mode)

View File

@ -370,7 +370,6 @@ static char **parse_arguments(int argc, char **argv, struct kill_control *ctl)
ctl->do_kill = 1;
if (ctl->do_pid)
errx(EXIT_FAILURE, _("%s and %s are mutually exclusive"), "--pid", "--signal");
continue;
}
if (!*argv)
errx(EXIT_FAILURE, _("not enough arguments"));

View File

@ -254,7 +254,6 @@ static void dirlist_add_dir(struct wh_dirlist **ls0, int type, const char *dir)
}
DBG(LIST, ul_debugobj(*ls0, " add dir: %s", ls->path));
return;
}
/* special case for '*' in the paths */
@ -324,7 +323,6 @@ static void construct_dirlist_from_env(const char *env,
dirlist_add_dir(ls, type, tok);
free(pathcp);
return;
}
static void construct_dirlist_from_argv(struct wh_dirlist **ls,
@ -346,8 +344,6 @@ static void construct_dirlist_from_argv(struct wh_dirlist **ls,
dirlist_add_dir(ls, type, argv[i]);
*idx = i;
}
return;
}
static void construct_dirlist(struct wh_dirlist **ls,
@ -365,7 +361,6 @@ static void construct_dirlist(struct wh_dirlist **ls,
else
dirlist_add_subdir(ls, type, paths[i]);
}
return;
}
static void free_dirlist(struct wh_dirlist **ls0, int type)
@ -392,8 +387,6 @@ static void free_dirlist(struct wh_dirlist **ls0, int type)
ls = ls->next;
}
}
return;
}
@ -456,7 +449,6 @@ static void findin(const char *dir, const char *pattern, int *count, char **wait
++(*count);
}
closedir(dirp);
return;
}
static void lookup(const char *pattern, struct wh_dirlist *ls, int want)
@ -492,7 +484,6 @@ static void lookup(const char *pattern, struct wh_dirlist *ls, int want)
if (!uflag || count > 1)
putchar('\n');
return;
}
static void list_dirlist(struct wh_dirlist *ls)

View File

@ -353,7 +353,6 @@ static void do_shm (char format, int unit)
}
ipc_shm_free_info(shmds);
return;
}
static void do_sem (char format)
@ -455,7 +454,6 @@ static void do_sem (char format)
}
ipc_sem_free_info(semds);
return;
}
static void do_msg (char format, int unit)
@ -576,7 +574,6 @@ static void do_msg (char format, int unit)
}
ipc_msg_free_info(msgds);
return;
}
static void print_shm(int shmid, int unit)

View File

@ -147,7 +147,6 @@ static void dbg(char *fmt, ...)
#endif
va_end(args);
fflush(NULL);
return;
}
static int lookup_table(const struct ld_table *tab, const char *str)

View File

@ -228,7 +228,6 @@ static void add_scols_line(const struct swapon_ctl *ctl, struct libscols_table *
}
if (pr)
blkid_free_probe(pr);
return;
}
static int display_summary(void)

View File

@ -779,7 +779,6 @@ static void set_blanking(struct setterm_control *ctl)
default: /* should be impossible to reach */
abort();
}
return;
}
static void screendump(struct setterm_control *ctl)
@ -833,7 +832,6 @@ static void screendump(struct setterm_control *ctl)
free(ctl->in_device);
if (close_stream(out) != 0)
errx(EXIT_FAILURE, _("write error"));
return;
}
/* Some options are applicable when terminal is virtual console. */

View File

@ -100,7 +100,6 @@ static const char *color_cond(struct hexdump_pr *pr, unsigned char *bp, int bcnt
/* return the format string or check for another */
if (match ^ clr->invert)
return clr->fmt;
continue;
}
/* no match */