From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============0928930324306094552==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: [sashal-stable:pending-5.4 10/15] fs/btrfs/tree-checker.c:767:46: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const struct btrfs_item *' Date: Fri, 18 Feb 2022 08:24:08 +0800 Message-ID: <202202180846.wcHCjYMX-lkp@intel.com> List-Id: --===============0928930324306094552== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable= .git pending-5.4 head: 65d5f84ef6b4a30cf78cd72437c1adc92f4af205 commit: 5054a249363156992a4b6a3ab1a0be76feda7bf1 [10/15] btrfs: tree-checke= r: check item_size for dev_item config: x86_64-randconfig-a003 (https://download.01.org/0day-ci/archive/202= 20218/202202180846.wcHCjYMX-lkp(a)intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc= 04d5b97b12e6b797c6067d3c96a8d7470e) reproduce (this is a W=3D1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/= make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stab= le.git/commit/?id=3D5054a249363156992a4b6a3ab1a0be76feda7bf1 git remote add sashal-stable https://git.kernel.org/pub/scm/linux/k= ernel/git/sashal/linux-stable.git git fetch --no-tags sashal-stable pending-5.4 git checkout 5054a249363156992a4b6a3ab1a0be76feda7bf1 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.cross W=3D= 1 O=3Dbuild_dir ARCH=3Dx86_64 SHELL=3D/bin/bash fs/btrfs/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> fs/btrfs/tree-checker.c:767:46: warning: incompatible integer to pointer= conversion passing 'int' to parameter of type 'const struct btrfs_item *' = [-Wint-conversion] const u32 item_size =3D btrfs_item_size(leaf, slot); ^~~~ fs/btrfs/ctree.h:1731:1: note: passing argument to parameter 's' here BTRFS_SETGET_FUNCS(item_size, struct btrfs_item, size, 32); ^ fs/btrfs/ctree.h:1352:20: note: expanded from macro 'BTRFS_SETGET_FUNCS' const type *s) \ ^ 1 warning generated. vim +767 fs/btrfs/tree-checker.c 762 = 763 static int check_dev_item(struct extent_buffer *leaf, 764 struct btrfs_key *key, int slot) 765 { 766 struct btrfs_dev_item *ditem; > 767 const u32 item_size =3D btrfs_item_size(leaf, slot); 768 = 769 if (key->objectid !=3D BTRFS_DEV_ITEMS_OBJECTID) { 770 dev_item_err(leaf, slot, 771 "invalid objectid: has=3D%llu expect=3D%llu", 772 key->objectid, BTRFS_DEV_ITEMS_OBJECTID); 773 return -EUCLEAN; 774 } 775 = 776 if (unlikely(item_size !=3D sizeof(*ditem))) { 777 dev_item_err(leaf, slot, "invalid item size: has %u expect %zu", 778 item_size, sizeof(*ditem)); 779 return -EUCLEAN; 780 } 781 = 782 ditem =3D btrfs_item_ptr(leaf, slot, struct btrfs_dev_item); 783 if (btrfs_device_id(leaf, ditem) !=3D key->offset) { 784 dev_item_err(leaf, slot, 785 "devid mismatch: key has=3D%llu item has=3D%llu", 786 key->offset, btrfs_device_id(leaf, ditem)); 787 return -EUCLEAN; 788 } 789 = 790 /* 791 * For device total_bytes, we don't have reliable way to check it, = as 792 * it can be 0 for device removal. Device size check can only be do= ne 793 * by dev extents check. 794 */ 795 if (btrfs_device_bytes_used(leaf, ditem) > 796 btrfs_device_total_bytes(leaf, ditem)) { 797 dev_item_err(leaf, slot, 798 "invalid bytes used: have %llu expect [0, %llu]", 799 btrfs_device_bytes_used(leaf, ditem), 800 btrfs_device_total_bytes(leaf, ditem)); 801 return -EUCLEAN; 802 } 803 /* 804 * Remaining members like io_align/type/gen/dev_group aren't really 805 * utilized. Skip them to make later usage of them easier. 806 */ 807 return 0; 808 } 809 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============0928930324306094552==--