Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e341fdb6 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: fd: round to nearest control values"

parents 60f348da 774012b8
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -109,12 +109,18 @@ static int msm_fd_get_format_index(struct v4l2_format *f)
static int msm_fd_get_idx_from_value(int value, int *array, int array_size)
{
	int index;
	int i;

	for (index = 0; index < array_size; index++) {
		if (value <=  array[index])
			return index;
	index = 0;
	for (i = 1; i < array_size; i++) {
		if (value == array[i]) {
			index = i;
			break;
		}
	return index - 1;
		if (abs(value - array[i]) < abs(value - array[index]))
			index = i;
	}
	return index;
}

/*