From 2db7b9f259535c36879c35f6c656090034f33101 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 3 Sep 2016 19:01:11 +0000 Subject: [PATCH] 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 --- sys/dev/cxgb/cxgb_sge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index 76d40d815c50..9981d00ae8cf 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -2870,7 +2870,7 @@ process_responses(adapter_t *adap, struct sge_qset *qs, int budget) 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++;