MIPS: remove broken conditional inside vpe loader code
authorJohn Crispin <blogic@openwrt.org>
Sun, 17 Feb 2013 00:16:15 +0000 (01:16 +0100)
committerJohn Crispin <blogic@openwrt.org>
Tue, 19 Feb 2013 08:36:40 +0000 (09:36 +0100)
The commit [1] breaks builds and results in the following error

arch/mips/kernel/vpe.c: In function 'vpe_run':
arch/mips/kernel/vpe.c:708:16: error: invalid type argument of '->' (have 'struct list_head')

Taking a closer look at the conditional we notice that list_first_entry wont
ever return NULL. The easiest fix is to just drop the dead code.

[1]
commit 3d2d03247632920aa21b42a0b032a4ffd44ce15e
MIPS: vpe.c: Fix null pointer dereference in print arguments.

Signed-off-by: John Crispin <blogic@openwrt.org>
arch/mips/kernel/vpe.c

index 147cec19621d7a433429e66433fdd993c2abd62e..0e0fdb783b7c5ca8d7dbe7c319183e30ad5f1ee5 100644 (file)
@@ -697,18 +697,7 @@ static int vpe_run(struct vpe * v)
        dmt_flag = dmt();
        vpeflags = dvpe();
 
-       if (!list_empty(&v->tc)) {
-               if ((t = list_entry(v->tc.next, struct tc, tc)) == NULL) {
-                       evpe(vpeflags);
-                       emt(dmt_flag);
-                       local_irq_restore(flags);
-
-                       printk(KERN_WARNING
-                              "VPE loader: TC %d is already in use.\n",
-                              v->tc->index);
-                       return -ENOEXEC;
-               }
-       } else {
+       if (list_empty(&v->tc)) {
                evpe(vpeflags);
                emt(dmt_flag);
                local_irq_restore(flags);
@@ -720,6 +709,8 @@ static int vpe_run(struct vpe * v)
                return -ENOEXEC;
        }
 
+       t = list_first_entry(&v->tc, struct tc, tc);
+
        /* Put MVPE's into 'configuration state' */
        set_c0_mvpcontrol(MVPCONTROL_VPC);
 
This page took 0.026395 seconds and 5 git commands to generate.