video: fbdev: matrox: the list iterator can't be NULL
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 4 Jul 2017 15:47:23 +0000 (17:47 +0200)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Tue, 4 Jul 2017 15:47:23 +0000 (17:47 +0200)
My static checker is complaining because we check "drv" for NULL and
then we dereference it to get the next item in the list.  It can't be
NULL so we can remove this check.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/video/fbdev/matrox/matroxfb_base.c

index 11eb094396aea32f206b60ab2b99df90c3c8d2c4..f6a0b9af97a90b3fa3989c480b3934d9bec0ed9b 100644 (file)
@@ -2001,7 +2001,7 @@ static void matroxfb_register_device(struct matrox_fb_info* minfo) {
        for (drv = matroxfb_driver_l(matroxfb_driver_list.next);
             drv != matroxfb_driver_l(&matroxfb_driver_list);
             drv = matroxfb_driver_l(drv->node.next)) {
-               if (drv && drv->probe) {
+               if (drv->probe) {
                        void *p = drv->probe(minfo);
                        if (p) {
                                minfo->drivers_data[i] = p;