Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Mar 2018 19:53:02 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r331566 - head/sys/dev/vmware/vmci
Message-ID:  <201803261953.w2QJr2VB001080@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Mon Mar 26 19:53:02 2018
New Revision: 331566
URL: https://svnweb.freebsd.org/changeset/base/331566

Log:
  vmci(4): Fix GCC build and rationalize vmci_kernel_defs.h
  
  To fix the GCC build, remove multiple redundant declarations of
  vmci_send_datagram() (the copy in vmci.h as well as the extern definition in
  vmci_queue_pair.c were wholly redundant).
  
  Also to fix the GCC build, include a non-empty format string in the vmci(4)
  definition of ASSERT().  It seems harmless either way, but adding the
  stringified invariant is easier than masking the warning.
  
  The other vmci_kernel_defs.h changes are cosmetic and simply match macros to
  existing definitions.
  
  Reported by:	GCC 6.4.0
  Sponsored by:	Dell EMC Isilon

Modified:
  head/sys/dev/vmware/vmci/vmci.h
  head/sys/dev/vmware/vmci/vmci_kernel_defs.h
  head/sys/dev/vmware/vmci/vmci_queue_pair.c

Modified: head/sys/dev/vmware/vmci/vmci.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci.h	Mon Mar 26 19:08:19 2018	(r331565)
+++ head/sys/dev/vmware/vmci/vmci.h	Mon Mar 26 19:53:02 2018	(r331566)
@@ -73,7 +73,6 @@ struct vmci_softc {
 int	vmci_dma_malloc(bus_size_t size, bus_size_t align,
 	    struct vmci_dma_alloc *dma);
 void	vmci_dma_free(struct vmci_dma_alloc *);
-int	vmci_send_datagram(struct vmci_datagram *dg);
 int	vmci_schedule_delayed_work_fn(vmci_work_fn *work_fn, void *data);
 
 #endif /* !_VMCI_H_ */

Modified: head/sys/dev/vmware/vmci/vmci_kernel_defs.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_kernel_defs.h	Mon Mar 26 19:08:19 2018	(r331565)
+++ head/sys/dev/vmware/vmci/vmci_kernel_defs.h	Mon Mar 26 19:53:02 2018	(r331566)
@@ -16,17 +16,17 @@
 
 typedef uint32_t PPN;
 
-#define ASSERT(cond)		KASSERT(cond, (""))
+#define ASSERT(cond)		KASSERT(cond, ("%s", #cond))
 #define ASSERT_ON_COMPILE(e)	_Static_assert(e, #e);
 
-#define LIKELY(_exp)		__builtin_expect(!!(_exp), 1)
-#define UNLIKELY(_exp)		__builtin_expect((_exp), 0)
+#define LIKELY(_exp)		__predict_true(_exp)
+#define UNLIKELY(_exp)		__predict_false(_exp)
 
-#define CONST64U(c)		c##uL
+#define CONST64U(c)		UINT64_C(c)
 
-#define ARRAYSIZE(a)		(sizeof(a) / sizeof(*(a)))
+#define ARRAYSIZE(a)		nitems(a)
 
-#define ROUNDUP(x, y)		(((x) + (y) - 1) / (y) * (y))
-#define CEILING(x, y)		(((x) + (y) - 1) / (y))
+#define ROUNDUP(x, y)		roundup(x, y)
+#define CEILING(x, y)		howmany(x, y)
 
 #endif /* !_VMCI_KERNEL_DEFS_H_ */

Modified: head/sys/dev/vmware/vmci/vmci_queue_pair.c
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_queue_pair.c	Mon Mar 26 19:08:19 2018	(r331565)
+++ head/sys/dev/vmware/vmci/vmci_queue_pair.c	Mon Mar 26 19:53:02 2018	(r331566)
@@ -74,8 +74,6 @@ static int	vmci_queue_pair_alloc_guest_work(struct vmc
 static int	vmci_queue_pair_detach_guest_work(struct vmci_handle handle);
 static int	vmci_queue_pair_detach_hypercall(struct vmci_handle handle);
 
-extern int	vmci_send_datagram(struct vmci_datagram *);
-
 /*
  *------------------------------------------------------------------------------
  *



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