File fixes_for_4.15.patch of Package virtualbox.openSUSE_Leap_42.3_Update

Index: VirtualBox-5.1.32/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
===================================================================
--- VirtualBox-5.1.32.orig/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
+++ VirtualBox-5.1.32/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
@@ -958,7 +958,11 @@ EXPORT_SYMBOL(VBoxGuestIDCCall);
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
 
 /** log and dbg_log parameter setter. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static int vgdrvLinuxParamLogGrpSet(const char *pszValue, const struct kernel_param *pParam)
+#else
 static int vgdrvLinuxParamLogGrpSet(const char *pszValue, struct kernel_param *pParam)
+#endif
 {
     if (g_fLoggerCreated)
     {
@@ -973,7 +977,11 @@ static int vgdrvLinuxParamLogGrpSet(cons
 }
 
 /** log and dbg_log parameter getter. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static int vgdrvLinuxParamLogGrpGet(char *pszBuf, const struct kernel_param *pParam)
+#else
 static int vgdrvLinuxParamLogGrpGet(char *pszBuf, struct kernel_param *pParam)
+#endif
 {
     PRTLOGGER pLogger = pParam->name[0] == 'd' ? RTLogDefaultInstance() : RTLogRelGetDefaultInstance();
     *pszBuf = '\0';
@@ -984,7 +992,11 @@ static int vgdrvLinuxParamLogGrpGet(char
 
 
 /** log and dbg_log_flags parameter setter. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static int vgdrvLinuxParamLogFlagsSet(const char *pszValue, const struct kernel_param *pParam)
+#else
 static int vgdrvLinuxParamLogFlagsSet(const char *pszValue, struct kernel_param *pParam)
+#endif
 {
     if (g_fLoggerCreated)
     {
@@ -998,7 +1010,11 @@ static int vgdrvLinuxParamLogFlagsSet(co
 }
 
 /** log and dbg_log_flags parameter getter. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static int vgdrvLinuxParamLogFlagsGet(char *pszBuf, const struct kernel_param *pParam)
+#else
 static int vgdrvLinuxParamLogFlagsGet(char *pszBuf, struct kernel_param *pParam)
+#endif
 {
     PRTLOGGER pLogger = pParam->name[0] == 'd' ? RTLogDefaultInstance() : RTLogRelGetDefaultInstance();
     *pszBuf = '\0';
@@ -1009,7 +1025,11 @@ static int vgdrvLinuxParamLogFlagsGet(ch
 
 
 /** log and dbg_log_dest parameter setter. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static int vgdrvLinuxParamLogDstSet(const char *pszValue, const struct kernel_param *pParam)
+#else
 static int vgdrvLinuxParamLogDstSet(const char *pszValue, struct kernel_param *pParam)
+#endif
 {
     if (g_fLoggerCreated)
     {
@@ -1023,7 +1043,11 @@ static int vgdrvLinuxParamLogDstSet(cons
 }
 
 /** log and dbg_log_dest parameter getter. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static int vgdrvLinuxParamLogDstGet(char *pszBuf, const struct kernel_param *pParam)
+#else
 static int vgdrvLinuxParamLogDstGet(char *pszBuf, struct kernel_param *pParam)
+#endif
 {
     PRTLOGGER pLogger = pParam->name[0] == 'd' ? RTLogDefaultInstance() : RTLogRelGetDefaultInstance();
     *pszBuf = '\0';
@@ -1034,7 +1058,11 @@ static int vgdrvLinuxParamLogDstGet(char
 
 
 /** r3_log_to_host parameter setter. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static int vgdrvLinuxParamR3LogToHostSet(const char *pszValue, const struct kernel_param *pParam)
+#else
 static int vgdrvLinuxParamR3LogToHostSet(const char *pszValue, struct kernel_param *pParam)
+#endif
 {
     if (    pszValue == NULL
         || *pszValue == '\0'
@@ -1052,7 +1080,11 @@ static int vgdrvLinuxParamR3LogToHostSet
 }
 
 /** r3_log_to_host parameter getter. */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static int vgdrvLinuxParamR3LogToHostGet(char *pszBuf, const struct kernel_param *pParam)
+#else
 static int vgdrvLinuxParamR3LogToHostGet(char *pszBuf, struct kernel_param *pParam)
+#endif
 {
     strcpy(pszBuf, g_DevExt.fLoggingEnabled ? "enabled" : "disabled");
     return strlen(pszBuf);
Index: VirtualBox-5.1.32/src/VBox/Additions/linux/drm/vbox_mode.c
===================================================================
--- VirtualBox-5.1.32.orig/src/VBox/Additions/linux/drm/vbox_mode.c
+++ VirtualBox-5.1.32/src/VBox/Additions/linux/drm/vbox_mode.c
@@ -360,11 +360,16 @@ static struct drm_encoder *vbox_best_sin
     int enc_id = connector->encoder_ids[0];
 
     LogFunc(("vboxvideo: %d: connector=%p\n", __LINE__, connector));
-    /* pick the encoder ids */
-    if (enc_id)
+	/* pick the encoder ids */
+	if (enc_id)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+        return drm_encoder_find(connector->dev, NULL, enc_id);
+#else
         return drm_encoder_find(connector->dev, enc_id);
-    LogFunc(("vboxvideo: %d\n", __LINE__));
-    return NULL;
+#endif
+
+	LogFunc(("vboxvideo: %d\n", __LINE__));
+	return NULL;
 }
 
 
openSUSE Build Service is sponsored by