Commit 6dd86fdb authored by Keith Packard's avatar Keith Packard Committed by Carles Cufi
Browse files

drivers/ieee802154: Cast float abs param to int first



This case takes a float value and passes it to the integer abs function,
storing the result in an integer type variable. That looks like a possible
error to clang, so insert an explicit cast to int to make the compiler
happy.

Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
parent dbb1b87d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -513,7 +513,7 @@ static int rf2xx_set_txpower(const struct device *dev, int16_t dbm)
		dbm = max;
	}

	idx = abs(((float)(dbm - max) / step));
	idx = abs((int) (((float)(dbm - max) / step)));
	LOG_DBG("Tx-power idx: %d", idx);

	if (idx >= conf->tx_pwr_table_size) {