PM / devfreq: exynos-ppmu: bit-wise operation bugfix.
MyungJoo Ham
maintainerPATCH 1/1 PM / devfreq: exynos-ppmu: bit-wise operation bugfix.
Make it u64 before left-shifting 32bits.
Signed-off-by MyungJoo Ham <[email protected]>
--- drivers/devfreq/event/exynos-ppmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/devfreq/event/exynos-ppmu.c +2 -1
@@ -319,7 +319,8 @@ static int exynos_ppmu_v2_get_event(struct devfreq_event_dev *edev,case PPMU_PMNCNT3 : pmcnt_high =__raw_readl (info->ppmu.base +PPMU_V2_PMCNT3_HIGH ); pmcnt_low =__raw_readl (info->ppmu.base +PPMU_V2_PMCNT3_LOW ); - load_count = (u64)((pmcnt_high &0xff ) <<32 ) + (u64 )pmcnt_low; + load_count = ((u64)((pmcnt_high &0xff )) <<32 ) + + (u64 )pmcnt_low;break ; } edata->load_count = load_count;
Signature · 1 line
1.9.1
Quoted 14 lines · MyungJoo Ham
Make it u64 before left-shifting 32bits.
Signed-off-by MyungJoo Ham <[email protected]>--- drivers/devfreq/event/exynos-ppmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/devfreq/event/exynos-ppmu.c +0
-0
drivers/devfreq/event/exynos-ppmu.c static int exynos_ppmu_v2_get_event(struct devfreq_event_dev *edev, · line 326
Quoted 9 lines
drivers/devfreq/event/exynos-ppmu.c +2
-1@@ -319,7 +319,8 @@ static int exynos_ppmu_v2_get_event(struct devfreq_event_dev *edev,case PPMU_PMNCNT3 : pmcnt_high =__raw_readl (info->ppmu.base +PPMU_V2_PMCNT3_HIGH ); pmcnt_low =__raw_readl (info->ppmu.base +PPMU_V2_PMCNT3_LOW ); - load_count = (u64)((pmcnt_high &0xff ) <<32 ) + (u64 )pmcnt_low; + load_count = ((u64)((pmcnt_high &0xff )) <<32 ) + + (u64 )pmcnt_low;break ; } edata->load_count = load_count;
Reviewed-by Chanwoo Choi <[email protected]>
Thanks,
Chanwoo Choi