[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:
parent
13ae035211
commit
bd89499e07
|
@ -398,7 +398,6 @@ done:
|
||||||
inst->lockpath = NULL;
|
inst->lockpath = NULL;
|
||||||
}
|
}
|
||||||
free(diskpath);
|
free(diskpath);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void unlock_disk(struct fsck_instance *inst)
|
static void unlock_disk(struct fsck_instance *inst)
|
||||||
|
@ -425,7 +424,6 @@ static void free_instance(struct fsck_instance *i)
|
||||||
free(i->lockpath);
|
free(i->lockpath);
|
||||||
mnt_unref_fs(i->fs);
|
mnt_unref_fs(i->fs);
|
||||||
free(i);
|
free(i);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct libmnt_fs *add_dummy_fs(const char *device)
|
static struct libmnt_fs *add_dummy_fs(const char *device)
|
||||||
|
|
|
@ -293,7 +293,6 @@ check_mount(void) {
|
||||||
printf(_("check aborted.\n"));
|
printf(_("check aborted.\n"));
|
||||||
exit(FSCK_EX_OK);
|
exit(FSCK_EX_OK);
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -511,7 +510,6 @@ write_super_block(void) {
|
||||||
die(_("seek failed in write_super_block"));
|
die(_("seek failed in write_super_block"));
|
||||||
if (MINIX_BLOCK_SIZE != write(device_fd, super_block_buffer, MINIX_BLOCK_SIZE))
|
if (MINIX_BLOCK_SIZE != write(device_fd, super_block_buffer, MINIX_BLOCK_SIZE))
|
||||||
die(_("unable to write super-block"));
|
die(_("unable to write super-block"));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1017,7 +1015,6 @@ check_file(struct minix_inode *dir, unsigned int offset) {
|
||||||
if (inode && S_ISDIR(inode->i_mode))
|
if (inode && S_ISDIR(inode->i_mode))
|
||||||
recursive_check(ino);
|
recursive_check(ino);
|
||||||
name_depth--;
|
name_depth--;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1087,7 +1084,6 @@ check_file2(struct minix2_inode *dir, unsigned int offset) {
|
||||||
if (inode && S_ISDIR(inode->i_mode))
|
if (inode && S_ISDIR(inode->i_mode))
|
||||||
recursive_check2(ino);
|
recursive_check2(ino);
|
||||||
name_depth--;
|
name_depth--;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -93,7 +93,6 @@ static void add_id(struct idcache *ic, char *name, unsigned long int id)
|
||||||
if (w <= 0)
|
if (w <= 0)
|
||||||
w = ent->name ? strlen(ent->name) : 0;
|
w = ent->name ? strlen(ent->name) : 0;
|
||||||
ic->width = ic->width < w ? w : ic->width;
|
ic->width = ic->width < w ? w : ic->width;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_uid(struct idcache *cache, unsigned long int id)
|
void add_uid(struct idcache *cache, unsigned long int id)
|
||||||
|
|
|
@ -177,7 +177,6 @@ void random_get_bytes(void *buf, size_t nbytes)
|
||||||
sizeof(ul_jrand_seed)-sizeof(unsigned short));
|
sizeof(ul_jrand_seed)-sizeof(unsigned short));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -267,7 +267,6 @@ set_pri:
|
||||||
if (removable)
|
if (removable)
|
||||||
dev->bid_flags |= BLKID_BID_FL_REMOVABLE;
|
dev->bid_flags |= BLKID_BID_FL_REMOVABLE;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PROC_PARTITIONS "/proc/partitions"
|
#define PROC_PARTITIONS "/proc/partitions"
|
||||||
|
|
|
@ -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);
|
add_to_dirlist(dirname, dp->d_name, list);
|
||||||
}
|
}
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Directories where we will try to search for device numbers */
|
/* Directories where we will try to search for device numbers */
|
||||||
|
|
|
@ -1998,7 +1998,6 @@ void blkid_probe_set_wiper(blkid_probe pr, uint64_t off, uint64_t size)
|
||||||
chn->driver->name,
|
chn->driver->name,
|
||||||
chn->driver->idinfos[chn->idx]->name,
|
chn->driver->idinfos[chn->idx]->name,
|
||||||
pr->wipe_off, pr->wipe_size));
|
pr->wipe_off, pr->wipe_size));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -420,7 +420,6 @@ void blkid_read_cache(blkid_cache cache)
|
||||||
return;
|
return;
|
||||||
errout:
|
errout:
|
||||||
close(fd);
|
close(fd);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TEST_PROGRAM
|
#ifdef TEST_PROGRAM
|
||||||
|
|
|
@ -195,7 +195,6 @@ static void parse_argv(struct chfn_control *ctl, int argc, char **argv)
|
||||||
}
|
}
|
||||||
ctl->username = argv[optind];
|
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);
|
warnx(_("%s: CHFN_RESTRICT has unexpected value: %s"), _PATH_LOGINDEFS, s);
|
||||||
if (!ctl->allow_fullname && !ctl->allow_room && !ctl->allow_work && !ctl->allow_home)
|
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);
|
errx(EXIT_FAILURE, _("%s: CHFN_RESTRICT does not allow any changes"), _PATH_LOGINDEFS);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -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"));
|
err(EXIT_FAILURE, _("failed to add output data"));
|
||||||
++n;
|
++n;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
#ifdef HAVE_LIBSYSTEMD
|
#ifdef HAVE_LIBSYSTEMD
|
||||||
static void print_journal_tail(const char *journal_path, uid_t uid, size_t len, int time_mode)
|
static void print_journal_tail(const char *journal_path, uid_t uid, size_t len, int time_mode)
|
||||||
|
|
|
@ -370,7 +370,6 @@ static char **parse_arguments(int argc, char **argv, struct kill_control *ctl)
|
||||||
ctl->do_kill = 1;
|
ctl->do_kill = 1;
|
||||||
if (ctl->do_pid)
|
if (ctl->do_pid)
|
||||||
errx(EXIT_FAILURE, _("%s and %s are mutually exclusive"), "--pid", "--signal");
|
errx(EXIT_FAILURE, _("%s and %s are mutually exclusive"), "--pid", "--signal");
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
if (!*argv)
|
if (!*argv)
|
||||||
errx(EXIT_FAILURE, _("not enough arguments"));
|
errx(EXIT_FAILURE, _("not enough arguments"));
|
||||||
|
|
|
@ -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));
|
DBG(LIST, ul_debugobj(*ls0, " add dir: %s", ls->path));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* special case for '*' in the paths */
|
/* 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);
|
dirlist_add_dir(ls, type, tok);
|
||||||
|
|
||||||
free(pathcp);
|
free(pathcp);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void construct_dirlist_from_argv(struct wh_dirlist **ls,
|
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]);
|
dirlist_add_dir(ls, type, argv[i]);
|
||||||
*idx = i;
|
*idx = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void construct_dirlist(struct wh_dirlist **ls,
|
static void construct_dirlist(struct wh_dirlist **ls,
|
||||||
|
@ -365,7 +361,6 @@ static void construct_dirlist(struct wh_dirlist **ls,
|
||||||
else
|
else
|
||||||
dirlist_add_subdir(ls, type, paths[i]);
|
dirlist_add_subdir(ls, type, paths[i]);
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void free_dirlist(struct wh_dirlist **ls0, int type)
|
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;
|
ls = ls->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -456,7 +449,6 @@ static void findin(const char *dir, const char *pattern, int *count, char **wait
|
||||||
++(*count);
|
++(*count);
|
||||||
}
|
}
|
||||||
closedir(dirp);
|
closedir(dirp);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lookup(const char *pattern, struct wh_dirlist *ls, int want)
|
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)
|
if (!uflag || count > 1)
|
||||||
putchar('\n');
|
putchar('\n');
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void list_dirlist(struct wh_dirlist *ls)
|
static void list_dirlist(struct wh_dirlist *ls)
|
||||||
|
|
|
@ -353,7 +353,6 @@ static void do_shm (char format, int unit)
|
||||||
}
|
}
|
||||||
|
|
||||||
ipc_shm_free_info(shmds);
|
ipc_shm_free_info(shmds);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_sem (char format)
|
static void do_sem (char format)
|
||||||
|
@ -455,7 +454,6 @@ static void do_sem (char format)
|
||||||
}
|
}
|
||||||
|
|
||||||
ipc_sem_free_info(semds);
|
ipc_sem_free_info(semds);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_msg (char format, int unit)
|
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);
|
ipc_msg_free_info(msgds);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_shm(int shmid, int unit)
|
static void print_shm(int shmid, int unit)
|
||||||
|
|
|
@ -147,7 +147,6 @@ static void dbg(char *fmt, ...)
|
||||||
#endif
|
#endif
|
||||||
va_end(args);
|
va_end(args);
|
||||||
fflush(NULL);
|
fflush(NULL);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lookup_table(const struct ld_table *tab, const char *str)
|
static int lookup_table(const struct ld_table *tab, const char *str)
|
||||||
|
|
|
@ -228,7 +228,6 @@ static void add_scols_line(const struct swapon_ctl *ctl, struct libscols_table *
|
||||||
}
|
}
|
||||||
if (pr)
|
if (pr)
|
||||||
blkid_free_probe(pr);
|
blkid_free_probe(pr);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int display_summary(void)
|
static int display_summary(void)
|
||||||
|
|
|
@ -779,7 +779,6 @@ static void set_blanking(struct setterm_control *ctl)
|
||||||
default: /* should be impossible to reach */
|
default: /* should be impossible to reach */
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void screendump(struct setterm_control *ctl)
|
static void screendump(struct setterm_control *ctl)
|
||||||
|
@ -833,7 +832,6 @@ static void screendump(struct setterm_control *ctl)
|
||||||
free(ctl->in_device);
|
free(ctl->in_device);
|
||||||
if (close_stream(out) != 0)
|
if (close_stream(out) != 0)
|
||||||
errx(EXIT_FAILURE, _("write error"));
|
errx(EXIT_FAILURE, _("write error"));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Some options are applicable when terminal is virtual console. */
|
/* Some options are applicable when terminal is virtual console. */
|
||||||
|
|
|
@ -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 */
|
/* return the format string or check for another */
|
||||||
if (match ^ clr->invert)
|
if (match ^ clr->invert)
|
||||||
return clr->fmt;
|
return clr->fmt;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* no match */
|
/* no match */
|
||||||
|
|
Loading…
Reference in New Issue