Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Nov 2022 19:29:42 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: e4bc19b2faa7 - main - cxgbe tom: Fix jobtotid() compilation.
Message-ID:  <202211081929.2A8JTgAl028700@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

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

commit e4bc19b2faa7fdb433a685d6de2cc7571d129699
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-11-08 19:25:58 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-11-08 19:25:58 +0000

    cxgbe tom: Fix jobtotid() compilation.
    
    The previous commit lost an implicit struct socket * cast.  Use an
    inline function instead as the macro is already rather long.
    
    Fixes:          e1401f75790f cxgbe: use standard sototcpcb() accessor macro to get socket's tcpcb
    Sponsored by:   Chelsio Communications
---
 sys/dev/cxgbe/tom/t4_cpl_io.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c
index 94b92dbf112b..7449029a7082 100644
--- a/sys/dev/cxgbe/tom/t4_cpl_io.c
+++ b/sys/dev/cxgbe/tom/t4_cpl_io.c
@@ -2052,8 +2052,20 @@ t4_uninit_cpl_io_handlers(void)
 #define	aio_sent	backend3
 #define	aio_refs	backend4
 
-#define	jobtotid(job)							\
-	(((struct toepcb *)(sototcpcb((job)->fd_file->f_data)->t_toe))->tid)
+#ifdef VERBOSE_TRACES
+static int
+jobtotid(struct kaiocb *job)
+{
+	struct socket *so;
+	struct tcpcb *tp;
+	struct toepcb *toep;
+
+	so = job->fd_file->f_data;
+	tp = sototcpcb(so);
+	toep = tp->t_toe;
+	return (toep->tid);
+}
+#endif
 
 static void
 aiotx_free_job(struct kaiocb *job)



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