[PATCH v1] drm/xe: drop redundant conversion to bool

Rodrigo Vivi rodrigo.vivi at intel.com
Thu May 29 16:18:33 UTC 2025


On Thu, May 29, 2025 at 09:39:37PM +0530, Raag Jadav wrote:
> The result of integer comparison already evaluates to bool. No need for
> explicit conversion.
> 
> No functional impact.
> 
> Fixes: 0e414bf7ad01 ("drm/xe: Expose PCIe link downgrade attributes")
> Reported-by: kernel test robot <lkp at intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202505292205.MoljmkjQ-lkp@intel.com/
> Signed-off-by: Raag Jadav <raag.jadav at intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>

> ---
>  drivers/gpu/drm/xe/xe_device_sysfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_device_sysfs.c b/drivers/gpu/drm/xe/xe_device_sysfs.c
> index 2e657692e5b5..b9440f8c781e 100644
> --- a/drivers/gpu/drm/xe/xe_device_sysfs.c
> +++ b/drivers/gpu/drm/xe/xe_device_sysfs.c
> @@ -115,7 +115,7 @@ auto_link_downgrade_capable_show(struct device *dev, struct device_attribute *at
>  	xe_pm_runtime_put(xe);
>  
>  	cap = REG_FIELD_GET(LINK_DOWNGRADE, val);
> -	return sysfs_emit(buf, "%u\n", cap == DOWNGRADE_CAPABLE ? true : false);
> +	return sysfs_emit(buf, "%u\n", cap == DOWNGRADE_CAPABLE);
>  }
>  static DEVICE_ATTR_ADMIN_RO(auto_link_downgrade_capable);
>  
> -- 
> 2.34.1
> 


More information about the Intel-xe mailing list