From cba392b661d3fcf92d50d0df7c8783e18bb992da Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 4 Aug 2015 13:21:42 +0200 Subject: libmount: cleanup assert() usage Signed-off-by: Karel Zak --- libmount/src/context.c | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'libmount/src/context.c') diff --git a/libmount/src/context.c b/libmount/src/context.c index ec04191fc..5ab0b794e 100644 --- a/libmount/src/context.c +++ b/libmount/src/context.c @@ -259,7 +259,6 @@ const char *mnt_context_get_writable_tabpath(struct libmnt_context *cxt) static int set_flag(struct libmnt_context *cxt, int flag, int enable) { - assert(cxt); if (!cxt) return -EINVAL; if (enable) { @@ -1391,7 +1390,6 @@ int mnt_context_get_mflags(struct libmnt_context *cxt, unsigned long *flags) */ int mnt_context_set_user_mflags(struct libmnt_context *cxt, unsigned long flags) { - assert(cxt); if (!cxt) return -EINVAL; cxt->user_mountflags = flags; @@ -1464,9 +1462,6 @@ int mnt_context_prepare_srcpath(struct libmnt_context *cxt) assert(cxt->fs); assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED)); - if (!cxt || !cxt->fs) - return -EINVAL; - DBG(CXT, ul_debugobj(cxt, "preparing source path")); src = mnt_fs_get_source(cxt->fs); @@ -1582,9 +1577,6 @@ int mnt_context_prepare_target(struct libmnt_context *cxt) assert(cxt->fs); assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED)); - if (!cxt || !cxt->fs) - return -EINVAL; - DBG(CXT, ul_debugobj(cxt, "preparing target path")); tgt = mnt_fs_get_target(cxt->fs); @@ -1667,9 +1659,6 @@ int mnt_context_guess_fstype(struct libmnt_context *cxt) DBG(CXT, ul_debugobj(cxt, "preparing fstype")); - if (!cxt || !cxt->fs) - return -EINVAL; - if ((cxt->mountflags & (MS_BIND | MS_MOVE)) || mnt_context_propagation_only(cxt)) goto none; @@ -1921,9 +1910,6 @@ static int apply_table(struct libmnt_context *cxt, struct libmnt_table *tb, assert(cxt); assert(cxt->fs); - if (!cxt->fs) - return -EINVAL; - src = mnt_fs_get_source(cxt->fs); tgt = mnt_fs_get_target(cxt->fs); -- cgit v1.2.3-55-g7522