Re: [PATCH] drm/amd/powerplay: fix amd_powerplay_reset()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 24 Oct 2017, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> We accidentally inverted an if statement and turned amd_powerplay_reset()
> into a no-op.
>
> Fixes: ae97988fc89e ("drm/amd/powerplay: tidy up ret checks in amd_powerplay.c (v3)")

For some reason I looked up that commit, and it has *two* cases where
"ret != 0" gets changed to "!ret".

BR,
Jani.


> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---
> IMHO, tidying unreadable double negatives is tricky and error prone but
> still worth it in the long run.
>
> diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> index 3c8ef4bfc205..0f8b6dc853a5 100644
> --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> @@ -1184,7 +1184,7 @@ int amd_powerplay_reset(void *handle)
>  	int ret;
>  
>  	ret = pp_check(instance);
> -	if (!ret)
> +	if (ret)
>  		return ret;
>  
>  	ret = pp_hw_fini(instance);
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Jani Nikula, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux