reiserfsprogs: add helpers for constant endian routines
Initializing structures with little endian values requires a const value. This means that the endian routines that are macro blocks cause build failures. This patch introduces constant_ macros that don't involve an assignment. These can only be used with constant values or unexpected results may occur. Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This commit is contained in:
1 parent
19566d0878
commit
57eac8416c
3 files changed
+55
-32
No files matched your search
@@ -13,8 +13,9 @@ struct reiserfs_key root_dir_key = { 0, 0, {{0, 0},} };
|
||||
struct reiserfs_key parent_root_dir_key = { 0, 0, {{0, 0},} };
|
||||
struct reiserfs_key lost_found_dir_key = { 0, 0, {{0, 0},} };
|
||||
static struct reiserfs_key badblock_key =
|
||||
{ cpu_to_le32(BADBLOCK_DIRID), cpu_to_le32(BADBLOCK_OBJID),
|
||||
{{cpu_to_le32(0), cpu_to_le32(0)},} };
|
||||
{ constant_cpu_to_le32(BADBLOCK_DIRID),
|
||||
constant_cpu_to_le32(BADBLOCK_OBJID),
|
||||
{{constant_cpu_to_le32(0), constant_cpu_to_le32(0)},} };
|
||||
|
||||
__u16 root_dir_format = 0;
|
||||
__u16 lost_found_dir_format = 0;
|
||||
|
||||
@@ -174,13 +174,14 @@ int bin_search(void *p_v_key, /* Key to search for. */
|
||||
|
||||
/* Minimal possible key. It is never in the tree. */
|
||||
const struct reiserfs_key MIN_KEY =
|
||||
{ cpu_to_le32(0), cpu_to_le32(0),
|
||||
{{cpu_to_le32(0), cpu_to_le32(0)},} };
|
||||
{ constant_cpu_to_le32(0), constant_cpu_to_le32(0),
|
||||
{{constant_cpu_to_le32(0), constant_cpu_to_le32(0)},} };
|
||||
|
||||
/* Maximal possible key. It is never in the tree. */
|
||||
const struct reiserfs_key MAX_KEY =
|
||||
{ cpu_to_le32(0xffffffff), cpu_to_le32(0xffffffff),
|
||||
{{cpu_to_le32(0xffffffff), cpu_to_le32(0xffffffff)},} };
|
||||
{ constant_cpu_to_le32(0xffffffff), constant_cpu_to_le32(0xffffffff),
|
||||
{{constant_cpu_to_le32(0xffffffff),
|
||||
constant_cpu_to_le32(0xffffffff)},} };
|
||||
|
||||
/* Get delimiting key of the buffer by looking for it in the buffers in the
|
||||
path, starting from the bottom of the path, and going upwards. We must
|
||||
|
||||
Reference in new issue
Block a user