* [PATCH] media: dvb-frontends/stv0900_core.c: remove unnecessary null pointer check
@ 2013-01-15 20:48 Cong Ding
2013-01-15 21:07 ` [PATCH v] media: dvb-frontends: " Cong Ding
0 siblings, 1 reply; 2+ messages in thread
From: Cong Ding @ 2013-01-15 20:48 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Antti Palosaari, Wei Yongjun,
Evgeny Plehov, Peter Senna Tschudin, linux-media, linux-kernel
Cc: Cong Ding
The address of a variable is impossible to be null, so we remove the check.
Signed-off-by: Cong Ding <dinggnu@gmail.com>
---
drivers/media/dvb-frontends/stv0900_core.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/media/dvb-frontends/stv0900_core.c b/drivers/media/dvb-frontends/stv0900_core.c
index 0fb34e1..612b872 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,
struct dvb_frontend_ops *frontend_ops = NULL;
struct dvb_tuner_ops *tuner_ops = NULL;
- if (&fe->ops)
- frontend_ops = &fe->ops;
-
- if (&frontend_ops->tuner_ops)
- tuner_ops = &frontend_ops->tuner_ops;
+ frontend_ops = &fe->ops;
+ tuner_ops = &frontend_ops->tuner_ops;
if (tuner_ops->set_frequency) {
if ((tuner_ops->set_frequency(fe, frequency)) < 0)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH v] media: dvb-frontends: remove unnecessary null pointer check
2013-01-15 20:48 [PATCH] media: dvb-frontends/stv0900_core.c: remove unnecessary null pointer check Cong Ding
@ 2013-01-15 21:07 ` Cong Ding
0 siblings, 0 replies; 2+ messages in thread
From: Cong Ding @ 2013-01-15 21:07 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Antti Palosaari, Wei Yongjun,
Evgeny Plehov, Peter Senna Tschudin, linux-media, linux-kernel
The address of a variable is impossible to be null, so we remove the check.
Signed-off-by: Cong Ding <dinggnu@gmail.com>
---
sorry for sending again. I didn't notice there are another 2 places with the
same issue.
- cong
drivers/media/dvb-frontends/stv0900_core.c | 14 ++++----------
drivers/media/dvb-frontends/stv0900_sw.c | 7 ++-----
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 0fb34e1..e5a87b5 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,
struct dvb_frontend_ops *frontend_ops = NULL;
struct dvb_tuner_ops *tuner_ops = NULL;
- if (&fe->ops)
- frontend_ops = &fe->ops;
-
- if (&frontend_ops->tuner_ops)
- tuner_ops = &frontend_ops->tuner_ops;
+ frontend_ops = &fe->ops;
+ tuner_ops = &frontend_ops->tuner_ops;
if (tuner_ops->set_frequency) {
if ((tuner_ops->set_frequency(fe, frequency)) < 0)
@@ -552,11 +549,8 @@ void stv0900_set_bandwidth(struct dvb_frontend *fe, u32 bandwidth)
struct dvb_frontend_ops *frontend_ops = NULL;
struct dvb_tuner_ops *tuner_ops = NULL;
- if (&fe->ops)
- frontend_ops = &fe->ops;
-
- if (&frontend_ops->tuner_ops)
- tuner_ops = &frontend_ops->tuner_ops;
+ frontend_ops = &fe->ops;
+ tuner_ops = &frontend_ops->tuner_ops;
if (tuner_ops->set_bandwidth) {
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 4af2078..0a40edf 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)
struct dvb_tuner_ops *tuner_ops = NULL;
u32 freq = 0;
- if (&fe->ops)
- frontend_ops = &fe->ops;
-
- if (&frontend_ops->tuner_ops)
- tuner_ops = &frontend_ops->tuner_ops;
+ frontend_ops = &fe->ops;
+ tuner_ops = &frontend_ops->tuner_ops;
if (tuner_ops->get_frequency) {
if ((tuner_ops->get_frequency(fe, &freq)) < 0)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-15 21:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-15 20:48 [PATCH] media: dvb-frontends/stv0900_core.c: remove unnecessary null pointer check Cong Ding
2013-01-15 21:07 ` [PATCH v] media: dvb-frontends: " Cong Ding
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).