Merge drm/drm-next into drm-misc-next
[linux-2.6-microblaze.git] / drivers / gpu / drm / drm_modes.c
index 45238ec..c4f88c3 100644 (file)
@@ -2617,8 +2617,7 @@ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
                break;
        }
 
-       strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN);
-       out->name[DRM_DISPLAY_MODE_LEN-1] = 0;
+       strscpy_pad(out->name, in->name, sizeof(out->name));
 }
 
 /**
@@ -2659,8 +2658,7 @@ int drm_mode_convert_umode(struct drm_device *dev,
         * useful for the kernel->userspace direction anyway.
         */
        out->type = in->type & DRM_MODE_TYPE_ALL;
-       strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN);
-       out->name[DRM_DISPLAY_MODE_LEN-1] = 0;
+       strscpy_pad(out->name, in->name, sizeof(out->name));
 
        /* Clearing picture aspect ratio bits from out flags,
         * as the aspect-ratio information is not stored in