diff options
Diffstat (limited to 'drivers/hwmon/corsair-cpro.c')
| -rw-r--r-- | drivers/hwmon/corsair-cpro.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hwmon/corsair-cpro.c b/drivers/hwmon/corsair-cpro.c index b7b911f8359c..b6e508e43fa1 100644 --- a/drivers/hwmon/corsair-cpro.c +++ b/drivers/hwmon/corsair-cpro.c @@ -40,7 +40,7 @@ #define CTL_GET_TMP 0x11 /* * send: byte 1 is channel, rest zero * rcv: returns temp for channel in centi-degree celsius - * in bytes 1 and 2 + * in bytes 1 and 2 as a two's complement value * returns 0x11 in byte 0 if no sensor is connected */ #define CTL_GET_VOLT 0x12 /* @@ -90,10 +90,10 @@ struct ccp_device { u8 *cmd_buffer; u8 *buffer; int buffer_recv_size; /* number of received bytes in buffer */ - int target[6]; + int target[NUM_FANS]; DECLARE_BITMAP(temp_cnct, NUM_TEMP_SENSORS); DECLARE_BITMAP(fan_cnct, NUM_FANS); - char fan_label[6][LABEL_LENGTH]; + char fan_label[NUM_FANS][LABEL_LENGTH]; u8 firmware_ver[3]; u8 bootloader_ver[2]; }; @@ -258,7 +258,7 @@ static int ccp_read(struct device *dev, enum hwmon_sensor_types type, ret = get_data(ccp, CTL_GET_TMP, channel, true); if (ret < 0) return ret; - *val = ret * 10; + *val = (s16)ret * 10; return 0; default: break; |
