drm/buddy: Fix drm buddy info output format
authorMa Jun <Jun.Ma2@amd.com>
Thu, 3 Aug 2023 01:34:55 +0000 (09:34 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 9 Aug 2023 13:46:05 +0000 (09:46 -0400)
[1] Change pages to blocks to avoid confusion.
[2] Fix output format to align the output info.

Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Reviewed-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/drm_buddy.c

index 7098f125b54a9a3004ea98345f7ec486cc8ae24a..e6f5ba5f4bafd056aa8ea7a1222d74f5c464df83 100644 (file)
@@ -781,15 +781,15 @@ void drm_buddy_print(struct drm_buddy *mm, struct drm_printer *p)
                        count++;
                }
 
-               drm_printf(p, "order-%d ", order);
+               drm_printf(p, "order-%2d ", order);
 
                free = count * (mm->chunk_size << order);
                if (free < SZ_1M)
-                       drm_printf(p, "free: %lluKiB", free >> 10);
+                       drm_printf(p, "free: %8llu KiB", free >> 10);
                else
-                       drm_printf(p, "free: %lluMiB", free >> 20);
+                       drm_printf(p, "free: %8llu MiB", free >> 20);
 
-               drm_printf(p, ", pages: %llu\n", count);
+               drm_printf(p, ", blocks: %llu\n", count);
        }
 }
 EXPORT_SYMBOL(drm_buddy_print);