svn commit: r305360 - head/sys/dev/cxgb

Dimitry Andric dim at FreeBSD.org
Sat Sep 3 19:01:12 UTC 2016


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++;


More information about the svn-src-head mailing list