aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorCong Ding <dinggnu@gmail.com>2013-02-03 20:34:48 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-02-08 15:05:48 -0500
commit4880f56438ef56457edd5548b257382761591998 (patch)
tree7139ff8e5af503e4962cdaf7a969632132f49409 /drivers/media
parenta92591a7112042f92b609be42bc332d989776e9b (diff)
[media] stv0900: remove unnecessary null pointer check
The address of a variable is impossible to be null, so we remove the check. Signed-off-by: Cong Ding <dinggnu@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb-frontends/stv0900_core.c14
-rw-r--r--drivers/media/dvb-frontends/stv0900_sw.c7
2 files changed, 6 insertions, 15 deletions
diff --git a/drivers/media/dvb-frontends/stv0900_core.c b/drivers/media/dvb-frontends/stv0900_core.c
index 0fb34e1909d1..e5a87b57d855 100644
--- a/drivers/media/dvb-frontends/stv0900_core.c
+++ b/drivers/media/dvb-frontends/stv0900_core.c
@@ -524,11 +524,8 @@ void stv0900_set_tuner(struct dvb_frontend *fe, u32 frequency,
524 struct dvb_frontend_ops *frontend_ops = NULL; 524 struct dvb_frontend_ops *frontend_ops = NULL;
525 struct dvb_tuner_ops *tuner_ops = NULL; 525 struct dvb_tuner_ops *tuner_ops = NULL;
526 526
527 if (&fe->ops) 527 frontend_ops = &fe->ops;
528 frontend_ops = &fe->ops; 528 tuner_ops = &frontend_ops->tuner_ops;
529
530 if (&frontend_ops->tuner_ops)
531 tuner_ops = &frontend_ops->tuner_ops;
532 529
533 if (tuner_ops->set_frequency) { 530 if (tuner_ops->set_frequency) {
534 if ((tuner_ops->set_frequency(fe, frequency)) < 0) 531 if ((tuner_ops->set_frequency(fe, frequency)) < 0)
@@ -552,11 +549,8 @@ void stv0900_set_bandwidth(struct dvb_frontend *fe, u32 bandwidth)
552 struct dvb_frontend_ops *frontend_ops = NULL; 549 struct dvb_frontend_ops *frontend_ops = NULL;
553 struct dvb_tuner_ops *tuner_ops = NULL; 550 struct dvb_tuner_ops *tuner_ops = NULL;
554 551
555 if (&fe->ops) 552 frontend_ops = &fe->ops;
556 frontend_ops = &fe->ops; 553 tuner_ops = &frontend_ops->tuner_ops;
557
558 if (&frontend_ops->tuner_ops)
559 tuner_ops = &frontend_ops->tuner_ops;
560 554
561 if (tuner_ops->set_bandwidth) { 555 if (tuner_ops->set_bandwidth) {
562 if ((tuner_ops->set_bandwidth(fe, bandwidth)) < 0) 556 if ((tuner_ops->set_bandwidth(fe, bandwidth)) < 0)
diff --git a/drivers/media/dvb-frontends/stv0900_sw.c b/drivers/media/dvb-frontends/stv0900_sw.c
index 4af20780fb9c..0a40edfad739 100644
--- a/drivers/media/dvb-frontends/stv0900_sw.c
+++ b/drivers/media/dvb-frontends/stv0900_sw.c
@@ -1167,11 +1167,8 @@ static u32 stv0900_get_tuner_freq(struct dvb_frontend *fe)
1167 struct dvb_tuner_ops *tuner_ops = NULL; 1167 struct dvb_tuner_ops *tuner_ops = NULL;
1168 u32 freq = 0; 1168 u32 freq = 0;
1169 1169
1170 if (&fe->ops) 1170 frontend_ops = &fe->ops;
1171 frontend_ops = &fe->ops; 1171 tuner_ops = &frontend_ops->tuner_ops;
1172
1173 if (&frontend_ops->tuner_ops)
1174 tuner_ops = &frontend_ops->tuner_ops;
1175 1172
1176 if (tuner_ops->get_frequency) { 1173 if (tuner_ops->get_frequency) {
1177 if ((tuner_ops->get_frequency(fe, &freq)) < 0) 1174 if ((tuner_ops->get_frequency(fe, &freq)) < 0)