From 7b77065793b8de101c7be3829b4ff8a4618a7172 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 27 Sep 2011 19:00:52 +0200 Subject: [PATCH] staging: nvec: Do not print free message for tx_scratch 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 Acked-by: Marc Dietrich Signed-off-by: Greg Kroah-Hartman --- drivers/staging/nvec/nvec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 1a120c1418ec..c3643844a6f1 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -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); } -- 2.34.1