All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yi Liu <yi.l.liu@intel.com>, Kevin Tian <kevin.tian@intel.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [yiliu1765-iommufd:tmp/for-baol-0303 32/53] drivers/iommu/iommufd/device.c:247:33: warning: cast to pointer from integer of different size
Date: Fri, 3 Mar 2023 13:21:57 +0800	[thread overview]
Message-ID: <202303031326.Apfli8PI-lkp@intel.com> (raw)

tree:   https://github.com/yiliu1765/iommufd.git tmp/for-baol-0303
head:   028abaf51f935755b020cbb2c8f196862dd3a312
commit: ff36dc2e826bee1bb7c880b6fdd9612a7b13af24 [32/53] iommufd: Add IOMMU_DEVICE_GET_INFO
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20230303/202303031326.Apfli8PI-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 12.1.0
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
        # https://github.com/yiliu1765/iommufd/commit/ff36dc2e826bee1bb7c880b6fdd9612a7b13af24
        git remote add yiliu1765-iommufd https://github.com/yiliu1765/iommufd.git
        git fetch --no-tags yiliu1765-iommufd tmp/for-baol-0303
        git checkout ff36dc2e826bee1bb7c880b6fdd9612a7b13af24
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash drivers/iommu/iommufd/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303031326.Apfli8PI-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/linux/uaccess.h:11,
                    from include/linux/sched/task.h:11,
                    from include/linux/sched/signal.h:9,
                    from include/linux/rcuwait.h:6,
                    from include/linux/percpu-rwsem.h:7,
                    from include/linux/fs.h:33,
                    from include/linux/huge_mm.h:8,
                    from include/linux/mm.h:746,
                    from include/linux/scatterlist.h:8,
                    from include/linux/iommu.h:10,
                    from drivers/iommu/iommufd/device.c:6:
   drivers/iommu/iommufd/device.c: In function 'iommufd_zero_fill_user':
>> drivers/iommu/iommufd/device.c:247:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     247 |                 if (put_user(0, (uint8_t __user *)(ptr + index)))
         |                                 ^
   arch/m68k/include/asm/uaccess.h:81:18: note: in definition of macro '__put_user'
      81 |         typeof(*(ptr)) __pu_val = (x);                                  \
         |                  ^~~
   drivers/iommu/iommufd/device.c:247:21: note: in expansion of macro 'put_user'
     247 |                 if (put_user(0, (uint8_t __user *)(ptr + index)))
         |                     ^~~~~~~~
>> drivers/iommu/iommufd/device.c:247:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     247 |                 if (put_user(0, (uint8_t __user *)(ptr + index)))
         |                                 ^
   arch/m68k/include/asm/uaccess.h:84:27: note: in definition of macro '__put_user'
      84 |         switch (sizeof (*(ptr))) {                                      \
         |                           ^~~
   drivers/iommu/iommufd/device.c:247:21: note: in expansion of macro 'put_user'
     247 |                 if (put_user(0, (uint8_t __user *)(ptr + index)))
         |                     ^~~~~~~~
>> drivers/iommu/iommufd/device.c:247:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     247 |                 if (put_user(0, (uint8_t __user *)(ptr + index)))
         |                                 ^
   arch/m68k/include/asm/uaccess.h:46:31: note: in definition of macro '__put_user_asm'
      46 |         : "+d" (res), "=m" (*(ptr))                     \
         |                               ^~~
   arch/m68k/include/asm/uaccess.h:102:33: note: in expansion of macro '__put_user'
     102 | #define put_user(x, ptr)        __put_user(x, ptr)
         |                                 ^~~~~~~~~~
   drivers/iommu/iommufd/device.c:247:21: note: in expansion of macro 'put_user'
     247 |                 if (put_user(0, (uint8_t __user *)(ptr + index)))
         |                     ^~~~~~~~
>> drivers/iommu/iommufd/device.c:247:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     247 |                 if (put_user(0, (uint8_t __user *)(ptr + index)))
         |                                 ^
   arch/m68k/include/asm/uaccess.h:46:31: note: in definition of macro '__put_user_asm'
      46 |         : "+d" (res), "=m" (*(ptr))                     \
         |                               ^~~
   arch/m68k/include/asm/uaccess.h:102:33: note: in expansion of macro '__put_user'
     102 | #define put_user(x, ptr)        __put_user(x, ptr)
         |                                 ^~~~~~~~~~
   drivers/iommu/iommufd/device.c:247:21: note: in expansion of macro 'put_user'
     247 |                 if (put_user(0, (uint8_t __user *)(ptr + index)))
         |                     ^~~~~~~~
>> drivers/iommu/iommufd/device.c:247:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     247 |                 if (put_user(0, (uint8_t __user *)(ptr + index)))
         |                                 ^
   arch/m68k/include/asm/uaccess.h:46:31: note: in definition of macro '__put_user_asm'
      46 |         : "+d" (res), "=m" (*(ptr))                     \
         |                               ^~~
   arch/m68k/include/asm/uaccess.h:102:33: note: in expansion of macro '__put_user'
     102 | #define put_user(x, ptr)        __put_user(x, ptr)
         |                                 ^~~~~~~~~~
   drivers/iommu/iommufd/device.c:247:21: note: in expansion of macro 'put_user'
     247 |                 if (put_user(0, (uint8_t __user *)(ptr + index)))
         |                     ^~~~~~~~
>> drivers/iommu/iommufd/device.c:247:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     247 |                 if (put_user(0, (uint8_t __user *)(ptr + index)))
         |                                 ^
   arch/m68k/include/asm/uaccess.h:51:55: note: in definition of macro '__put_user_asm8'
      51 |         const void *__pu_ptr = (const void __force *)(ptr);     \
         |                                                       ^~~
   arch/m68k/include/asm/uaccess.h:102:33: note: in expansion of macro '__put_user'
     102 | #define put_user(x, ptr)        __put_user(x, ptr)
         |                                 ^~~~~~~~~~
   drivers/iommu/iommufd/device.c:247:21: note: in expansion of macro 'put_user'
     247 |                 if (put_user(0, (uint8_t __user *)(ptr + index)))
         |                     ^~~~~~~~


vim +247 drivers/iommu/iommufd/device.c

   241	
   242	static int iommufd_zero_fill_user(u64 ptr, int bytes)
   243	{
   244		int index = 0;
   245	
   246		for (; index < bytes; index++) {
 > 247			if (put_user(0, (uint8_t __user *)(ptr + index)))
   248				return -EFAULT;
   249		}
   250		return 0;
   251	}
   252	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

                 reply	other threads:[~2023-03-03  5:22 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=202303031326.Apfli8PI-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=yi.l.liu@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.