media: dvb-frontends/stv6111: coding style cleanup
Fix up all remainders reported by checkpatch-strict. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
4f979d5cf0
commit
2af07a49dd
|
@ -542,12 +542,12 @@ static s32 table_lookup(struct slookup *table, int table_size, u16 reg_value)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Assumes Table[0].RegValue < Table[imax].RegValue */
|
/* Assumes Table[0].RegValue < Table[imax].RegValue */
|
||||||
if (reg_value <= table[0].reg_value)
|
if (reg_value <= table[0].reg_value) {
|
||||||
gain = table[0].value;
|
gain = table[0].value;
|
||||||
else if (reg_value >= table[imax].reg_value)
|
} else if (reg_value >= table[imax].reg_value) {
|
||||||
gain = table[imax].value;
|
gain = table[imax].value;
|
||||||
else {
|
} else {
|
||||||
while (imax-imin > 1) {
|
while ((imax - imin) > 1) {
|
||||||
i = (imax + imin) / 2;
|
i = (imax + imin) / 2;
|
||||||
if ((table[imin].reg_value <= reg_value) &&
|
if ((table[imin].reg_value <= reg_value) &&
|
||||||
(reg_value <= table[i].reg_value))
|
(reg_value <= table[i].reg_value))
|
||||||
|
@ -560,7 +560,7 @@ static s32 table_lookup(struct slookup *table, int table_size, u16 reg_value)
|
||||||
if (reg_diff != 0)
|
if (reg_diff != 0)
|
||||||
gain += ((s32)(reg_value - table[imin].reg_value) *
|
gain += ((s32)(reg_value - table[imin].reg_value) *
|
||||||
(s32)(table[imax].value
|
(s32)(table[imax].value
|
||||||
- table[imin].value))/(reg_diff);
|
- table[imin].value)) / reg_diff;
|
||||||
}
|
}
|
||||||
return gain;
|
return gain;
|
||||||
}
|
}
|
||||||
|
@ -587,25 +587,31 @@ static int get_rf_strength(struct dvb_frontend *fe, u16 *st)
|
||||||
if ((state->reg[0x02] & 0x80) == 0)
|
if ((state->reg[0x02] & 0x80) == 0)
|
||||||
/* NF */
|
/* NF */
|
||||||
gain = table_lookup(lnagain_nf_lookup,
|
gain = table_lookup(lnagain_nf_lookup,
|
||||||
ARRAY_SIZE(lnagain_nf_lookup), reg & 0x1F);
|
ARRAY_SIZE(lnagain_nf_lookup),
|
||||||
|
reg & 0x1F);
|
||||||
else
|
else
|
||||||
/* IIP3 */
|
/* IIP3 */
|
||||||
gain = table_lookup(lnagain_iip3_lookup,
|
gain = table_lookup(lnagain_iip3_lookup,
|
||||||
ARRAY_SIZE(lnagain_iip3_lookup), reg & 0x1F);
|
ARRAY_SIZE(lnagain_iip3_lookup),
|
||||||
|
reg & 0x1F);
|
||||||
|
|
||||||
gain += table_lookup(gain_rfagc_lookup,
|
gain += table_lookup(gain_rfagc_lookup,
|
||||||
ARRAY_SIZE(gain_rfagc_lookup), rfagc);
|
ARRAY_SIZE(gain_rfagc_lookup), rfagc);
|
||||||
|
|
||||||
gain -= 2400;
|
gain -= 2400;
|
||||||
} else {
|
} else {
|
||||||
/* Channel Mode */
|
/* Channel Mode */
|
||||||
if ((state->reg[0x02] & 0x80) == 0) {
|
if ((state->reg[0x02] & 0x80) == 0) {
|
||||||
/* NF */
|
/* NF */
|
||||||
gain = table_lookup(gain_channel_agc_nf_lookup,
|
gain = table_lookup(
|
||||||
|
gain_channel_agc_nf_lookup,
|
||||||
ARRAY_SIZE(gain_channel_agc_nf_lookup), rfagc);
|
ARRAY_SIZE(gain_channel_agc_nf_lookup), rfagc);
|
||||||
|
|
||||||
gain += 600;
|
gain += 600;
|
||||||
} else {
|
} else {
|
||||||
/* IIP3 */
|
/* IIP3 */
|
||||||
gain = table_lookup(gain_channel_agc_iip3_lookup,
|
gain = table_lookup(
|
||||||
|
gain_channel_agc_iip3_lookup,
|
||||||
ARRAY_SIZE(gain_channel_agc_iip3_lookup),
|
ARRAY_SIZE(gain_channel_agc_iip3_lookup),
|
||||||
rfagc);
|
rfagc);
|
||||||
}
|
}
|
||||||
|
@ -647,7 +653,7 @@ struct dvb_frontend *stv6111_attach(struct dvb_frontend *fe,
|
||||||
struct stv *state;
|
struct stv *state;
|
||||||
int stat;
|
int stat;
|
||||||
|
|
||||||
state = kzalloc(sizeof(struct stv), GFP_KERNEL);
|
state = kzalloc(sizeof(*state), GFP_KERNEL);
|
||||||
if (!state)
|
if (!state)
|
||||||
return NULL;
|
return NULL;
|
||||||
state->adr = adr;
|
state->adr = adr;
|
||||||
|
|
|
@ -3,13 +3,14 @@
|
||||||
|
|
||||||
#if IS_REACHABLE(CONFIG_DVB_STV6111)
|
#if IS_REACHABLE(CONFIG_DVB_STV6111)
|
||||||
|
|
||||||
extern struct dvb_frontend *stv6111_attach(struct dvb_frontend *fe,
|
struct dvb_frontend *stv6111_attach(struct dvb_frontend *fe,
|
||||||
struct i2c_adapter *i2c, u8 adr);
|
struct i2c_adapter *i2c, u8 adr);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
static inline struct dvb_frontend *stv6111_attach(struct dvb_frontend *fe,
|
static inline struct dvb_frontend *stv6111_attach(struct dvb_frontend *fe,
|
||||||
struct i2c_adapter *i2c, u8 adr)
|
struct i2c_adapter *i2c,
|
||||||
|
u8 adr)
|
||||||
{
|
{
|
||||||
pr_warn("%s: Driver disabled by Kconfig\n", __func__);
|
pr_warn("%s: Driver disabled by Kconfig\n", __func__);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue