diff options
author | Karel Zak | 2015-02-16 14:17:54 +0100 |
---|---|---|
committer | Karel Zak | 2015-02-16 14:17:54 +0100 |
commit | 37290a53960dcd7f71e948576b9978bf685d9012 (patch) | |
tree | 2846a160de656ea320057e6e6e83ff01bd4ea139 /libmount/src/tab.c | |
parent | libsmartcols: remove assert(arg) from public functions (diff) | |
download | kernel-qcow2-util-linux-37290a53960dcd7f71e948576b9978bf685d9012.tar.gz kernel-qcow2-util-linux-37290a53960dcd7f71e948576b9978bf685d9012.tar.xz kernel-qcow2-util-linux-37290a53960dcd7f71e948576b9978bf685d9012.zip |
libmount: remove assert(arg) from public functions
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/tab.c')
-rw-r--r-- | libmount/src/tab.c | 60 |
1 files changed, 2 insertions, 58 deletions
diff --git a/libmount/src/tab.c b/libmount/src/tab.c index a012eccca..cd20ad0b2 100644 --- a/libmount/src/tab.c +++ b/libmount/src/tab.c @@ -187,7 +187,6 @@ int mnt_table_get_nents(struct libmnt_table *tb) */ int mnt_table_is_empty(struct libmnt_table *tb) { - assert(tb); return tb == NULL || list_empty(&tb->ents) ? 1 : 0; } @@ -202,7 +201,6 @@ int mnt_table_is_empty(struct libmnt_table *tb) */ int mnt_table_set_userdata(struct libmnt_table *tb, void *data) { - assert(tb); if (!tb) return -EINVAL; @@ -218,7 +216,6 @@ int mnt_table_set_userdata(struct libmnt_table *tb, void *data) */ void *mnt_table_get_userdata(struct libmnt_table *tb) { - assert(tb); return tb ? tb->userdata : NULL; } @@ -244,14 +241,13 @@ void *mnt_table_get_userdata(struct libmnt_table *tb) * # this comments belongs to the first fs * LABEL=foo /mnt/foo auto defaults 1 2 * # this comments belongs to the second fs - * LABEL=bar /mnt/bar auto defaults 1 2 + * LABEL=bar /mnt/bar auto defaults 1 2 * # tailing comment * </programlisting> * </informalexample> */ void mnt_table_enable_comments(struct libmnt_table *tb, int enable) { - assert(tb); if (tb) tb->comms = enable; } @@ -276,7 +272,6 @@ int mnt_table_with_comments(struct libmnt_table *tb) */ const char *mnt_table_get_intro_comment(struct libmnt_table *tb) { - assert(tb); return tb ? tb->comm_intro : NULL; } @@ -293,7 +288,6 @@ int mnt_table_set_intro_comment(struct libmnt_table *tb, const char *comm) { char *p = NULL; - assert(tb); if (!tb) return -EINVAL; if (comm) { @@ -317,7 +311,6 @@ int mnt_table_set_intro_comment(struct libmnt_table *tb, const char *comm) */ int mnt_table_append_intro_comment(struct libmnt_table *tb, const char *comm) { - assert(tb); if (!tb) return -EINVAL; return append_string(&tb->comm_intro, comm); @@ -331,7 +324,6 @@ int mnt_table_append_intro_comment(struct libmnt_table *tb, const char *comm) */ const char *mnt_table_get_trailing_comment(struct libmnt_table *tb) { - assert(tb); return tb ? tb->comm_tail : NULL; } @@ -348,7 +340,6 @@ int mnt_table_set_trailing_comment(struct libmnt_table *tb, const char *comm) { char *p = NULL; - assert(tb); if (!tb) return -EINVAL; if (comm) { @@ -372,7 +363,6 @@ int mnt_table_set_trailing_comment(struct libmnt_table *tb, const char *comm) */ int mnt_table_append_trailing_comment(struct libmnt_table *tb, const char *comm) { - assert(tb); if (!tb) return -EINVAL; return append_string(&tb->comm_tail, comm); @@ -400,7 +390,6 @@ int mnt_table_append_trailing_comment(struct libmnt_table *tb, const char *comm) */ int mnt_table_set_cache(struct libmnt_table *tb, struct libmnt_cache *mpc) { - assert(tb); if (!tb) return -EINVAL; @@ -418,7 +407,6 @@ int mnt_table_set_cache(struct libmnt_table *tb, struct libmnt_cache *mpc) */ struct libmnt_cache *mnt_table_get_cache(struct libmnt_table *tb) { - assert(tb); return tb ? tb->cache : NULL; } @@ -435,9 +423,6 @@ struct libmnt_cache *mnt_table_get_cache(struct libmnt_table *tb) */ int mnt_table_add_fs(struct libmnt_table *tb, struct libmnt_fs *fs) { - assert(tb); - assert(fs); - if (!tb || !fs) return -EINVAL; @@ -463,9 +448,6 @@ int mnt_table_add_fs(struct libmnt_table *tb, struct libmnt_fs *fs) */ int mnt_table_remove_fs(struct libmnt_table *tb, struct libmnt_fs *fs) { - assert(tb); - assert(fs); - if (!tb || !fs) return -EINVAL; @@ -501,9 +483,6 @@ int mnt_table_get_root_fs(struct libmnt_table *tb, struct libmnt_fs **root) struct libmnt_fs *fs; int root_id = 0; - assert(tb); - assert(root); - if (!tb || !root || !is_mountinfo(tb)) return -EINVAL; @@ -612,10 +591,6 @@ int mnt_table_next_fs(struct libmnt_table *tb, struct libmnt_iter *itr, struct l { int rc = 1; - assert(tb); - assert(itr); - assert(fs); - if (!tb || !itr || !fs) return -EINVAL; *fs = NULL; @@ -639,9 +614,6 @@ int mnt_table_next_fs(struct libmnt_table *tb, struct libmnt_iter *itr, struct l */ int mnt_table_first_fs(struct libmnt_table *tb, struct libmnt_fs **fs) { - assert(tb); - assert(fs); - if (!tb || !fs) return -EINVAL; if (list_empty(&tb->ents)) @@ -659,9 +631,6 @@ int mnt_table_first_fs(struct libmnt_table *tb, struct libmnt_fs **fs) */ int mnt_table_last_fs(struct libmnt_table *tb, struct libmnt_fs **fs) { - assert(tb); - assert(fs); - if (!tb || !fs) return -EINVAL; if (list_empty(&tb->ents)) @@ -713,8 +682,6 @@ static int mnt_table_move_parent(struct libmnt_table *tb, int oldid, int newid) struct libmnt_iter itr; struct libmnt_fs *fs; - assert(tb); - if (!tb) return -EINVAL; if (list_empty(&tb->ents)) @@ -757,9 +724,6 @@ int mnt_table_uniq_fs(struct libmnt_table *tb, int flags, struct libmnt_fs *fs; int direction = MNT_ITER_BACKWARD; - assert(tb); - assert(cmp); - if (!tb || !cmp) return -EINVAL; if (list_empty(&tb->ents)) @@ -812,10 +776,6 @@ int mnt_table_uniq_fs(struct libmnt_table *tb, int flags, */ int mnt_table_set_iter(struct libmnt_table *tb, struct libmnt_iter *itr, struct libmnt_fs *fs) { - assert(tb); - assert(itr); - assert(fs); - if (!tb || !itr || !fs) return -EINVAL; @@ -893,9 +853,6 @@ struct libmnt_fs *mnt_table_find_target(struct libmnt_table *tb, const char *pat struct libmnt_fs *fs = NULL; char *cn; - assert(tb); - assert(path); - if (!tb || !path || !*path) return NULL; if (direction != MNT_ITER_FORWARD && direction != MNT_ITER_BACKWARD) @@ -969,7 +926,6 @@ struct libmnt_fs *mnt_table_find_srcpath(struct libmnt_table *tb, const char *pa char *cn; const char *p; - assert(tb); if (!tb || !path || !*path) return NULL; if (direction != MNT_ITER_FORWARD && direction != MNT_ITER_BACKWARD) @@ -1076,10 +1032,6 @@ struct libmnt_fs *mnt_table_find_tag(struct libmnt_table *tb, const char *tag, struct libmnt_iter itr; struct libmnt_fs *fs = NULL; - assert(tb); - assert(tag); - assert(val); - if (!tb || !tag || !*tag || !val) return NULL; if (direction != MNT_ITER_FORWARD && direction != MNT_ITER_BACKWARD) @@ -1123,8 +1075,6 @@ struct libmnt_fs *mnt_table_find_source(struct libmnt_table *tb, struct libmnt_fs *fs; char *t = NULL, *v = NULL; - assert(tb); - if (!tb) return NULL; if (direction != MNT_ITER_FORWARD && direction != MNT_ITER_BACKWARD) @@ -1162,9 +1112,6 @@ struct libmnt_fs *mnt_table_find_pair(struct libmnt_table *tb, const char *sourc struct libmnt_fs *fs = NULL; struct libmnt_iter itr; - assert(tb); - assert(target); - if (!tb || !target || !*target || !source || !*source) return NULL; if (direction != MNT_ITER_FORWARD && direction != MNT_ITER_BACKWARD) @@ -1335,7 +1282,7 @@ err: } /** - * mnt_table_is_fs__mounted: + * mnt_table_is_fs_mounted: * @tb: /proc/self/mountinfo file * @fstab_fs: /etc/fstab entry * @@ -1365,9 +1312,6 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs) int rc = 0; dev_t devno = 0; - assert(tb); - assert(fstab_fs); - DBG(FS, ul_debugobj(fstab_fs, "is FS mounted? [target=%s]", mnt_fs_get_target(fstab_fs))); |