summaryrefslogtreecommitdiff
path: root/ubifs-utils/mkfs.ubifs
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2017-06-14 15:37:52 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2017-06-28 10:27:11 +0200
commite772dc854be0fa0f90254e09b3fe0cd3831fc38c (patch)
treee4c2873ec2090793bfdec39c762aa8e18fda30ec /ubifs-utils/mkfs.ubifs
parentb0b1bc51496b7c328fcda3e6164292fa0d1dbc18 (diff)
Replace defunct ubifs_assert
The ubifs assert defined in defs.h was only used in three places inside key.h and defined to never perform any checks at all. This patch replaces ubifs_assert in mkfs.ubifs with the regular libc assert macro. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'ubifs-utils/mkfs.ubifs')
-rw-r--r--ubifs-utils/mkfs.ubifs/defs.h2
-rw-r--r--ubifs-utils/mkfs.ubifs/key.h8
2 files changed, 5 insertions, 5 deletions
diff --git a/ubifs-utils/mkfs.ubifs/defs.h b/ubifs-utils/mkfs.ubifs/defs.h
index 1fa3316..8db5277 100644
--- a/ubifs-utils/mkfs.ubifs/defs.h
+++ b/ubifs-utils/mkfs.ubifs/defs.h
@@ -31,8 +31,6 @@
#define unlikely(x) (x)
-#define ubifs_assert(x) ({})
-
struct qstr
{
char *name;
diff --git a/ubifs-utils/mkfs.ubifs/key.h b/ubifs-utils/mkfs.ubifs/key.h
index 118858b..cd4b849 100644
--- a/ubifs-utils/mkfs.ubifs/key.h
+++ b/ubifs-utils/mkfs.ubifs/key.h
@@ -37,6 +37,8 @@
#ifndef __UBIFS_KEY_H__
#define __UBIFS_KEY_H__
+#include <assert.h>
+
/**
* key_mask_hash - mask a valid hash value.
* @val: value to be masked
@@ -113,7 +115,7 @@ static inline void dent_key_init(const struct ubifs_info *c,
{
uint32_t hash = c->key_hash(nm->name, nm->len);
- ubifs_assert(!(hash & ~UBIFS_S_KEY_HASH_MASK));
+ assert(!(hash & ~UBIFS_S_KEY_HASH_MASK));
key->u32[0] = inum;
key->u32[1] = hash | (UBIFS_DENT_KEY << UBIFS_S_KEY_HASH_BITS);
}
@@ -131,7 +133,7 @@ static inline void xent_key_init(const struct ubifs_info *c,
{
uint32_t hash = c->key_hash(nm->name, nm->len);
- ubifs_assert(!(hash & ~UBIFS_S_KEY_HASH_MASK));
+ assert(!(hash & ~UBIFS_S_KEY_HASH_MASK));
key->u32[0] = inum;
key->u32[1] = hash | (UBIFS_XENT_KEY << UBIFS_S_KEY_HASH_BITS);
}
@@ -146,7 +148,7 @@ static inline void xent_key_init(const struct ubifs_info *c,
static inline void data_key_init(union ubifs_key *key, ino_t inum,
unsigned int block)
{
- ubifs_assert(!(block & ~UBIFS_S_KEY_BLOCK_MASK));
+ assert(!(block & ~UBIFS_S_KEY_BLOCK_MASK));
key->u32[0] = inum;
key->u32[1] = block | (UBIFS_DATA_KEY << UBIFS_S_KEY_BLOCK_BITS);
}