Skip to content

Commit b92e749

Browse files
XenuIsWatchingMaureenHelm
authored andcommitted
drivers: sensor: ina3221: fix double-promotion
channel_get was doing using floating point constants with it's calculation. The result is changed to be a float as this was generating a double promotion warning. Signed-off-by: Ryan McClelland <[email protected]>
1 parent 83fcbfd commit b92e749

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/sensor/ina3221/ina3221.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static int ina3221_channel_get(const struct device *dev, enum sensor_channel cha
225225
{
226226
const struct ina3221_config *cfg = dev->config;
227227
struct ina3221_data *data = dev->data;
228-
double result;
228+
float result;
229229

230230
switch (chan) {
231231
case SENSOR_CHAN_VOLTAGE:
@@ -245,7 +245,7 @@ static int ina3221_channel_get(const struct device *dev, enum sensor_channel cha
245245
return -ENOTSUP;
246246
}
247247

248-
return sensor_value_from_double(val, result);
248+
return sensor_value_from_float(val, result);
249249
}
250250

251251
static int ina3221_attr_set(const struct device *dev, enum sensor_channel chan,

0 commit comments

Comments
 (0)