Date: Sat, 3 Sep 2016 19:01:11 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305360 - head/sys/dev/cxgb Message-ID: <201609031901.u83J1BW9096052@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Sat Sep 3 19:01:11 2016 New Revision: 305360 URL: https://svnweb.freebsd.org/changeset/base/305360 Log: With clang 3.9.0, compiling cxgb results in the following warning: sys/dev/cxgb/cxgb_sge.c:2873:44: error: implicit conversion from 'int' to 'char' changes value from 128 to -128 [-Werror,-Wconstant-conversion] *mtod(m, char *) = CPL_ASYNC_NOTIF; ~ ^~~~~~~~~~~~~~~ This is because CPL_ASYNC_NOTIF is 0x80, so the plain char argument is wrapped to a negative value. Fix this by using uint8_t instead. Reviewed by: np MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D7772 Modified: head/sys/dev/cxgb/cxgb_sge.c Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Sat Sep 3 18:54:26 2016 (r305359) +++ head/sys/dev/cxgb/cxgb_sge.c Sat Sep 3 19:01:11 2016 (r305360) @@ -2870,7 +2870,7 @@ process_responses(adapter_t *adap, struc memcpy(mtod(m, char *), r, AN_PKT_SIZE); m->m_len = m->m_pkthdr.len = AN_PKT_SIZE; - *mtod(m, char *) = CPL_ASYNC_NOTIF; + *mtod(m, uint8_t *) = CPL_ASYNC_NOTIF; opcode = CPL_ASYNC_NOTIF; eop = 1; rspq->async_notif++;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609031901.u83J1BW9096052>