summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/drivers/siemens/nc_fpga/nc_fpga.c9
-rw-r--r--src/drivers/siemens/nc_fpga/nc_fpga.h2
2 files changed, 5 insertions, 6 deletions
diff --git a/src/drivers/siemens/nc_fpga/nc_fpga.c b/src/drivers/siemens/nc_fpga/nc_fpga.c
index 8fb25bc7d2..15b3ad338d 100644
--- a/src/drivers/siemens/nc_fpga/nc_fpga.c
+++ b/src/drivers/siemens/nc_fpga/nc_fpga.c
@@ -26,10 +26,9 @@
#define FPGA_SET_PARAM(src, dst) \
{ \
- typeof(dst) var; \
- size_t len = sizeof(var); \
- if (hwilib_get_field(src, (uint8_t *)&var, len) == len) \
- dst = (typeof(dst))(var); \
+ uint32_t var; \
+ if (hwilib_get_field(src, (uint8_t *)&var, sizeof(var))) \
+ dst = *((typeof(dst) *)var); \
}
static void init_temp_mon (void *base_adr)
@@ -41,7 +40,7 @@ static void init_temp_mon (void *base_adr)
/* Program sensor delay first. */
FPGA_SET_PARAM(FANSensorDelay, ctrl->sensordelay);
/* Program correction curve for every used sensor. */
- if (hwilib_get_field(FANSensorNum, &num, sizeof(num) != sizeof(num)) ||
+ if ((hwilib_get_field(FANSensorNum, &num, 1) != 1) ||
(num == 0) || (num > MAX_NUM_SENSORS))
return;
for (i = 0; i < num; i ++) {
diff --git a/src/drivers/siemens/nc_fpga/nc_fpga.h b/src/drivers/siemens/nc_fpga/nc_fpga.h
index a5a7ab8faf..0a0b0c6ed0 100644
--- a/src/drivers/siemens/nc_fpga/nc_fpga.h
+++ b/src/drivers/siemens/nc_fpga/nc_fpga.h
@@ -28,7 +28,7 @@
#define NC_BL_PWM_OFFSET 0x8C
#define NC_FANMON_CTRL_OFFSET 0x400
-#define MAX_NUM_SENSORS 4
+#define MAX_NUM_SENSORS 8
typedef struct {
uint16_t rmin;