提交 488e27ad 编写于 作者: G Gustavo A. R. Silva 提交者: Mauro Carvalho Chehab

media: dvb-frontends: mb86a16: remove useless variables in signal_det()

Remove useless variables wait_t and wait_sym and code related.

Also, fix some coding style issues.

Addresses-Coverity-ID: 1226947
Signed-off-by: NGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 abc5b2cb
...@@ -415,27 +415,21 @@ static int signal_det(struct mb86a16_state *state, ...@@ -415,27 +415,21 @@ static int signal_det(struct mb86a16_state *state,
int smrt, int smrt,
unsigned char *SIG) unsigned char *SIG)
{ {
int ret;
int ret ; int smrtd;
int smrtd ; unsigned char S[3];
int wait_sym ; int i;
u32 wait_t;
unsigned char S[3] ;
int i ;
if (*SIG > 45) { if (*SIG > 45) {
if (CNTM_set(state, 2, 1, 2) < 0) { if (CNTM_set(state, 2, 1, 2) < 0) {
dprintk(verbose, MB86A16_ERROR, 1, "CNTM set Error"); dprintk(verbose, MB86A16_ERROR, 1, "CNTM set Error");
return -1; return -1;
} }
wait_sym = 40000;
} else { } else {
if (CNTM_set(state, 3, 1, 2) < 0) { if (CNTM_set(state, 3, 1, 2) < 0) {
dprintk(verbose, MB86A16_ERROR, 1, "CNTM set Error"); dprintk(verbose, MB86A16_ERROR, 1, "CNTM set Error");
return -1; return -1;
} }
wait_sym = 80000;
} }
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
if (i == 0) if (i == 0)
...@@ -447,22 +441,17 @@ static int signal_det(struct mb86a16_state *state, ...@@ -447,22 +441,17 @@ static int signal_det(struct mb86a16_state *state,
smrt_info_get(state, smrtd); smrt_info_get(state, smrtd);
smrt_set(state, smrtd); smrt_set(state, smrtd);
srst(state); srst(state);
wait_t = (wait_sym + 99 * smrtd / 100) / smrtd;
if (wait_t == 0)
wait_t = 1;
msleep_interruptible(10); msleep_interruptible(10);
if (mb86a16_read(state, 0x37, &(S[i])) != 2) { if (mb86a16_read(state, 0x37, &(S[i])) != 2) {
dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error");
return -EREMOTEIO; return -EREMOTEIO;
} }
} }
if ((S[1] > S[0] * 112 / 100) && if ((S[1] > S[0] * 112 / 100) && (S[1] > S[2] * 112 / 100))
(S[1] > S[2] * 112 / 100)) {
ret = 1; ret = 1;
} else { else
ret = 0; ret = 0;
}
*SIG = S[1]; *SIG = S[1];
if (CNTM_set(state, 0, 1, 2) < 0) { if (CNTM_set(state, 0, 1, 2) < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册