mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: adjust tested variable
@ 2018-01-27 14:28 Julia Lawall
  2018-01-28 13:03 ` Christian König
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2018-01-27 14:28 UTC (permalink / raw)
  To: Alex Deucher
  Cc: kernel-janitors, Christian König, David (ChunMing) Zhou,
	David Airlie, amd-gfx, dri-devel, linux-kernel

Check the variable that was most recently initialized.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x, y, f, g, e, m;
statement S1,S2,S3,S4;
@@

x = f(...);
if (\(<+...x...+>\&e\)) S1 else S2
(
x = g(...);
|
m = g(...,&x,...);
|
y = g(...);
*if (e)
 S3 else S4
)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/gpu/drm/radeon/radeon_uvd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c
index d34d1cf..95f4db7 100644
--- a/drivers/gpu/drm/radeon/radeon_uvd.c
+++ b/drivers/gpu/drm/radeon/radeon_uvd.c
@@ -995,7 +995,7 @@ int radeon_uvd_calc_upll_dividers(struct radeon_device *rdev,
 		/* 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)
+		if (dclk_div > pd_max)
 			break; /* vco is too big, it has to stop */
 
 		/* calc score with current vco freq */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/radeon: adjust tested variable
  2018-01-27 14:28 [PATCH] drm/radeon: adjust tested variable Julia Lawall
@ 2018-01-28 13:03 ` Christian König
  0 siblings, 0 replies; 2+ messages in thread
From: Christian König @ 2018-01-28 13:03 UTC (permalink / raw)
  To: Julia Lawall, Alex Deucher
  Cc: kernel-janitors, David (ChunMing) Zhou, David Airlie, amd-gfx,
	dri-devel, linux-kernel

Am 27.01.2018 um 15:28 schrieb Julia Lawall:
> Check the variable that was most recently initialized.
>
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression x, y, f, g, e, m;
> statement S1,S2,S3,S4;
> @@
>
> x = f(...);
> if (\(<+...x...+>\&e\)) S1 else S2
> (
> x = g(...);
> |
> m = g(...,&x,...);
> |
> y = g(...);
> *if (e)
>   S3 else S4
> )
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Good catch, added my rb and pushed it into our to-be-upstreamed branch.

Thanks,
Christian.

>
> ---
>   drivers/gpu/drm/radeon/radeon_uvd.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c
> index d34d1cf..95f4db7 100644
> --- a/drivers/gpu/drm/radeon/radeon_uvd.c
> +++ b/drivers/gpu/drm/radeon/radeon_uvd.c
> @@ -995,7 +995,7 @@ int radeon_uvd_calc_upll_dividers(struct radeon_device *rdev,
>   		/* 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)
> +		if (dclk_div > pd_max)
>   			break; /* vco is too big, it has to stop */
>   
>   		/* calc score with current vco freq */
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-28 13:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-27 14:28 [PATCH] drm/radeon: adjust tested variable Julia Lawall
2018-01-28 13:03 ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®