@@ -87,9 +87,7 @@ EXPORT_SYMBOL(drm_mode_legacy_fb_format);
*/
char *drm_get_format_name(uint32_t format)
{
- char *buf = kmalloc(32, GFP_KERNEL);
-
- snprintf(buf, 32,
+ return kasprintf(GFP_ATOMIC,
"%c%c%c%c %s-endian (0x%08x)",
printable_char(format & 0xff),
printable_char((format >> 8) & 0xff),
@@ -97,8 +95,6 @@ char *drm_get_format_name(uint32_t format)
printable_char((format >> 24) & 0x7f),
format & DRM_FORMAT_BIG_ENDIAN ? "big" : "little",
format);
-
- return buf;
}
EXPORT_SYMBOL(drm_get_format_name);