linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] perf/x86/amd/uncore: Refactor uncore management
@ 2025-12-08  8:14 Dan Carpenter
  2025-12-09  7:26 ` Sandipan Das
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2025-12-08  8:14 UTC (permalink / raw)
  To: Sandipan Das; +Cc: linux-perf-users

Hello Sandipan Das,

Commit d6389d3ccc13 ("perf/x86/amd/uncore: Refactor uncore
management") from Oct 5, 2023 (linux-next), leads to the following
Smatch static checker warning:

	arch/x86/events/amd/uncore.c:660 amd_uncore_df_event_init()
	warn: set error code if 'pmu_version < 2'

arch/x86/events/amd/uncore.c
    654 static int amd_uncore_df_event_init(struct perf_event *event)
    655 {
    656         struct hw_perf_event *hwc = &event->hw;
    657         int ret = amd_uncore_event_init(event);
    658 
    659         if (ret || pmu_version < 2)
--> 660                 return ret;

If pmu_version is < 2, do we really want to just return success?

    661 
    662         hwc->config = event->attr.config &
    663                       (pmu_version >= 2 ? AMD64_PERFMON_V2_RAW_EVENT_MASK_NB :
    664                                           AMD64_RAW_EVENT_MASK_NB);

Or do we want to set:

	hwc->config = event->attr.config & AMD64_RAW_EVENT_MASK_NB;

And then return success?

    665 
    666         return 0;
    667 }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-12-09  7:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-08  8:14 [bug report] perf/x86/amd/uncore: Refactor uncore management Dan Carpenter
2025-12-09  7:26 ` Sandipan Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).