arm: tegra: power: fix coverity issue
Sri Krishna chowdary [Sat, 6 Oct 2012 09:58:27 +0000 (14:58 +0530)]
Fix Unsigned can't be less than zero issue.
tegra_dvfs_predict_millivolts returns int, so
voltage_mV can't be unsigned int.

Bug 1046331

Change-Id: I7973c3a434beef1cc54c4d61024b0b381c4fc66f
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/142152
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sachin Nikam <snikam@nvidia.com>

Rebase-Id: R9cb9294b7d575aa5aa45207720d0fb42dd2fda68

arch/arm/mach-tegra/edp.c

index 3e84507..b37c12f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-tegra/edp.c
  *
- * Copyright (C) 2011 NVIDIA, Inc.
+ * Copyright (C) 2011-2012, NVIDIA CORPORATION. All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -472,7 +472,8 @@ unsigned int edp_calculate_maxf(unsigned int a_temp,
 static int edp_relate_freq_voltage(struct clk *clk_cpu_g,
                                unsigned int cpu_speedo_idx)
 {
-       unsigned int i, j, freq, voltage_mV, a_voltage_lut_size;
+       unsigned int i, j, freq, a_voltage_lut_size;
+       int voltage_mV;
        struct a_voltage_lut_t *a_voltage_lut;
 
        a_voltage_lut = edp_constants_lut[cpu_speedo_idx].a_voltage_lut;