Skip to content

Commit 3a09d8e

Browse files
Mao Hanguoren83
authored andcommitted
csky: Fixup csky_pmu.max_period assignment
The csky_pmu.max_period has type u64, and BIT() can only return 32 bits unsigned long on C-SKY. The initialization for max_period will be incorrect when count_width is bigger than 32. Use BIT_ULL() Signed-off-by: Mao Han <[email protected]> Signed-off-by: Guo Ren <[email protected]>
1 parent 48ede51 commit 3a09d8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/csky/kernel/perf_event.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,7 @@ int csky_pmu_device_probe(struct platform_device *pdev,
13061306
&csky_pmu.count_width)) {
13071307
csky_pmu.count_width = DEFAULT_COUNT_WIDTH;
13081308
}
1309-
csky_pmu.max_period = BIT(csky_pmu.count_width) - 1;
1309+
csky_pmu.max_period = BIT_ULL(csky_pmu.count_width) - 1;
13101310

13111311
csky_pmu.plat_device = pdev;
13121312

0 commit comments

Comments
 (0)