public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
* [bug report] drm/xe/reg_sr: Allow register_save_restore_check debugfs to verify LRC values
@ 2026-04-23  7:07 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2026-04-23  7:07 UTC (permalink / raw)
  To: Matt Roper; +Cc: intel-xe

Hello Matt Roper,

Commit 764af38af22a ("drm/xe/reg_sr: Allow
register_save_restore_check debugfs to verify LRC values") from Feb
18, 2026 (linux-next), leads to the following Smatch static checker
warning:

	drivers/gpu/drm/xe/xe_reg_sr.c:272 xe_reg_sr_lrc_check()
	error: uninitialized symbol 'val'.

drivers/gpu/drm/xe/xe_reg_sr.c
    257 void xe_reg_sr_lrc_check(struct xe_reg_sr *sr,
    258                          struct xe_gt *gt,
    259                          struct xe_hw_engine *hwe,
    260                          struct drm_printer *p)
    261 {
    262         struct xe_reg_sr_entry *entry;
    263         unsigned long offset;
    264 
    265         xa_for_each(&sr->xa, offset, entry) {
    266                 u32 val;
    267                 int ret = xe_lrc_lookup_default_reg_value(gt, hwe->class, offset, &val);
    268                 u32 mask = entry->clr_bits | entry->set_bits;
    269 
    270                 if (ret == -ENOENT)

Smatch wants -EINVAL to be handled as well...

    271                         drm_printf(p, "%#8lx :: not found in LRC for %s\n", offset, hwe->name);
--> 272                 else if ((val & mask) != entry->set_bits)

Otherwise it says that val isn't initialized.

    273                         drm_printf(p, "%#8lx & %#10x :: expected %#10x got %#10x\n",
    274                                    offset, mask, entry->set_bits, val & mask);
    275         }
    276 }

This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-04-23  7:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-23  7:07 [bug report] drm/xe/reg_sr: Allow register_save_restore_check debugfs to verify LRC values Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox