From owner-svn-src-head@freebsd.org Mon Mar 26 19:53:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 921FEF65C49; Mon, 26 Mar 2018 19:53:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41CFC70187; Mon, 26 Mar 2018 19:53:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23990117FF; Mon, 26 Mar 2018 19:53:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QJr3NE001083; Mon, 26 Mar 2018 19:53:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QJr2VB001080; Mon, 26 Mar 2018 19:53:02 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803261953.w2QJr2VB001080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 26 Mar 2018 19:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331566 - head/sys/dev/vmware/vmci X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/vmware/vmci X-SVN-Commit-Revision: 331566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 19:53:03 -0000 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 *); - /* *------------------------------------------------------------------------------ *