Re: [PATCH 1/1] drivers: misc: add driver for bootstage stash
kernel test robot <[email protected]> Sat, 24 May 2025 15:18:00 +0800
| Newsgroups | org.kernel.vger.linux-embedded,dev.linux.lists.llvm,dev.linux.lists.oe-kbuild-all |
|---|---|
| Message-ID | <[email protected]> |
Hi Francesco, kernel test robot noticed the following build warnings: [auto build test WARNING on char-misc/char-misc-linus] [also build test WARNING on robh/for-next linus/master v6.15-rc7] [cannot apply to char-misc/char-misc-testing char-misc/char-misc-next next-20250523] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Francesco-Valla/drivers-misc-add-driver-for-bootstage-stash/20250523-122757 base: char-misc/char-misc-linus patch link: https://lore.kernel.org/r/20250522224223.358881-3-francesco%40valla.it patch subject: [PATCH 1/1] drivers: misc: add driver for bootstage stash config: hexagon-allyesconfig (https://download.01.org/0day-ci/archive/20250524/[email protected]/config) compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250524/[email protected]/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <[email protected]> | Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ All warnings (new ones prefixed by >>): >> drivers/misc/bootstage.c:164:24: warning: format specifies type 'unsigned long long' but the argument has type 'resource_size_t' (aka 'unsigned int') [-Wformat] 163 | dev_err(dev, "invalid declared stash size %u (expected: <= %llu)\n", | ~~~~ | %u 164 | drvdata->hdr->size, size); | ^~~~ include/linux/dev_printk.h:154:65: note: expanded from macro 'dev_err' 154 | dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__) | ~~~ ^~~~~~~~~~~ include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap' 110 | _p_func(dev, fmt, ##__VA_ARGS__); \ | ~~~ ^~~~~~~~~~~ drivers/misc/bootstage.c:168:4: warning: format specifies type 'unsigned long long' but the argument has type 'resource_size_t' (aka 'unsigned int') [-Wformat] 167 | dev_err(dev, "invalid calculated stash size %llu (expected: <= %llu)\n", | ~~~~ | %u 168 | calc_size, size); | ^~~~~~~~~ include/linux/dev_printk.h:154:65: note: expanded from macro 'dev_err' 154 | dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__) | ~~~ ^~~~~~~~~~~ include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap' 110 | _p_func(dev, fmt, ##__VA_ARGS__); \ | ~~~ ^~~~~~~~~~~ drivers/misc/bootstage.c:168:15: warning: format specifies type 'unsigned long long' but the argument has type 'resource_size_t' (aka 'unsigned int') [-Wformat] 167 | dev_err(dev, "invalid calculated stash size %llu (expected: <= %llu)\n", | ~~~~ | %u 168 | calc_size, size); | ^~~~ include/linux/dev_printk.h:154:65: note: expanded from macro 'dev_err' 154 | dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__) | ~~~ ^~~~~~~~~~~ include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap' 110 | _p_func(dev, fmt, ##__VA_ARGS__); \ | ~~~ ^~~~~~~~~~~ 3 warnings generated. vim +164 drivers/misc/bootstage.c 143 144 static int bootstage_parse(struct device *dev, struct bootstage_drvdata *drvdata, 145 resource_size_t size) 146 { 147 const char *str_ptr = (const char *)(drvdata->records + drvdata->hdr->count); 148 const resource_size_t calc_size = (resource_size_t)((void *)str_ptr - (void *)drvdata->hdr); 149 struct bootstage_record *rec; 150 u32 r; 151 152 // Sanity checks on bootstage header 153 if (drvdata->hdr->magic != BOOTSTAGE_MAGIC) { 154 dev_err(dev, "wrong bootstage magic number %08Xh\n", drvdata->hdr->magic); 155 return -EINVAL; 156 } else if (drvdata->hdr->version > BOOTSTAGE_MAX_VERSION) { 157 dev_err(dev, "bootstage version %u not supported\n", drvdata->hdr->version); 158 return -EOPNOTSUPP; 159 } else if (drvdata->hdr->size == 0) { 160 dev_err(dev, "invalid bootstage stash (declared size is zero)\n"); 161 return -EINVAL; 162 } else if (drvdata->hdr->size > size) { 163 dev_err(dev, "invalid declared stash size %u (expected: <= %llu)\n", > 164 drvdata->hdr->size, size); 165 return -EINVAL; 166 } else if (calc_size > size) { 167 dev_err(dev, "invalid calculated stash size %llu (expected: <= %llu)\n", 168 calc_size, size); 169 return -EINVAL; 170 } else if (drvdata->hdr->count == 0) { 171 dev_info(dev, "bootstage stash has no records\n"); 172 return 0; 173 } 174 175 // Set start time to invalid 176 drvdata->start_time_us = 0xFFFFFFFF; 177 178 // Associate names to records, which are placed at the end of the record area 179 for (r = 0, rec = drvdata->records; r < drvdata->hdr->count; r++, rec++) { 180 // Save minimum time, will be used as bootloader enter time 181 if (rec->start_us < drvdata->start_time_us) 182 drvdata->start_time_us = rec->time_us; 183 184 // Save maximum time, will be used as bootloader exit time 185 if (rec->time_us > drvdata->end_time_us) 186 drvdata->end_time_us = rec->time_us; 187 188 if (str_ptr > ((const char *)drvdata->hdr + size)) { 189 dev_err(dev, "name for record %u is corrupted\n", r); 190 return -ENODATA; 191 } 192 193 rec->name = str_ptr; 194 str_ptr += strlen(rec->name) + 1; 195 } 196 197 return 0; 198 } 199 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki