Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
8d5db315
Commit
8d5db315
authored
Jul 14, 2020
by
Manish Pandey
Committed by
TrustedFirmware Code Review
Jul 14, 2020
Browse files
Merge "io_storage: remove redundant assigments" into integration
parents
3aa2abbb
a1ab463a
Changes
1
Hide whitespace changes
Inline
Side-by-side
drivers/io/io_storage.c
View file @
8d5db315
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment