RE: [PATCH] drm/amd/powerplay: return false instead of -EINVAL

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

 



> -----Original Message-----
> From: Andrew Shadura [mailto:andrew.shadura@xxxxxxxxxxxxxxx]
> Sent: Thursday, November 03, 2016 12:42 PM
> To: Deucher, Alexander; linux-kernel@xxxxxxxxxxxxxxx; dri-
> devel@xxxxxxxxxxxxxxxxxxxxx; Koenig, Christian; David Airlie
> Cc: Zhu, Rex; Jammy Zhou
> Subject: Re: [PATCH] drm/amd/powerplay: return false instead of -EINVAL
> 
> On 03/11/16 17:39, Deucher, Alexander wrote:
> >> Returning -EINVAL from a bool-returning function
> >> phm_check_smc_update_required_for_display_configuration has an
> >> unexpected
> >> effect of returning true, which is probably not what was intended.
> >> Replace -EINVAL by false.
> >>
> >> The only place this function is called from is
> >> psm_adjust_power_state_dynamic in
> >> drivers/gpu/drm/amd/powerplay/eventmgr/psm.c:106:
> >>
> >> 	if (!equal ||
> >> phm_check_smc_update_required_for_display_configuration(hwmgr)) {
> >> 		phm_apply_state_adjust_rules(hwmgr, requested,
> >> pcurrent);
> >> 		phm_set_power_state(hwmgr, &pcurrent->hardware,
> >> &requested->hardware);
> >> 		hwmgr->current_ps = requested;
> >> 	}
> >>
> >> It seems to expect a boolean value here.
> >>
> >> This issue has been found using the following Coccinelle semantic patch
> >> written by Peter Senna Tschudin:
> >> <smpl>
> >> @@
> >> identifier f;
> >> constant C;
> >> typedef bool;
> >> @@
> >> bool f (...){
> >> <+...
> >> * return -C;
> >> ...+>
> >> }
> >> </smpl>
> >>
> >> Signed-off-by: Andrew Shadura <andrew.shadura@xxxxxxxxxxxxxxx>
> >
> > Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>
> >
> > I'll pick this up shortly. Thanks!
> 
> Great, thanks! I wonder who should I prod for this one:
> https://patchwork.kernel.org/patch/7206081/

PowerPC developers?

Alex

> 
> --
> Cheers,
>   Andrew

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux