From e772dc854be0fa0f90254e09b3fe0cd3831fc38c Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 14 Jun 2017 15:37:52 +0200 Subject: 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 --- ubifs-utils/mkfs.ubifs/defs.h | 2 -- ubifs-utils/mkfs.ubifs/key.h | 8 +++++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'ubifs-utils') 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 + /** * 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); } -- cgit v1.2.3