summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgkostka <kostka.grzegorz@gmail.com>2015-10-08 19:11:48 +0200
committergkostka <kostka.grzegorz@gmail.com>2015-10-08 19:11:48 +0200
commitaa3c31b2b7a3ed6d7ac591292b40cde316dcde69 (patch)
tree445a5056979891ea0da777849467749419a52c23
parent2a7a75f8f98d051f8d2b7b78d31649e943329fa6 (diff)
Little code cleanup
-rw-r--r--lwext4/ext4_xattr.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/lwext4/ext4_xattr.c b/lwext4/ext4_xattr.c
index f498f8f..189c476 100644
--- a/lwext4/ext4_xattr.c
+++ b/lwext4/ext4_xattr.c
@@ -357,12 +357,13 @@ static struct ext4_xattr_item *
ext4_xattr_lookup_item(struct ext4_xattr_ref *xattr_ref, uint8_t name_index,
char *name, size_t name_len)
{
- struct ext4_xattr_item tmp, *ret;
- tmp.name_index = name_index;
- tmp.name = name;
- tmp.name_len = name_len;
- ret = RB_FIND(ext4_xattr_tree, &xattr_ref->root, &tmp);
- return ret;
+ struct ext4_xattr_item tmp = {
+ .name_index = name_index,
+ .name = name,
+ .name_len = name_len,
+ };
+
+ return RB_FIND(ext4_xattr_tree, &xattr_ref->root, &tmp);
}
static struct ext4_xattr_item *
@@ -543,8 +544,8 @@ static int ext4_xattr_write_to_disk(struct ext4_xattr_ref *xattr_ref)
{
int ret = EOK;
bool block_modified = false;
- void *ibody_data = 0;
- void *block_data = 0;
+ void *ibody_data = NULL;
+ void *block_data = NULL;
struct ext4_xattr_item *item, *save_item;
size_t inode_size_rem, block_size_rem;
struct ext4_xattr_ibody_header *ibody_header = NULL;