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

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

Merge "msm: kgsl: Change pwrlevels array index type to unsigned int"

parents 641b3842 468fc934
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -522,7 +522,8 @@ int kgsl_devfreq_target(struct device *dev, unsigned long *freq, u32 flags)
	struct kgsl_device *device = dev_get_drvdata(dev);
	struct kgsl_pwrctrl *pwr;
	struct kgsl_pwrlevel *pwr_level;
	int level, i;
	int level;
	unsigned int i;
	unsigned long cur_freq;

	if (device == NULL)
@@ -551,10 +552,11 @@ int kgsl_devfreq_target(struct device *dev, unsigned long *freq, u32 flags)
	if (*freq != cur_freq) {
		level = pwr->max_pwrlevel;
		/*
		 * To avoid infinite loop issue type cast max_pwrlevel to
		 * signed integer type
		 * Array index of pwrlevels[] should be within the permitted
		 * power levels, i.e., from max_pwrlevel to min_pwrlevel.
		 */
		for (i = pwr->min_pwrlevel; i >= (int)pwr->max_pwrlevel; i--)
		for (i = pwr->min_pwrlevel; (i >= pwr->max_pwrlevel
					&& i <= pwr->min_pwrlevel); i--)
			if (*freq <= pwr->pwrlevels[i].gpu_freq) {
				if (pwr->thermal_cycle == CYCLE_ACTIVE)
					level = _thermal_adjust(pwr, i);