[media] saa7164-dvb: Remove unnecessary null test
authorHimangi Saraogi <himangi774@gmail.com>
Tue, 15 Jul 2014 21:29:53 +0000 (18:29 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 17 Jul 2014 23:07:42 +0000 (20:07 -0300)
commit2ec4e84a5fabfb08b03644a9f89ba1d9bb7f34b1
tree6f9f8f8378ec21c613ac97017c42346fa8c0d350
parentb317d0f585229df6407befbeb415f60bcfe74ff0
[media] saa7164-dvb: Remove unnecessary null test

This patch removes the null test on dvb. dvb is initialized at the
beginning of the function to &port->dvb. Since port is dereferenced
prior to the null test, port must be a valid pointer, and
&port->dvb cannot be null.

The following Coccinelle script is used for detecting the change:

@r@
expression e,f;
identifier g,y;
statement S1,S2;
@@

*e = &f->g
<+...
 f->y
 ...+>
*if (e != NULL || ...)
 S1 else S2

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/pci/saa7164/saa7164-dvb.c