From: Dan Carpenter Date: Wed, 4 Sep 2013 09:31:36 +0000 (+0300) Subject: drm/radeon: signedness bug in kv_dpm.c X-Git-Tag: v3.12-rc2~17^2~6^2~18 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c5c6fad61f9540a977e5731a8ae3bd8ba9083cb;p=pandora-kernel.git drm/radeon: signedness bug in kv_dpm.c The problem here is that "unsigned i" is always greater than or equal to zero. These loops mostly have a second check for "(i == 0)" so only the last two are actually buggy. The rest is just cleanup. Bug 1: kv_force_dpm_highest() doesn't have an "(i == 0)" check so it's a potential forever loop. Bug 2: In kv_get_sleep_divider_id_from_clock() there is a typo and the test is reversed "<=" vs ">" so we never enter the loop. That means normally we return KV_MAX_DEEPSLEEP_DIVIDER_ID (5). The return value from here is saved in ->DeepSleepDivId and I wasn't able to determine how that is used. This is a static checker fix and I have not tested it. Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher --- Reading git-diff-tree failed