]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
perf/amlogic: Fix config1/config2 parsing issue
authorJiucheng Xu <jiucheng.xu@amlogic.com>
Thu, 9 Feb 2023 11:54:01 +0000 (19:54 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 7 Jul 2023 10:16:50 +0000 (12:16 +0200)
BugLink: https://bugs.launchpad.net/bugs/2025067
[ Upstream commit c61e5720f23273269cc67ffb2908cf9831c8ca9d ]

The 3th argument of for_each_set_bit is incorrect, fix them.

Fixes: 2016e2113d35 ("perf/amlogic: Add support for Amlogic meson G12 SoC DDR PMU driver")
Signed-off-by: Jiucheng Xu <jiucheng.xu@amlogic.com>
Link: https://lore.kernel.org/r/20230209115403.521868-1-jiucheng.xu@amlogic.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/perf/amlogic/meson_ddr_pmu_core.c

index b84346dbac2cecabf856d3ff8935fd414be83370..0b24dee1ed3cfbed3f24d6ea6adeeb36bfe1da44 100644 (file)
@@ -156,10 +156,14 @@ static int meson_ddr_perf_event_add(struct perf_event *event, int flags)
        u64 config2 = event->attr.config2;
        int i;
 
-       for_each_set_bit(i, (const unsigned long *)&config1, sizeof(config1))
+       for_each_set_bit(i,
+                        (const unsigned long *)&config1,
+                        BITS_PER_TYPE(config1))
                meson_ddr_set_axi_filter(event, i);
 
-       for_each_set_bit(i, (const unsigned long *)&config2, sizeof(config2))
+       for_each_set_bit(i,
+                        (const unsigned long *)&config2,
+                        BITS_PER_TYPE(config2))
                meson_ddr_set_axi_filter(event, i + 64);
 
        if (flags & PERF_EF_START)