summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@computergmbh.de>2007-09-14 10:31:06 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-09-14 10:31:06 -0400
commitddcaa0171a677a76078c6e0ad54c2f8033110a6f (patch)
tree2762ad4ae379ba32cd5e3316e501e05dc2392e4e
parent8454d619a7f6966f65f17c2a727e07ae3667b631 (diff)
Make btrfs-progs compile with -fstrict-aliasing (included in -O2) again.
This is done by doing a two-step conversion (rather than a one-step). First, the variable goes from type * to void *, and then to implicitly to void **. (Not sure if this is "good practice", but it shuts up the compiler, so it seems the compiler takes into account that we are actually punning it this way.)
-rw-r--r--bit-radix.c2
-rw-r--r--btrfsck.c2
-rw-r--r--extent-tree.c10
-rw-r--r--radix-tree.c2
4 files changed, 8 insertions, 8 deletions
diff --git a/bit-radix.c b/bit-radix.c
index 32ccb3a8..57f6f3c9 100644
--- a/bit-radix.c
+++ b/bit-radix.c
@@ -186,7 +186,7 @@ int find_first_radix_bit(struct radix_tree_root *radix, unsigned long *retbits,
unsigned long slot;
slot = start / BIT_RADIX_BITS_PER_ARRAY;
- ret = radix_tree_gang_lookup(radix, (void **)gang, slot,
+ ret = radix_tree_gang_lookup(radix, (void *)gang, slot,
ARRAY_SIZE(gang));
found = start % BIT_RADIX_BITS_PER_ARRAY;
for (i = 0; i < ret && nr > 0; i++) {
diff --git a/btrfsck.c b/btrfsck.c
index 628dfc3c..d8bfa537 100644
--- a/btrfsck.c
+++ b/btrfsck.c
@@ -420,7 +420,7 @@ int check_extent_refs(struct btrfs_root *root,
int err = 0;
while(1) {
- ret = radix_tree_gang_lookup(extent_radix, (void **)rec, 0,
+ ret = radix_tree_gang_lookup(extent_radix, (void *)rec, 0,
ARRAY_SIZE(rec));
if (!ret)
break;
diff --git a/extent-tree.c b/extent-tree.c
index 8b91df53..2c53192f 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -164,7 +164,7 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans,
btrfs_init_path(&path);
while(1) {
- ret = radix_tree_gang_lookup_tag(radix, (void **)cache,
+ ret = radix_tree_gang_lookup_tag(radix, (void *)cache,
0, ARRAY_SIZE(cache),
BTRFS_BLOCK_GROUP_DIRTY);
if (!ret)
@@ -195,7 +195,7 @@ static int update_block_group(struct btrfs_trans_handle *trans,
while(total) {
ret = radix_tree_gang_lookup(&info->block_group_radix,
- (void **)&cache, blocknr, 1);
+ (void *)&cache, blocknr, 1);
if (!ret)
return -1;
radix_tree_tag_set(&info->block_group_radix,
@@ -229,7 +229,7 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, struct
while(1) {
ret = radix_tree_gang_lookup(&root->fs_info->pinned_radix,
- (void **)gang, 0,
+ (void *)gang, 0,
ARRAY_SIZE(gang));
if (!ret)
break;
@@ -362,7 +362,7 @@ static int del_pending_extents(struct btrfs_trans_handle *trans, struct
while(1) {
ret = radix_tree_gang_lookup_tag(
&extent_root->fs_info->cache_radix,
- (void **)gang, 0,
+ (void *)gang, 0,
ARRAY_SIZE(gang),
CTREE_EXTENT_PENDING_DEL);
if (!ret)
@@ -738,7 +738,7 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info)
while(1) {
ret = radix_tree_gang_lookup(&info->block_group_radix,
- (void **)cache, 0,
+ (void *)cache, 0,
ARRAY_SIZE(cache));
if (!ret)
break;
diff --git a/radix-tree.c b/radix-tree.c
index abb754e6..ed01810a 100644
--- a/radix-tree.c
+++ b/radix-tree.c
@@ -314,7 +314,7 @@ static inline void **__lookup_slot(struct radix_tree_root *root,
return NULL;
if (height == 0 && root->rnode)
- return (void **)&root->rnode;
+ return (void *)&root->rnode;
shift = (height-1) * RADIX_TREE_MAP_SHIFT;
slot = &root->rnode;