[bug report] drm/amdgpu/acpi: unify ATCS handling (v3)

Dan Carpenter dan.carpenter at oracle.com
Tue Jul 13 07:52:22 UTC 2021


Hello Alex Deucher,

The patch 77bf762f8b30: "drm/amdgpu/acpi: unify ATCS handling (v3)"
from May 19, 2021, leads to the following static checker warning:

	drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:857 amdgpu_acpi_init()
	warn: this array is probably non-NULL. 'dm->backlight_dev'

drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
   848  int amdgpu_acpi_init(struct amdgpu_device *adev)
   849  {
   850          struct amdgpu_atif *atif = &amdgpu_acpi_priv.atif;
   851  
   852  #if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
   853          if (atif->notifications.brightness_change) {
   854                  if (amdgpu_device_has_dc_support(adev)) {
   855  #if defined(CONFIG_DRM_AMD_DC)
   856                          struct amdgpu_display_manager *dm = &adev->dm;
   857                          if (dm->backlight_dev)
                                    ^^^^^^^^^^^^^^^^^
The commit adds an unnecessary NULL check.

   858                                  atif->bd = dm->backlight_dev[0];
   859  #endif
   860                  } else {
   861                          struct drm_encoder *tmp;

regards,
dan carpenter


More information about the amd-gfx mailing list