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 <[email protected]>
Acked-by: Marc Dietrich <[email protected]>
---
 drivers/staging/nvec/nvec.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 1a120c1..c364384 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);
 }
 
-- 
1.7.5.4

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to