Skip to content

Commit

Permalink
csky: Fixup csky_pmu.max_period assignment
Browse files Browse the repository at this point in the history
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 <han_mao@c-sky.com>
Signed-off-by: Guo Ren <ren_guo@c-sky.com>
  • Loading branch information
Mao Han authored and Guo Ren committed Sep 30, 2019
1 parent 48ede51 commit 3a09d8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/csky/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,7 @@ int csky_pmu_device_probe(struct platform_device *pdev,
&csky_pmu.count_width)) {
csky_pmu.count_width = DEFAULT_COUNT_WIDTH;
}
csky_pmu.max_period = BIT(csky_pmu.count_width) - 1;
csky_pmu.max_period = BIT_ULL(csky_pmu.count_width) - 1;

csky_pmu.plat_device = pdev;

Expand Down

0 comments on commit 3a09d8e

Please sign in to comment.