linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Likun Gao <Likun.Gao@amd.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Alex Deucher <alexander.deucher@amd.com>,
	Andrey Grodzovsky <andrey.grodzovsky@amd.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>
Subject: [linux-next:master 9592/10218] drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:3467:29: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int'
Date: Tue, 10 May 2022 06:59:50 +0800	[thread overview]
Message-ID: <202205100612.ZAcTYE6P-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   ab38272e99730375c5db3db1c4cebf691a0550ab
commit: 31aad22e2b3cfe89aef45015a9c7e4f7c0646daa [9592/10218] drm/amdgpu/psp: Add vbflash sysfs interface support
config: mips-randconfig-r015-20220509 (https://download.01.org/0day-ci/archive/20220510/202205100612.ZAcTYE6P-lkp@intel.com/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=31aad22e2b3cfe89aef45015a9c7e4f7c0646daa
        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 31aad22e2b3cfe89aef45015a9c7e4f7c0646daa
        # 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@intel.com>

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:3459:3: error: implicit declaration of function 'vfree' [-Werror,-Wimplicit-function-declaration]
                   vfree(adev->psp.vbflash_tmp_buf);
                   ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:3467:31: error: implicit declaration of function 'vmalloc' [-Werror,-Wimplicit-function-declaration]
                   adev->psp.vbflash_tmp_buf = vmalloc(AMD_VBIOS_FILE_MAX_SIZE_B);
                                               ^
>> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:3467: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:3514:2: error: implicit declaration of function 'vfree' [-Werror,-Wimplicit-function-declaration]
           vfree(adev->psp.vbflash_tmp_buf);
           ^
   1 warning and 3 errors generated.


vim +3467 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

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

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


                 reply	other threads:[~2022-05-09 23:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202205100612.ZAcTYE6P-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=Likun.Gao@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=andrey.grodzovsky@amd.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=llvm@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox