From: Dan Carpenter <dan.carpenter@linaro.org>
To: Sandipan Das <sandipan.das@amd.com>
Cc: linux-perf-users@vger.kernel.org
Subject: [bug report] perf/x86/amd/uncore: Refactor uncore management
Date: Mon, 8 Dec 2025 11:14:09 +0300 [thread overview]
Message-ID: <aTaI0ci3vZ44lmBn@stanley.mountain> (raw)
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
next reply other threads:[~2025-12-08 8:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-08 8:14 Dan Carpenter [this message]
2025-12-09 7:26 ` [bug report] perf/x86/amd/uncore: Refactor uncore management Sandipan Das
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aTaI0ci3vZ44lmBn@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sandipan.das@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).