Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Cong Ding and committed by
Mauro Carvalho Chehab
4880f564 a92591a7

+6 -15
+4 -10
drivers/media/dvb-frontends/stv0900_core.c
··· 524 524 struct dvb_frontend_ops *frontend_ops = NULL; 525 525 struct dvb_tuner_ops *tuner_ops = NULL; 526 526 527 - if (&fe->ops) 528 - frontend_ops = &fe->ops; 529 - 530 - if (&frontend_ops->tuner_ops) 531 - tuner_ops = &frontend_ops->tuner_ops; 527 + frontend_ops = &fe->ops; 528 + tuner_ops = &frontend_ops->tuner_ops; 532 529 533 530 if (tuner_ops->set_frequency) { 534 531 if ((tuner_ops->set_frequency(fe, frequency)) < 0) ··· 549 552 struct dvb_frontend_ops *frontend_ops = NULL; 550 553 struct dvb_tuner_ops *tuner_ops = NULL; 551 554 552 - if (&fe->ops) 553 - frontend_ops = &fe->ops; 554 - 555 - if (&frontend_ops->tuner_ops) 556 - tuner_ops = &frontend_ops->tuner_ops; 555 + frontend_ops = &fe->ops; 556 + tuner_ops = &frontend_ops->tuner_ops; 557 557 558 558 if (tuner_ops->set_bandwidth) { 559 559 if ((tuner_ops->set_bandwidth(fe, bandwidth)) < 0)
+2 -5
drivers/media/dvb-frontends/stv0900_sw.c
··· 1167 1167 struct dvb_tuner_ops *tuner_ops = NULL; 1168 1168 u32 freq = 0; 1169 1169 1170 - if (&fe->ops) 1171 - frontend_ops = &fe->ops; 1172 - 1173 - if (&frontend_ops->tuner_ops) 1174 - tuner_ops = &frontend_ops->tuner_ops; 1170 + frontend_ops = &fe->ops; 1171 + tuner_ops = &frontend_ops->tuner_ops; 1175 1172 1176 1173 if (tuner_ops->get_frequency) { 1177 1174 if ((tuner_ops->get_frequency(fe, &freq)) < 0)