Commit 0550b294 authored by joseph daniel's avatar joseph daniel Committed by Mauro Carvalho Chehab

[media] staging/media/as102: removed else statements

The else statement is actually not required, as we can assign AS10X_CMD_ERROR
to the error variable directly.
Signed-off-by: default avatarjoseph daniel <josephdanielwalter@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d2b30e90
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
*/ */
int as10x_cmd_turn_on(struct as10x_bus_adapter_t *adap) int as10x_cmd_turn_on(struct as10x_bus_adapter_t *adap)
{ {
int error; int error = AS10X_CMD_ERROR;
struct as10x_cmd_t *pcmd, *prsp; struct as10x_cmd_t *pcmd, *prsp;
ENTER(); ENTER();
...@@ -54,8 +54,6 @@ int as10x_cmd_turn_on(struct as10x_bus_adapter_t *adap) ...@@ -54,8 +54,6 @@ int as10x_cmd_turn_on(struct as10x_bus_adapter_t *adap)
(uint8_t *) prsp, (uint8_t *) prsp,
sizeof(prsp->body.turn_on.rsp) + sizeof(prsp->body.turn_on.rsp) +
HEADER_SIZE); HEADER_SIZE);
} else {
error = AS10X_CMD_ERROR;
} }
if (error < 0) if (error < 0)
...@@ -77,7 +75,7 @@ int as10x_cmd_turn_on(struct as10x_bus_adapter_t *adap) ...@@ -77,7 +75,7 @@ int as10x_cmd_turn_on(struct as10x_bus_adapter_t *adap)
*/ */
int as10x_cmd_turn_off(struct as10x_bus_adapter_t *adap) int as10x_cmd_turn_off(struct as10x_bus_adapter_t *adap)
{ {
int error; int error = AS10X_CMD_ERROR;
struct as10x_cmd_t *pcmd, *prsp; struct as10x_cmd_t *pcmd, *prsp;
ENTER(); ENTER();
...@@ -99,8 +97,6 @@ int as10x_cmd_turn_off(struct as10x_bus_adapter_t *adap) ...@@ -99,8 +97,6 @@ int as10x_cmd_turn_off(struct as10x_bus_adapter_t *adap)
sizeof(pcmd->body.turn_off.req) + HEADER_SIZE, sizeof(pcmd->body.turn_off.req) + HEADER_SIZE,
(uint8_t *) prsp, (uint8_t *) prsp,
sizeof(prsp->body.turn_off.rsp) + HEADER_SIZE); sizeof(prsp->body.turn_off.rsp) + HEADER_SIZE);
} else {
error = AS10X_CMD_ERROR;
} }
if (error < 0) if (error < 0)
...@@ -124,7 +120,7 @@ int as10x_cmd_turn_off(struct as10x_bus_adapter_t *adap) ...@@ -124,7 +120,7 @@ int as10x_cmd_turn_off(struct as10x_bus_adapter_t *adap)
int as10x_cmd_set_tune(struct as10x_bus_adapter_t *adap, int as10x_cmd_set_tune(struct as10x_bus_adapter_t *adap,
struct as10x_tune_args *ptune) struct as10x_tune_args *ptune)
{ {
int error; int error = AS10X_CMD_ERROR;
struct as10x_cmd_t *preq, *prsp; struct as10x_cmd_t *preq, *prsp;
ENTER(); ENTER();
...@@ -159,8 +155,6 @@ int as10x_cmd_set_tune(struct as10x_bus_adapter_t *adap, ...@@ -159,8 +155,6 @@ int as10x_cmd_set_tune(struct as10x_bus_adapter_t *adap,
(uint8_t *) prsp, (uint8_t *) prsp,
sizeof(prsp->body.set_tune.rsp) sizeof(prsp->body.set_tune.rsp)
+ HEADER_SIZE); + HEADER_SIZE);
} else {
error = AS10X_CMD_ERROR;
} }
if (error < 0) if (error < 0)
...@@ -184,7 +178,7 @@ int as10x_cmd_set_tune(struct as10x_bus_adapter_t *adap, ...@@ -184,7 +178,7 @@ int as10x_cmd_set_tune(struct as10x_bus_adapter_t *adap,
int as10x_cmd_get_tune_status(struct as10x_bus_adapter_t *adap, int as10x_cmd_get_tune_status(struct as10x_bus_adapter_t *adap,
struct as10x_tune_status *pstatus) struct as10x_tune_status *pstatus)
{ {
int error; int error = AS10X_CMD_ERROR;
struct as10x_cmd_t *preq, *prsp; struct as10x_cmd_t *preq, *prsp;
ENTER(); ENTER();
...@@ -208,8 +202,6 @@ int as10x_cmd_get_tune_status(struct as10x_bus_adapter_t *adap, ...@@ -208,8 +202,6 @@ int as10x_cmd_get_tune_status(struct as10x_bus_adapter_t *adap,
sizeof(preq->body.get_tune_status.req) + HEADER_SIZE, sizeof(preq->body.get_tune_status.req) + HEADER_SIZE,
(uint8_t *) prsp, (uint8_t *) prsp,
sizeof(prsp->body.get_tune_status.rsp) + HEADER_SIZE); sizeof(prsp->body.get_tune_status.rsp) + HEADER_SIZE);
} else {
error = AS10X_CMD_ERROR;
} }
if (error < 0) if (error < 0)
...@@ -241,7 +233,7 @@ int as10x_cmd_get_tune_status(struct as10x_bus_adapter_t *adap, ...@@ -241,7 +233,7 @@ int as10x_cmd_get_tune_status(struct as10x_bus_adapter_t *adap,
*/ */
int as10x_cmd_get_tps(struct as10x_bus_adapter_t *adap, struct as10x_tps *ptps) int as10x_cmd_get_tps(struct as10x_bus_adapter_t *adap, struct as10x_tps *ptps)
{ {
int error; int error = AS10X_CMD_ERROR;
struct as10x_cmd_t *pcmd, *prsp; struct as10x_cmd_t *pcmd, *prsp;
ENTER(); ENTER();
...@@ -266,8 +258,6 @@ int as10x_cmd_get_tps(struct as10x_bus_adapter_t *adap, struct as10x_tps *ptps) ...@@ -266,8 +258,6 @@ int as10x_cmd_get_tps(struct as10x_bus_adapter_t *adap, struct as10x_tps *ptps)
(uint8_t *) prsp, (uint8_t *) prsp,
sizeof(prsp->body.get_tps.rsp) + sizeof(prsp->body.get_tps.rsp) +
HEADER_SIZE); HEADER_SIZE);
} else {
error = AS10X_CMD_ERROR;
} }
if (error < 0) if (error < 0)
...@@ -305,7 +295,7 @@ int as10x_cmd_get_tps(struct as10x_bus_adapter_t *adap, struct as10x_tps *ptps) ...@@ -305,7 +295,7 @@ int as10x_cmd_get_tps(struct as10x_bus_adapter_t *adap, struct as10x_tps *ptps)
int as10x_cmd_get_demod_stats(struct as10x_bus_adapter_t *adap, int as10x_cmd_get_demod_stats(struct as10x_bus_adapter_t *adap,
struct as10x_demod_stats *pdemod_stats) struct as10x_demod_stats *pdemod_stats)
{ {
int error; int error = AS10X_CMD_ERROR;
struct as10x_cmd_t *pcmd, *prsp; struct as10x_cmd_t *pcmd, *prsp;
ENTER(); ENTER();
...@@ -330,8 +320,6 @@ int as10x_cmd_get_demod_stats(struct as10x_bus_adapter_t *adap, ...@@ -330,8 +320,6 @@ int as10x_cmd_get_demod_stats(struct as10x_bus_adapter_t *adap,
(uint8_t *) prsp, (uint8_t *) prsp,
sizeof(prsp->body.get_demod_stats.rsp) sizeof(prsp->body.get_demod_stats.rsp)
+ HEADER_SIZE); + HEADER_SIZE);
} else {
error = AS10X_CMD_ERROR;
} }
if (error < 0) if (error < 0)
...@@ -370,7 +358,7 @@ int as10x_cmd_get_demod_stats(struct as10x_bus_adapter_t *adap, ...@@ -370,7 +358,7 @@ int as10x_cmd_get_demod_stats(struct as10x_bus_adapter_t *adap,
int as10x_cmd_get_impulse_resp(struct as10x_bus_adapter_t *adap, int as10x_cmd_get_impulse_resp(struct as10x_bus_adapter_t *adap,
uint8_t *is_ready) uint8_t *is_ready)
{ {
int error; int error = AS10X_CMD_ERROR;
struct as10x_cmd_t *pcmd, *prsp; struct as10x_cmd_t *pcmd, *prsp;
ENTER(); ENTER();
...@@ -395,8 +383,6 @@ int as10x_cmd_get_impulse_resp(struct as10x_bus_adapter_t *adap, ...@@ -395,8 +383,6 @@ int as10x_cmd_get_impulse_resp(struct as10x_bus_adapter_t *adap,
(uint8_t *) prsp, (uint8_t *) prsp,
sizeof(prsp->body.get_impulse_rsp.rsp) sizeof(prsp->body.get_impulse_rsp.rsp)
+ HEADER_SIZE); + HEADER_SIZE);
} else {
error = AS10X_CMD_ERROR;
} }
if (error < 0) if (error < 0)
......
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