staging: nvec: Do not print free message for tx_scratch
authorJulian Andres Klode <jak@jak-linux.org>
Tue, 27 Sep 2011 17:00:52 +0000 (19:00 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 30 Sep 2011 00:41:33 +0000 (17:41 -0700)
The scratch area is not part of the pool and thus gets
no allocation message. Printing a free message would
be confusing, and the pointer subtraction would be
undefined behavior.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/nvec/nvec.c

index 1a120c1..c364384 100644 (file)
@@ -110,7 +110,8 @@ static struct nvec_msg *nvec_msg_alloc(struct nvec_chip *nvec)
 
 static void nvec_msg_free(struct nvec_chip *nvec, struct nvec_msg *msg)
 {
-       dev_vdbg(nvec->dev, "INFO: Free %ti\n", msg - nvec->msg_pool);
+       if (msg != &nvec->tx_scratch)
+               dev_vdbg(nvec->dev, "INFO: Free %ti\n", msg - nvec->msg_pool);
        atomic_set(&msg->used, 0);
 }