]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/xe/debugfs: Make residencies definitions const
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Fri, 5 Sep 2025 18:02:25 +0000 (20:02 +0200)
committerLucas De Marchi <lucas.demarchi@intel.com>
Tue, 9 Sep 2025 13:05:45 +0000 (06:05 -0700)
No need to keep them non-const. Also fix declaration of .name
member, as it points to the const string. This translates to:

  add/remove: 1/0 grow/shrink: 0/2 up/down: 80/-248 (-168)
  Function                                     old     new   delta
  residencies                                    -      80     +80
  dgfx_pcie_link_residencies_show              365     263    -102
  dgfx_pkg_residencies_show                    454     308    -146
  Total: Before=2821548, After=2821380, chg -0.01%

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Soham Purkait <soham.purkait@intel.com>
Cc: Jonathan Cavitt <jonathan.cavitt@intel.com>
Cc: Karthik Poosa <karthik.poosa@intel.com>
Cc: Riana Tauro <riana.tauro@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20250905180225.8434-1-michal.wajdeczko@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_debugfs.c

index 544d7d8460d9a1a64f65dee4559e6eead4ba7350..38169238dbed276a0a57983131cebfbecf7f4dde 100644 (file)
@@ -40,7 +40,7 @@ DECLARE_FAULT_ATTR(gt_reset_failure);
 DECLARE_FAULT_ATTR(inject_csc_hw_error);
 
 static void read_residency_counter(struct xe_device *xe, struct xe_mmio *mmio,
-                                  u32 offset, char *name, struct drm_printer *p)
+                                  u32 offset, const char *name, struct drm_printer *p)
 {
        u64 residency = 0;
        int ret;
@@ -136,9 +136,9 @@ static int dgfx_pkg_residencies_show(struct seq_file *m, void *data)
        p = drm_seq_file_printer(m);
        xe_pm_runtime_get(xe);
        mmio = xe_root_tile_mmio(xe);
-       struct {
+       static const struct {
                u32 offset;
-               char *name;
+               const char *name;
        } residencies[] = {
                {BMG_G2_RESIDENCY_OFFSET, "Package G2"},
                {BMG_G6_RESIDENCY_OFFSET, "Package G6"},
@@ -165,9 +165,9 @@ static int dgfx_pcie_link_residencies_show(struct seq_file *m, void *data)
        xe_pm_runtime_get(xe);
        mmio = xe_root_tile_mmio(xe);
 
-       struct {
+       static const struct {
                u32 offset;
-               char *name;
+               const char *name;
        } residencies[] = {
                {BMG_PCIE_LINK_L0_RESIDENCY_OFFSET, "PCIE LINK L0 RESIDENCY"},
                {BMG_PCIE_LINK_L1_RESIDENCY_OFFSET, "PCIE LINK L1 RESIDENCY"},