[linux-next:master 14576/14788] drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:857:12: warning: address of array 'dm->backlight_dev' will always evaluate to 'true'

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   92510a7fd93c64ca3e3564b041051e9a17860a65
commit: 394679649e9093adb63f8d8c4cedd10f6e80dd2d [14576/14788] drm/amdgpu/display: add support for multiple backlights
config: x86_64-randconfig-a013-20210709 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 8d69635ed9ecf36fd0ca85906bfde17949671cbe)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=394679649e9093adb63f8d8c4cedd10f6e80dd2d
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 394679649e9093adb63f8d8c4cedd10f6e80dd2d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:857:12: warning: address of array 'dm->backlight_dev' will always evaluate to 'true' [-Wpointer-bool-conversion]
                           if (dm->backlight_dev)
                           ~~  ~~~~^~~~~~~~~~~~~
   1 warning generated.


vim +857 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c

d38ceaf99ed015 Alex Deucher 2015-04-20  837  
d38ceaf99ed015 Alex Deucher 2015-04-20  838  /* Call all ACPI methods here */
d38ceaf99ed015 Alex Deucher 2015-04-20  839  /**
d38ceaf99ed015 Alex Deucher 2015-04-20  840   * amdgpu_acpi_init - init driver acpi support
d38ceaf99ed015 Alex Deucher 2015-04-20  841   *
d38ceaf99ed015 Alex Deucher 2015-04-20  842   * @adev: amdgpu_device pointer
d38ceaf99ed015 Alex Deucher 2015-04-20  843   *
d38ceaf99ed015 Alex Deucher 2015-04-20  844   * Verifies the AMD ACPI interfaces and registers with the acpi
d38ceaf99ed015 Alex Deucher 2015-04-20  845   * notifier chain (all asics).
d38ceaf99ed015 Alex Deucher 2015-04-20  846   * Returns 0 on success, error on failure.
d38ceaf99ed015 Alex Deucher 2015-04-20  847   */
d38ceaf99ed015 Alex Deucher 2015-04-20  848  int amdgpu_acpi_init(struct amdgpu_device *adev)
d38ceaf99ed015 Alex Deucher 2015-04-20  849  {
f9b7f3703ff977 Alex Deucher 2021-05-25  850  	struct amdgpu_atif *atif = &amdgpu_acpi_priv.atif;
d38ceaf99ed015 Alex Deucher 2015-04-20  851  
97d798b276e94a Alex Deucher 2020-05-05  852  #if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
9c27bc97aff8bb Ye Bin       2020-10-09  853  	if (atif->notifications.brightness_change) {
97d798b276e94a Alex Deucher 2020-05-05  854  		if (amdgpu_device_has_dc_support(adev)) {
97d798b276e94a Alex Deucher 2020-05-05  855  #if defined(CONFIG_DRM_AMD_DC)
97d798b276e94a Alex Deucher 2020-05-05  856  			struct amdgpu_display_manager *dm = &adev->dm;
77bf762f8b3011 Alex Deucher 2021-05-19 @857  			if (dm->backlight_dev)
394679649e9093 Alex Deucher 2021-07-08  858  				atif->bd = dm->backlight_dev[0];
97d798b276e94a Alex Deucher 2020-05-05  859  #endif
97d798b276e94a Alex Deucher 2020-05-05  860  		} else {
d38ceaf99ed015 Alex Deucher 2015-04-20  861  			struct drm_encoder *tmp;
d38ceaf99ed015 Alex Deucher 2015-04-20  862  
d38ceaf99ed015 Alex Deucher 2015-04-20  863  			/* Find the encoder controlling the brightness */
4a580877bdcb83 Luben Tuikov 2020-08-24  864  			list_for_each_entry(tmp, &adev_to_drm(adev)->mode_config.encoder_list,
d38ceaf99ed015 Alex Deucher 2015-04-20  865  					    head) {
d38ceaf99ed015 Alex Deucher 2015-04-20  866  				struct amdgpu_encoder *enc = to_amdgpu_encoder(tmp);
d38ceaf99ed015 Alex Deucher 2015-04-20  867  
d38ceaf99ed015 Alex Deucher 2015-04-20  868  				if ((enc->devices & (ATOM_DEVICE_LCD_SUPPORT)) &&
d38ceaf99ed015 Alex Deucher 2015-04-20  869  				    enc->enc_priv) {
d38ceaf99ed015 Alex Deucher 2015-04-20  870  					struct amdgpu_encoder_atom_dig *dig = enc->enc_priv;
d38ceaf99ed015 Alex Deucher 2015-04-20  871  					if (dig->bl_dev) {
97d798b276e94a Alex Deucher 2020-05-05  872  						atif->bd = dig->bl_dev;
d38ceaf99ed015 Alex Deucher 2015-04-20  873  						break;
d38ceaf99ed015 Alex Deucher 2015-04-20  874  					}
d38ceaf99ed015 Alex Deucher 2015-04-20  875  				}
d38ceaf99ed015 Alex Deucher 2015-04-20  876  			}
d38ceaf99ed015 Alex Deucher 2015-04-20  877  		}
97d798b276e94a Alex Deucher 2020-05-05  878  	}
97d798b276e94a Alex Deucher 2020-05-05  879  #endif
f9b7f3703ff977 Alex Deucher 2021-05-25  880  	adev->acpi_nb.notifier_call = amdgpu_acpi_event;
f9b7f3703ff977 Alex Deucher 2021-05-25  881  	register_acpi_notifier(&adev->acpi_nb);
f9b7f3703ff977 Alex Deucher 2021-05-25  882  
f9b7f3703ff977 Alex Deucher 2021-05-25  883  	return 0;
f9b7f3703ff977 Alex Deucher 2021-05-25  884  }
f9b7f3703ff977 Alex Deucher 2021-05-25  885  

:::::: The code at line 857 was first introduced by commit
:::::: 77bf762f8b3011b2d00eb49098071952956da892 drm/amdgpu/acpi: unify ATCS handling (v3)

:::::: TO: Alex Deucher <alexander.deucher@xxxxxxx>
:::::: CC: Alex Deucher <alexander.deucher@xxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux