From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B01510F3 for ; Wed, 20 Apr 2022 00:51:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650415912; x=1681951912; h=date:from:to:cc:subject:message-id:mime-version; bh=XQ+7AA0/tIqOmGQEOFBUT/yZ2tkfE6PI9DR65t0c9Eo=; b=QVKANinGP/TXyg9wOQP3RZPoQK76Mtilv9oZFGy3rDIa72s6zTXlt2Fk MH0JUg3nn4KDtbTX4T1zTNHjF6P+1Lb1K425OUVbVo02c9kVWVfbSTznq NBfhcyLztaMVz17+mEUl2348q+EsIFEN1IIfjDabiQ+A6DygaJ/pbIYja uBnRkuTsoJfnqiCa2PzViDqh/vNE0bqDhaoj58Xzl0S41nQ+cWKHQa3pR d+DDCDaYVvj1k9U7wQBoX9v9T1bIb2swZHvFBM3aZLOQzX0cRxJHBqI3P Rw4gO87Frh/RSC2SK54/39llzAscWWfliDrzZwvY+dIXsBNtKIYdd2GyE w==; X-IronPort-AV: E=McAfee;i="6400,9594,10322"; a="350356211" X-IronPort-AV: E=Sophos;i="5.90,274,1643702400"; d="scan'208";a="350356211" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2022 17:51:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,274,1643702400"; d="scan'208";a="862448768" Received: from lkp-server01.sh.intel.com (HELO 3abc53900bec) ([10.239.97.150]) by fmsmga005.fm.intel.com with ESMTP; 19 Apr 2022 17:51:49 -0700 Received: from kbuild by 3abc53900bec with local (Exim 4.95) (envelope-from ) id 1ngyZR-0006Nc-7d; Wed, 20 Apr 2022 00:51:49 +0000 Date: Wed, 20 Apr 2022 08:51:28 +0800 From: kernel test robot To: Bart Van Assche Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org, linux-kernel@vger.kernel.org Subject: [bvanassche:scsi-gap-zone 10/10] drivers/scsi/scsi_debug.c:5101:5: warning: format specifies type 'unsigned int' but the argument has type 'sector_t' (aka 'unsigned long long') Message-ID: <202204200815.OaESmWOl-lkp@intel.com> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) tree: https://github.com/bvanassche/linux scsi-gap-zone head: 8a37a38282a57095a4a3ff6e6c68f2481234ad10 commit: 8a37a38282a57095a4a3ff6e6c68f2481234ad10 [10/10] scsi-debug-dbg config: arm-randconfig-r025-20220419 (https://download.01.org/0day-ci/archive/20220420/202204200815.OaESmWOl-lkp@intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c1c49a356162b22554088d269f7689bdb044a9f1) 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 arm cross compiling tool for clang build # apt-get install binutils-arm-linux-gnueabi # https://github.com/bvanassche/linux/commit/8a37a38282a57095a4a3ff6e6c68f2481234ad10 git remote add bvanassche https://github.com/bvanassche/linux git fetch --no-tags bvanassche scsi-gap-zone git checkout 8a37a38282a57095a4a3ff6e6c68f2481234ad10 # 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=arm SHELL=/bin/bash drivers/scsi/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/scsi/scsi_debug.c:5101:5: warning: format specifies type 'unsigned int' but the argument has type 'sector_t' (aka 'unsigned long long') [-Wformat] zsp->z_start, zsp->z_size); ^~~~~~~~~~~~ include/linux/printk.h:519:34: note: expanded from macro 'pr_info' printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) ~~~ ^~~~~~~~~~~ include/linux/printk.h:446:60: note: expanded from macro 'printk' #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__) ~~~ ^~~~~~~~~~~ include/linux/printk.h:418:19: note: expanded from macro 'printk_index_wrap' _p_func(_fmt, ##__VA_ARGS__); \ ~~~~ ^~~~~~~~~~~ 1 warning generated. vim +5101 drivers/scsi/scsi_debug.c 4995 4996 static int sdebug_device_create_zones(struct sdebug_dev_info *devip) 4997 { 4998 struct sdeb_zone_state *zsp; 4999 sector_t capacity = get_sdebug_capacity(); 5000 sector_t conv_capacity; 5001 sector_t zstart = 0; 5002 unsigned int i; 5003 5004 /* 5005 * Set the zone size: if sdeb_zbc_zone_size_mb is not set, figure out 5006 * a zone size allowing for at least 4 zones on the device. Otherwise, 5007 * use the specified zone size checking that at least 2 zones can be 5008 * created for the device. 5009 */ 5010 if (!sdeb_zbc_zone_size_mb) { 5011 devip->zsize = (DEF_ZBC_ZONE_SIZE_MB * SZ_1M) 5012 >> ilog2(sdebug_sector_size); 5013 while (capacity < devip->zsize << 2 && devip->zsize >= 2) 5014 devip->zsize >>= 1; 5015 if (devip->zsize < 2) { 5016 pr_err("Device capacity too small\n"); 5017 return -EINVAL; 5018 } 5019 } else { 5020 if (!is_power_of_2(sdeb_zbc_zone_size_mb)) { 5021 pr_err("Zone size is not a power of 2\n"); 5022 return -EINVAL; 5023 } 5024 devip->zsize = (sdeb_zbc_zone_size_mb * SZ_1M) 5025 >> ilog2(sdebug_sector_size); 5026 if (devip->zsize >= capacity) { 5027 pr_err("Zone size too large for device capacity\n"); 5028 return -EINVAL; 5029 } 5030 } 5031 5032 devip->zsize_shift = ilog2(devip->zsize); 5033 devip->nr_zones = (capacity + devip->zsize - 1) >> devip->zsize_shift; 5034 5035 if (sdeb_zbc_zone_cap_mb == 0) { 5036 devip->zcap = devip->zsize; 5037 } else { 5038 devip->zcap = (sdeb_zbc_zone_cap_mb * SZ_1M) >> 5039 ilog2(sdebug_sector_size); 5040 if (devip->zcap > devip->zsize) { 5041 pr_err("Zone capacity too large\n"); 5042 return -EINVAL; 5043 } 5044 } 5045 5046 conv_capacity = (sector_t)sdeb_zbc_nr_conv << devip->zsize_shift; 5047 if (conv_capacity >= capacity) { 5048 pr_err("Number of conventional zones too large\n"); 5049 return -EINVAL; 5050 } 5051 devip->nr_conv_zones = sdeb_zbc_nr_conv; 5052 devip->nr_seq_zones = ALIGN(capacity - conv_capacity, devip->zsize) >> 5053 devip->zsize_shift; 5054 devip->nr_zones = devip->nr_conv_zones + devip->nr_seq_zones; 5055 5056 /* Add gap zones if zone capacity is smaller than the zone size */ 5057 pr_info("zcap = %u; zsize = %u\n", devip->zcap, devip->zsize); 5058 if (devip->zcap < devip->zsize) 5059 devip->nr_zones += devip->nr_seq_zones; 5060 5061 if (devip->zmodel == BLK_ZONED_HM) { 5062 /* zbc_max_open_zones can be 0, meaning "not reported" */ 5063 if (sdeb_zbc_max_open >= devip->nr_zones - 1) 5064 devip->max_open = (devip->nr_zones - 1) / 2; 5065 else 5066 devip->max_open = sdeb_zbc_max_open; 5067 } 5068 5069 devip->zstate = kcalloc(devip->nr_zones, 5070 sizeof(struct sdeb_zone_state), GFP_KERNEL); 5071 if (!devip->zstate) 5072 return -ENOMEM; 5073 5074 for (i = 0; i < devip->nr_zones; i++) { 5075 zsp = &devip->zstate[i]; 5076 5077 zsp->z_start = zstart; 5078 5079 if (i < devip->nr_conv_zones) { 5080 zsp->z_type = ZBC_ZTYPE_CNV; 5081 zsp->z_cond = ZBC_NOT_WRITE_POINTER; 5082 zsp->z_wp = (sector_t)-1; 5083 zsp->z_size = 5084 min_t(u64, devip->zsize, capacity - zstart); 5085 } else if ((zstart & (devip->zsize - 1)) == 0) { 5086 if (devip->zmodel == BLK_ZONED_HM) 5087 zsp->z_type = ZBC_ZTYPE_SWR; 5088 else 5089 zsp->z_type = ZBC_ZTYPE_SWP; 5090 zsp->z_cond = ZC1_EMPTY; 5091 zsp->z_wp = zsp->z_start; 5092 zsp->z_size = 5093 min_t(u64, devip->zcap, capacity - zstart); 5094 } else { 5095 zsp->z_type = ZBC_ZTYPE_GAP; 5096 zsp->z_cond = ZBC_NOT_WRITE_POINTER; 5097 zsp->z_wp = (sector_t)-1; 5098 zsp->z_size = min_t(u64, devip->zsize - devip->zcap, 5099 capacity - zstart); 5100 pr_info("adding a gap zone; start %u; size %u\n", > 5101 zsp->z_start, zsp->z_size); 5102 } 5103 5104 WARN_ON_ONCE((int)zsp->z_size <= 0); 5105 zstart += zsp->z_size; 5106 } 5107 5108 return 0; 5109 } 5110 -- 0-DAY CI Kernel Test Service https://01.org/lkp