[coreboot-gerrit] New patch to review for coreboot: 0c6895c mainboard/siemens/sitemp_g1p1/mainboard.c: Re-declare array as double
Edward O'Callaghan (eocallaghan@alterapraxis.com)
gerrit at coreboot.org
Mon Dec 8 07:00:36 CET 2014
Edward O'Callaghan (eocallaghan at alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7714
-gerrit
commit 0c6895ce4b949ea19d5f7a6d7bc944487c082cf1
Author: Edward O'Callaghan <eocallaghan at alterapraxis.com>
Date: Mon Dec 8 16:01:20 2014 +1100
mainboard/siemens/sitemp_g1p1/mainboard.c: Re-declare array as double
An array of doubles declared as int's causes an implicit conversion
between types.
Change-Id: I1b3cf6885b4cd2f5598c3a3672d079507d7eb9c7
Signed-off-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
Found-by: Clang
---
src/mainboard/siemens/sitemp_g1p1/mainboard.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mainboard/siemens/sitemp_g1p1/mainboard.c b/src/mainboard/siemens/sitemp_g1p1/mainboard.c
index f16ffe8..b286b75 100644
--- a/src/mainboard/siemens/sitemp_g1p1/mainboard.c
+++ b/src/mainboard/siemens/sitemp_g1p1/mainboard.c
@@ -201,7 +201,7 @@ struct __table__ temperatures[] = {
{"80C", 80}
};
#endif
-int trange[] = {2.0,2.5,3.33,4.0,5.0,6.67,8.0,10.0,13.33,16.0,20.0,26.67,32.0,40.0,53.33,80.0};
+double trange[] = {2.0,2.5,3.33,4.0,5.0,6.67,8.0,10.0,13.33,16.0,20.0,26.67,32.0,40.0,53.33,80.0};
#define SIZEOF_TEMPERATURES sizeof(temperatures)/sizeof(struct __table__)
#define TEMPERATURE(i,d) (i < SIZEOF_TEMPERATURES) ? temperatures[i].val : temperatures[d].val // hopefully d is a correct value !!! fix
@@ -288,7 +288,7 @@ static u8 calc_trange(u8 t_min, u8 t_max) {
int diff = t_max - t_min;
// walk through the trange table
- for(i = 0, prev = 0; i < sizeof(trange)/sizeof(int); i++) {
+ for(i = 0, prev = 0; i < sizeof(trange)/sizeof(double); i++) {
if( trange[i] < diff ) {
prev = i; // save last val
continue;
More information about the coreboot-gerrit
mailing list