mem: Don't make assertions about c->synth_buf
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 11 Oct 2018 20:27:55 +0000 (16:27 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 11 Oct 2018 20:29:44 +0000 (16:29 -0400)
Old chans may have that set, even ones that aren't from this device,
though they shouldn't.  If we want to check for that, we can do it
elsewhere.

Qslab_trace was using c->synth_buf in older versions, and this check was
left behind.  Now that we aren't using it, let's not keep old references
around.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/drivers/dev/mem.c

index bbd75f7..b80e31f 100644 (file)
@@ -352,10 +352,6 @@ static struct chan *mem_open(struct chan *c, int omode)
        case Qkmemstat:
                c->synth_buf = build_kmemstat();
                break;
        case Qkmemstat:
                c->synth_buf = build_kmemstat();
                break;
-       case Qslab_trace:
-               /* slab_trace is built on write, not on open. */
-               assert(!c->synth_buf);
-               break;
        }
        c->mode = openmode(omode);
        c->flag |= COPEN;
        }
        c->mode = openmode(omode);
        c->flag |= COPEN;
@@ -372,7 +368,6 @@ static void mem_close(struct chan *c)
        case Qslab_stats:
        case Qfree:
        case Qkmemstat:
        case Qslab_stats:
        case Qfree:
        case Qkmemstat:
-       case Qslab_trace:
                kfree(c->synth_buf);
                c->synth_buf = NULL;
                break;
                kfree(c->synth_buf);
                c->synth_buf = NULL;
                break;