intel_pstate: Fix possible overflow complained by Coverity
[deliverable/linux.git] / drivers / cpufreq / intel_pstate.c
index 7b2721fb861fba8bef63a23f37b93acba2dee3ac..b9354b6f71496bffc8460f87b38e4d58c4f2bc8b 100644 (file)
@@ -521,7 +521,7 @@ static void byt_set_pstate(struct cpudata *cpudata, int pstate)
        int32_t vid_fp;
        u32 vid;
 
-       val = pstate << 8;
+       val = (u64)pstate << 8;
        if (limits.no_turbo && !limits.turbo_disabled)
                val |= (u64)1 << 32;
 
@@ -610,7 +610,7 @@ static void core_set_pstate(struct cpudata *cpudata, int pstate)
 {
        u64 val;
 
-       val = pstate << 8;
+       val = (u64)pstate << 8;
        if (limits.no_turbo && !limits.turbo_disabled)
                val |= (u64)1 << 32;
 
This page took 0.023263 seconds and 5 git commands to generate.