Commit c58c130b authored by Ryan McClelland's avatar Ryan McClelland Committed by Mahesh Mahadevan
Browse files

drivers: sensor: default_rtio_sensor: fix limited range warning



`chan_type` is defined as a `uint16_t`. This makes checking if it is
< 0 always false. A warning is shown with -Wtype-limits. Remove the
check as it is unnecessary.

Signed-off-by: default avatarRyan McClelland <ryanmcclelland@meta.com>
parent 04d8b7c5
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -348,7 +348,7 @@ int sensor_natively_supported_channel_size_info(struct sensor_chan_spec channel,
	__ASSERT_NO_MSG(base_size != NULL);
	__ASSERT_NO_MSG(base_size != NULL);
	__ASSERT_NO_MSG(frame_size != NULL);
	__ASSERT_NO_MSG(frame_size != NULL);


	if (((int)channel.chan_type < 0) || channel.chan_type >= (SENSOR_CHAN_ALL)) {
	if (channel.chan_type >= SENSOR_CHAN_ALL) {
		return -ENOTSUP;
		return -ENOTSUP;
	}
	}


@@ -474,7 +474,7 @@ static int decode(const uint8_t *buffer, struct sensor_chan_spec chan_spec,
		return -EINVAL;
		return -EINVAL;
	}
	}


	if (((int)chan_spec.chan_type < 0) || chan_spec.chan_type >= (SENSOR_CHAN_ALL)) {
	if (chan_spec.chan_type >= SENSOR_CHAN_ALL) {
		return 0;
		return 0;
	}
	}