git: f4a869a6424a - main - emulators/virtualbox-ose-kmod: Fix build with LLVM 15

From: Joseph Mingrone <jrm_at_FreeBSD.org>
Date: Mon, 06 Mar 2023 13:17:30 UTC
The branch main has been updated by jrm:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f4a869a6424aa8bc32d50642762d9f294c7ce3da

commit f4a869a6424aa8bc32d50642762d9f294c7ce3da
Author:     Joseph Mingrone <jrm@FreeBSD.org>
AuthorDate: 2023-03-04 04:31:00 +0000
Commit:     Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2023-03-06 13:15:34 +0000

    emulators/virtualbox-ose-kmod: Fix build with LLVM 15
    
    Starting with clang 15, the -Wint-conversion warning diagnostic for
    implicit int <-> pointer conversions defaults to an error. Use a cast to
    fix such an error here.
    
    See also:       https://lists.freebsd.org/archives/freebsd-emulation/2023-February/000431.html
                    https://lists.freebsd.org/archives/freebsd-emulation/2023-February/000460.html
    PR:             269721
    Reported by:    fbl@aoek.com, ohartmann@walstatt.org, rkoberman@gmail.com
    Differential Revision: https://reviews.freebsd.org/D38906
    Sponsored by:   The FreeBSD Foundation
---
 ...ch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c b/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c
index 2e2c292d7ee8..b7e262dd4ba2 100644
--- a/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c
+++ b/emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c
@@ -1,5 +1,5 @@
---- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig	2021-10-18 10:58:03.000000000 -0700
-+++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c	2021-11-19 15:31:33.152269000 -0800
+--- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig	2022-07-19 20:58:42 UTC
++++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
 @@ -44,8 +44,10 @@
  #include <sys/fcntl.h>
  #include <sys/conf.h>
@@ -26,7 +26,7 @@
  #ifdef VBOX_WITH_HARDENING
  # define VBOXDRV_PERM 0600
  #else
-@@ -76,7 +85,9 @@ static d_open_t     VBoxDrvFreeBSDOpenUsr;
+@@ -76,7 +85,9 @@ static d_ioctl_t    VBoxDrvFreeBSDIOCtl;
  static d_open_t     VBoxDrvFreeBSDOpenSys;
  static void         vboxdrvFreeBSDDtr(void *pvData);
  static d_ioctl_t    VBoxDrvFreeBSDIOCtl;
@@ -112,7 +112,7 @@
          pvUser = *(void **)pvData;
 -        int rc = copyin(pvUser, &Hdr, sizeof(Hdr));
 -        if (RT_UNLIKELY(rc))
-+        if (RT_FAILURE(RTR0MemUserCopyFrom(&Hdr, pvUser, sizeof(Hdr))))
++        if (RT_FAILURE(RTR0MemUserCopyFrom(&Hdr, (uintptr_t)pvUser, sizeof(Hdr))))
          {
 -            OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: copyin(%p,Hdr,) -> %#x; ulCmd=%#lx\n", pvUser, rc, ulCmd));
 -            return rc;
@@ -151,7 +151,7 @@
  
              Log(("VBoxDrvFreeBSDIOCtlSlow: returns %d / %d ulCmd=%lx\n", 0, pHdr->rc, ulCmd));
  
-@@ -540,8 +595,7 @@ bool VBOXCALL  supdrvOSGetForcedAsyncTscMode(PSUPDRVDE
+@@ -540,8 +595,7 @@ bool VBOXCALL  supdrvOSAreCpusOfflinedOnSuspend(void)
  
  bool VBOXCALL  supdrvOSAreCpusOfflinedOnSuspend(void)
  {
@@ -161,7 +161,7 @@
  }
  
  
-@@ -624,19 +678,43 @@ int VBOXCALL    supdrvOSMsrProberModify(RTCPUID idCpu,
+@@ -624,20 +678,44 @@ int VBOXCALL    supdrvOSMsrProberModify(RTCPUID idCpu,
  #endif /* SUPDRV_WITH_MSR_PROBER */
  
  
@@ -206,3 +206,4 @@
 +    return fFlags;
  }
  
+