Project

General

Profile

Actions

Bug #3102

closed

sys/dev/drm/radeon/radeon_uvd.c:897: possible cut'n'paste issue ?

Added by dcb about 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Kernel
Target version:
-
Start date:
11/15/2017
Due date:
% Done:

0%

Estimated time:

Description

dragonfly/sys/dev/drm/radeon/radeon_uvd.c:897] -> [dragonfly/sys/dev/drm/radeon/radeon_uvd.c:903]: (warning) Identical condition 'vclk_div>pd_max', second condition is always false

Source code is

if (vclk_div > pd_max)
break; /* vco is too big, it has to stop */
/* calc dclk divider with current vco freq /
dclk_div = radeon_uvd_calc_upll_post_div(vco_freq, dclk,
pd_min, pd_even);
if (vclk_div > pd_max)
break; /
vco is too big, it has to stop */

Maybe the 2nd if would be better if it sanity checked dclk_div, like

if (dclk_div > pd_max)
break; /* vco is too big, it has to stop */
Actions #1

Updated by zrj about 7 years ago

I agree on possible cut'n'paste issue. It does look like dclk_div should have been used.
Still present in radeon upstream version:
https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/radeon/radeon_uvd.c#L998

Could you report it there too?

Actions #2

Updated by dcb about 7 years ago

Could you report it there too?

I had a look around for a bug button and couldn't see one, so no.

I am happy for someone who knows their way around github better than me
to have a go.

Actions #3

Updated by swildner over 6 years ago

  • Status changed from New to Closed

I've pushed a fix. It was fixed in Linux too (3a61b527b4e1f285d21b6e9e623dc45cf8bb391f).

Thanks.

Actions

Also available in: Atom PDF