Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Dec 2021 12:31:27 GMT
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 035813ba1554 - stable/12 - twsi: improve a handful of debug messages
Message-ID:  <202112101231.1BACVREt066163@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by avg:

URL: https://cgit.FreeBSD.org/src/commit/?id=035813ba15545b7d77429427823d2fb603d83a23

commit 035813ba15545b7d77429427823d2fb603d83a23
Author:     Andriy Gapon <avg@FreeBSD.org>
AuthorDate: 2021-11-26 07:34:28 +0000
Commit:     Andriy Gapon <avg@FreeBSD.org>
CommitDate: 2021-12-10 12:30:54 +0000

    twsi: improve a handful of debug messages
    
    - use 0x prefix for hex values
    - print indexes and counts as decimals
    - break too long lines
    
    (cherry picked from commit 578707ed4efda4ec1c91ab1a8f1bace6b1eb714a)
---
 sys/dev/iicbus/twsi/twsi.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/sys/dev/iicbus/twsi/twsi.c b/sys/dev/iicbus/twsi/twsi.c
index 5e899313ac45..384e19e120b9 100644
--- a/sys/dev/iicbus/twsi/twsi.c
+++ b/sys/dev/iicbus/twsi/twsi.c
@@ -534,9 +534,9 @@ twsi_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
 		debugf(sc, "Error: %d\n", sc->error);
 
 	/* Disable module and interrupts */
-	debugf(sc, "status=%x\n", TWSI_READ(sc, sc->reg_status));
+	debugf(sc, "status=0x%x\n", TWSI_READ(sc, sc->reg_status));
 	TWSI_WRITE(sc, sc->reg_control, 0);
-	debugf(sc, "status=%x\n", TWSI_READ(sc, sc->reg_status));
+	debugf(sc, "status=0x%x\n", TWSI_READ(sc, sc->reg_status));
 	error = sc->error;
 	mtx_unlock(&sc->mutex);
 
@@ -553,10 +553,11 @@ twsi_intr(void *arg)
 	sc = arg;
 
 	mtx_lock(&sc->mutex);
-	debugf(sc, "Got interrupt Current msg=%x\n", sc->msg_idx);
+	debugf(sc, "Got interrupt, current msg=%u\n", sc->msg_idx);
 
 	status = TWSI_READ(sc, sc->reg_status);
-	debugf(sc, "reg control=%x\n", TWSI_READ(sc, sc->reg_control));
+	debugf(sc, "reg control = 0x%x, status = 0x%x\n",
+	    TWSI_READ(sc, sc->reg_control), status);
 
 	if (sc->transfer == 0) {
 		device_printf(sc->dev, "interrupt without active transfer, "
@@ -570,7 +571,8 @@ twsi_intr(void *arg)
 	case TWSI_STATUS_START:
 	case TWSI_STATUS_RPTD_START:
 		/* Transmit the address */
-		debugf(sc, "Send the address (%x)", sc->msgs[sc->msg_idx].slave);
+		debugf(sc, "Send address 0x%x\n",
+		    sc->msgs[sc->msg_idx].slave);
 
 		if (sc->msgs[sc->msg_idx].flags & IIC_M_RD)
 			TWSI_WRITE(sc, sc->reg_data,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202112101231.1BACVREt066163>