[PATCH -next] drm/amdgpu: Remove a lot of unnecessary ternary operators
Tom Rix
trix at redhat.com
Mon Jul 31 16:22:42 UTC 2023
On 7/31/23 6:26 AM, Ruan Jinjie wrote:
> Ther are many ternary operators, the true or false judgement
> of which is unnecessary in C language semantics.
>
> Signed-off-by: Ruan Jinjie<ruanjinjie at huawei.com>
> ---
snip
> data->registry_data.avfs_support =
> - hwmgr->feature_mask & PP_AVFS_MASK ? true : false;
> + hwmgr->feature_mask & PP_AVFS_MASK;
> data->registry_data.led_dpm_enabled = 1;
These are not equivalent, consider 0xffff & 0x1000 != 1
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20230731/2851851e/attachment.htm>
More information about the dri-devel
mailing list