Commit a1ab463a authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

io_storage: remove redundant assigments



The assignments to 'result' are unneeded.

Change-Id: I18899f10bf9bd7f219f0e47a981683d8b4701bde
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 99c447f4
......@@ -34,8 +34,7 @@ static unsigned int dev_count;
/* Return a boolean value indicating whether a device connector is valid */
static int is_valid_dev_connector(const io_dev_connector_t *dev_con)
{
int result = (dev_con != NULL) && (dev_con->dev_open != NULL);
return result;
return (dev_con != NULL) && (dev_con->dev_open != NULL);
}
......@@ -43,10 +42,10 @@ static int is_valid_dev_connector(const io_dev_connector_t *dev_con)
static int is_valid_dev(const uintptr_t dev_handle)
{
const io_dev_info_t *dev = (io_dev_info_t *)dev_handle;
int result = (dev != NULL) && (dev->funcs != NULL) &&
return (dev != NULL) && (dev->funcs != NULL) &&
(dev->funcs->type != NULL) &&
(dev->funcs->type() < IO_TYPE_MAX);
return result;
}
......@@ -54,9 +53,9 @@ static int is_valid_dev(const uintptr_t dev_handle)
static int is_valid_entity(const uintptr_t handle)
{
const io_entity_t *entity = (io_entity_t *)handle;
int result = (entity != NULL) &&
return (entity != NULL) &&
(is_valid_dev((uintptr_t)entity->dev_handle));
return result;
}
......@@ -74,12 +73,10 @@ static int is_valid_seek_mode(io_seek_mode_t mode)
static int dev_open(const io_dev_connector_t *dev_con, const uintptr_t dev_spec,
io_dev_info_t **dev_info)
{
int result;
assert(dev_info != NULL);
assert(is_valid_dev_connector(dev_con));
result = dev_con->dev_open(dev_spec, dev_info);
return result;
return dev_con->dev_open(dev_spec, dev_info);
}
......@@ -163,11 +160,9 @@ int io_register_device(const io_dev_info_t *dev_info)
int io_dev_open(const io_dev_connector_t *dev_con, const uintptr_t dev_spec,
uintptr_t *handle)
{
int result;
assert(handle != NULL);
result = dev_open(dev_con, dev_spec, (io_dev_info_t **)handle);
return result;
return dev_open(dev_con, dev_spec, (io_dev_info_t **)handle);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment