[linux-next:master 10120/10218] drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:3461:3: error: call to undeclared function 'vfree'; ISO C99 and later do not support implicit function declarations

[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:   ab38272e99730375c5db3db1c4cebf691a0550ab
commit: d5a442f3ad3079cb23913c1a0cdd2ef6642145df [10120/10218] Merge branch 'drm-next' of https://gitlab.freedesktop.org/agd5f/linux
config: mips-randconfig-r015-20220509 (https://download.01.org/0day-ci/archive/20220510/202205101016.RrkUuGWK-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 3abb68a626160e019c30a4860e569d7bc75e486a)
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 mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=d5a442f3ad3079cb23913c1a0cdd2ef6642145df
        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 d5a442f3ad3079cb23913c1a0cdd2ef6642145df
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/gpu/drm/amd/amdgpu/

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

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:3461:3: error: call to undeclared function 'vfree'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                   vfree(adev->psp.vbflash_tmp_buf);
                   ^
>> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:3469:31: error: call to undeclared function 'vmalloc'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                   adev->psp.vbflash_tmp_buf = vmalloc(AMD_VBIOS_FILE_MAX_SIZE_B);
                                               ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:3469:29: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
                   adev->psp.vbflash_tmp_buf = vmalloc(AMD_VBIOS_FILE_MAX_SIZE_B);
                                             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:3516:2: error: call to undeclared function 'vfree'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
           vfree(adev->psp.vbflash_tmp_buf);
           ^
   1 warning and 3 errors generated.


vim +/vfree +3461 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

57430471e2fa60 Andrey Grodzovsky 2019-12-19  3447  
31aad22e2b3cfe Likun Gao         2022-02-22  3448  static ssize_t amdgpu_psp_vbflash_write(struct file *filp, struct kobject *kobj,
31aad22e2b3cfe Likun Gao         2022-02-22  3449  					struct bin_attribute *bin_attr,
31aad22e2b3cfe Likun Gao         2022-02-22  3450  					char *buffer, loff_t pos, size_t count)
31aad22e2b3cfe Likun Gao         2022-02-22  3451  {
31aad22e2b3cfe Likun Gao         2022-02-22  3452  	struct device *dev = kobj_to_dev(kobj);
31aad22e2b3cfe Likun Gao         2022-02-22  3453  	struct drm_device *ddev = dev_get_drvdata(dev);
31aad22e2b3cfe Likun Gao         2022-02-22  3454  	struct amdgpu_device *adev = drm_to_adev(ddev);
31aad22e2b3cfe Likun Gao         2022-02-22  3455  
81bd7fe019e195 Likun Gao         2022-05-05  3456  	adev->psp.vbflash_done = false;
81bd7fe019e195 Likun Gao         2022-05-05  3457  
31aad22e2b3cfe Likun Gao         2022-02-22  3458  	/* Safeguard against memory drain */
31aad22e2b3cfe Likun Gao         2022-02-22  3459  	if (adev->psp.vbflash_image_size > AMD_VBIOS_FILE_MAX_SIZE_B) {
31aad22e2b3cfe Likun Gao         2022-02-22  3460  		dev_err(adev->dev, "File size cannot exceed %u", AMD_VBIOS_FILE_MAX_SIZE_B);
31aad22e2b3cfe Likun Gao         2022-02-22 @3461  		vfree(adev->psp.vbflash_tmp_buf);
31aad22e2b3cfe Likun Gao         2022-02-22  3462  		adev->psp.vbflash_tmp_buf = NULL;
31aad22e2b3cfe Likun Gao         2022-02-22  3463  		adev->psp.vbflash_image_size = 0;
31aad22e2b3cfe Likun Gao         2022-02-22  3464  		return -ENOMEM;
31aad22e2b3cfe Likun Gao         2022-02-22  3465  	}
31aad22e2b3cfe Likun Gao         2022-02-22  3466  
31aad22e2b3cfe Likun Gao         2022-02-22  3467  	/* TODO Just allocate max for now and optimize to realloc later if needed */
31aad22e2b3cfe Likun Gao         2022-02-22  3468  	if (!adev->psp.vbflash_tmp_buf) {
31aad22e2b3cfe Likun Gao         2022-02-22 @3469  		adev->psp.vbflash_tmp_buf = vmalloc(AMD_VBIOS_FILE_MAX_SIZE_B);
31aad22e2b3cfe Likun Gao         2022-02-22  3470  		if (!adev->psp.vbflash_tmp_buf)
31aad22e2b3cfe Likun Gao         2022-02-22  3471  			return -ENOMEM;
31aad22e2b3cfe Likun Gao         2022-02-22  3472  	}
31aad22e2b3cfe Likun Gao         2022-02-22  3473  
31aad22e2b3cfe Likun Gao         2022-02-22  3474  	mutex_lock(&adev->psp.mutex);
31aad22e2b3cfe Likun Gao         2022-02-22  3475  	memcpy(adev->psp.vbflash_tmp_buf + pos, buffer, count);
31aad22e2b3cfe Likun Gao         2022-02-22  3476  	adev->psp.vbflash_image_size += count;
31aad22e2b3cfe Likun Gao         2022-02-22  3477  	mutex_unlock(&adev->psp.mutex);
31aad22e2b3cfe Likun Gao         2022-02-22  3478  
31aad22e2b3cfe Likun Gao         2022-02-22  3479  	dev_info(adev->dev, "VBIOS flash write PSP done");
31aad22e2b3cfe Likun Gao         2022-02-22  3480  
31aad22e2b3cfe Likun Gao         2022-02-22  3481  	return count;
31aad22e2b3cfe Likun Gao         2022-02-22  3482  }
31aad22e2b3cfe Likun Gao         2022-02-22  3483  

:::::: The code at line 3461 was first introduced by commit
:::::: 31aad22e2b3cfe89aef45015a9c7e4f7c0646daa drm/amdgpu/psp: Add vbflash sysfs interface support

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

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp




[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