aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends/tda8261_cfg.h
diff options
context:
space:
mode:
authorEmil Goode <emilgoode@gmail.com>2014-06-24 17:42:27 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-22 20:23:53 -0400
commit20721185c9896570ec9d93175e10e62e1b517ebb (patch)
tree1221d66f0b2f81161cb806c189db71e7c5353ac3 /drivers/media/dvb-frontends/tda8261_cfg.h
parent18d75a09e954b72de6e85a8fb172835be547a48a (diff)
[media] Remove checks of struct member addresses
This removes checks of struct member addresses since they likely result in the condition always being true. Also in the stb6100_get_bandwidth and tda8261_get_bandwidth functions the pointers frontend_ops and tuner_ops are assigned the same addresses twice. Signed-off-by: Emil Goode <emilgoode@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends/tda8261_cfg.h')
-rw-r--r--drivers/media/dvb-frontends/tda8261_cfg.h21
1 files changed, 5 insertions, 16 deletions
diff --git a/drivers/media/dvb-frontends/tda8261_cfg.h b/drivers/media/dvb-frontends/tda8261_cfg.h
index 46710744173b..7de65c302e08 100644
--- a/drivers/media/dvb-frontends/tda8261_cfg.h
+++ b/drivers/media/dvb-frontends/tda8261_cfg.h
@@ -19,15 +19,11 @@
19 19
20static int tda8261_get_frequency(struct dvb_frontend *fe, u32 *frequency) 20static int tda8261_get_frequency(struct dvb_frontend *fe, u32 *frequency)
21{ 21{
22 struct dvb_frontend_ops *frontend_ops = NULL; 22 struct dvb_frontend_ops *frontend_ops = &fe->ops;
23 struct dvb_tuner_ops *tuner_ops = NULL; 23 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
24 struct tuner_state t_state; 24 struct tuner_state t_state;
25 int err = 0; 25 int err = 0;
26 26
27 if (&fe->ops)
28 frontend_ops = &fe->ops;
29 if (&frontend_ops->tuner_ops)
30 tuner_ops = &frontend_ops->tuner_ops;
31 if (tuner_ops->get_state) { 27 if (tuner_ops->get_state) {
32 if ((err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &t_state)) < 0) { 28 if ((err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &t_state)) < 0) {
33 printk("%s: Invalid parameter\n", __func__); 29 printk("%s: Invalid parameter\n", __func__);
@@ -41,16 +37,13 @@ static int tda8261_get_frequency(struct dvb_frontend *fe, u32 *frequency)
41 37
42static int tda8261_set_frequency(struct dvb_frontend *fe, u32 frequency) 38static int tda8261_set_frequency(struct dvb_frontend *fe, u32 frequency)
43{ 39{
44 struct dvb_frontend_ops *frontend_ops = NULL; 40 struct dvb_frontend_ops *frontend_ops = &fe->ops;
45 struct dvb_tuner_ops *tuner_ops = NULL; 41 struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops;
46 struct tuner_state t_state; 42 struct tuner_state t_state;
47 int err = 0; 43 int err = 0;
48 44
49 t_state.frequency = frequency; 45 t_state.frequency = frequency;
50 if (&fe->ops) 46
51 frontend_ops = &fe->ops;
52 if (&frontend_ops->tuner_ops)
53 tuner_ops = &frontend_ops->tuner_ops;
54 if (tuner_ops->set_state) { 47 if (tuner_ops->set_state) {
55 if ((err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &t_state)) < 0) { 48 if ((err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &t_state)) < 0) {
56 printk("%s: Invalid parameter\n", __func__); 49 printk("%s: Invalid parameter\n", __func__);
@@ -68,10 +61,6 @@ static int tda8261_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
68 struct tuner_state t_state; 61 struct tuner_state t_state;
69 int err = 0; 62 int err = 0;
70 63
71 if (&fe->ops)
72 frontend_ops = &fe->ops;
73 if (&frontend_ops->tuner_ops)
74 tuner_ops = &frontend_ops->tuner_ops;
75 if (tuner_ops->get_state) { 64 if (tuner_ops->get_state) {
76 if ((err = tuner_ops->get_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state)) < 0) { 65 if ((err = tuner_ops->get_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state)) < 0) {
77 printk("%s: Invalid parameter\n", __func__); 66 printk("%s: Invalid parameter\n", __func__);