summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-10-23 15:29:03 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-11-05 17:10:54 +0100
commit4729b4ba09dc1742af0484e1bd2fa3b6e3b9fad4 (patch)
treed277552997b1eb2568196c05c7e9c0d26bcd1b29 /common
parent592d35a47ce4ef2ffffd9805a1a534771882f3a6 (diff)
downloadbarebox-4729b4ba09dc1742af0484e1bd2fa3b6e3b9fad4.tar.gz
barebox-4729b4ba09dc1742af0484e1bd2fa3b6e3b9fad4.tar.xz
environment: drop unnecessary casts
No Need to cast void pointers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/environment.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/environment.c b/common/environment.c
index e55c7b7417..db3fad26e2 100644
--- a/common/environment.c
+++ b/common/environment.c
@@ -106,14 +106,14 @@ static int file_save_action(const char *filename, struct stat *statbuf,
int fd;
int namelen = strlen(filename) + 1 - strlen(data->base);
- inode = (struct envfs_inode*)data->writep;
+ inode = data->writep;
inode->magic = ENVFS_32(ENVFS_INODE_MAGIC);
inode->headerlen = ENVFS_32(PAD4(namelen + sizeof(struct envfs_inode_end)));
data->writep += sizeof(struct envfs_inode);
strcpy(data->writep, filename + strlen(data->base));
data->writep += PAD4(namelen);
- inode_end = (struct envfs_inode_end*)data->writep;
+ inode_end = data->writep;
data->writep += sizeof(struct envfs_inode_end);
inode_end->magic = ENVFS_32(ENVFS_INODE_END_MAGIC);
inode_end->mode = ENVFS_32(S_IRWXU | S_IRWXG | S_IRWXO);
@@ -196,7 +196,7 @@ int envfs_save(const char *filename, const char *dirname, unsigned flags)
buf = xzalloc(size + sizeof(struct envfs_super));
data.writep = buf + sizeof(struct envfs_super);
- super = (struct envfs_super *)buf;
+ super = buf;
super->magic = ENVFS_32(ENVFS_MAGIC);
super->major = ENVFS_MAJOR;
super->minor = ENVFS_MINOR;
@@ -320,7 +320,7 @@ static int envfs_load_data(struct envfs_super *super, void *buf, size_t size,
struct envfs_inode_end *inode_end;
uint32_t inode_size, inode_headerlen, namelen;
- inode = (struct envfs_inode *)buf;
+ inode = buf;
buf += sizeof(struct envfs_inode);
if (ENVFS_32(inode->magic) != ENVFS_INODE_MAGIC) {
@@ -334,7 +334,7 @@ static int envfs_load_data(struct envfs_super *super, void *buf, size_t size,
if (super->major < 1)
inode_end = &inode_end_dummy;
else
- inode_end = (struct envfs_inode_end *)(buf + PAD4(namelen));
+ inode_end = buf + PAD4(namelen);
debug("loading %s size %d namelen %d headerlen %d\n", inode->data,
inode_size, namelen, inode_headerlen);
@@ -355,7 +355,7 @@ static int envfs_load_data(struct envfs_super *super, void *buf, size_t size,
if (S_ISLNK(ENVFS_32(inode_end->mode))) {
debug("symlink: %s -> %s\n", str, (char*)buf);
- if (symlink((char*)buf, str) < 0) {
+ if (symlink(buf, str) < 0) {
printf("symlink: %s -> %s :", str, (char*)buf);
perror("");
}