[vbox-dev] misc_deregister changes to void from int in Linux kernel 4.3-rc1, breaks Virtualbox build

Alessandro Suardi alessandro.suardi at gmail.com
Wed Sep 16 09:59:15 GMT 2015


This has already been (sort of) reported on vboxusers - while trying to see if
 new SVN releases fix my compiling problem in the 5.0 series (manual.pdf be
 damned :( ), I advanced both kernel to 4.3-rc1 and SVN to 57718.

Relevant background:

https://lkml.org/lkml/2015/7/30/815

Proposed (possibly too conservative, using preprocessor directives to condition
 compilation based on KERNEL_VERSION check) patch to ignore the
 misc_deregister reportedly useless return code is attached.

thanks,

--alessandro

"don't underestimate the things that I will do"

 (Adele, "Rolling In The Deep")
-------------- next part --------------
--- trunk-old/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c	2015-09-16 11:01:21.832588285 +0200
+++ trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c	2015-09-16 11:26:36.166222762 +0200
@@ -485,16 +485,24 @@
      * opened, at least we'll blindly assume that here.
      */
 #ifdef CONFIG_VBOXDRV_AS_MISC
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
+    misc_deregister(&gMiscDeviceUsr);
+#else
     rc = misc_deregister(&gMiscDeviceUsr);
     if (rc < 0)
     {
         Log(("misc_deregister failed with rc=%#x on vboxdrvu\n", rc));
     }
+#endif
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
+    misc_deregister(&gMiscDeviceSys);
+#else
     rc = misc_deregister(&gMiscDeviceSys);
     if (rc < 0)
     {
         Log(("misc_deregister failed with rc=%#x on vboxdrv\n", rc));
     }
+#endif
 #else  /* !CONFIG_VBOXDRV_AS_MISC */
 # ifdef CONFIG_DEVFS_FS
     /*
--- trunk-old/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c	2015-09-16 11:01:57.788701084 +0200
+++ trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c	2015-09-16 11:33:30.533998418 +0200
@@ -436,11 +436,15 @@
 
     vboxNetAdpShutdown();
     /* Remove control device */
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
+    misc_deregister(&g_CtlDev);
+#else
     rc = misc_deregister(&g_CtlDev);
     if (rc < 0)
     {
         printk(KERN_ERR "misc_deregister failed with rc=%x\n", rc);
     }
+#endif
 
     RTR0Term();
 


More information about the vbox-dev mailing list