[andersson-kernel:wip/for-robert/dsi-panel-fixup 8140/8157] drivers/interconnect/core.c:215:48: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'}

From: kernel test robot
Date: Tue Sep 07 2021 - 05:33:34 EST


tree: https://github.com/andersson/kernel wip/for-robert/dsi-panel-fixup
head: 2c9fc6fc5e7be5c2b042e98045f2b0c763ef3bb9
commit: 74172e61cd79e6306f9c14426098a561258e3d7c [8140/8157] WIP: Debug
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.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/andersson/kernel/commit/74172e61cd79e6306f9c14426098a561258e3d7c
git remote add andersson-kernel https://github.com/andersson/kernel
git fetch --no-tags andersson-kernel wip/for-robert/dsi-panel-fixup
git checkout 74172e61cd79e6306f9c14426098a561258e3d7c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arm

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

drivers/interconnect/core.c: In function 'path_find':
drivers/interconnect/core.c:212:33: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
212 | struct icc_node *tmp = node->links[i];
| ^~~~~~
In file included from include/linux/kernel.h:19,
from include/linux/list.h:9,
from include/linux/wait.h:7,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from include/linux/debugfs.h:15,
from drivers/interconnect/core.c:9:
>> drivers/interconnect/core.c:215:48: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
215 | printk("%s() node=%s [%ld/%ld]\n", __func__, node->name, i, node->num_links);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~ ~
| |
| size_t {aka unsigned int}
include/linux/printk.h:418:25: note: in definition of macro 'printk_index_wrap'
418 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~
drivers/interconnect/core.c:215:41: note: in expansion of macro 'printk'
215 | printk("%s() node=%s [%ld/%ld]\n", __func__, node->name, i, node->num_links);
| ^~~~~~
drivers/interconnect/core.c:215:65: note: format string is defined here
215 | printk("%s() node=%s [%ld/%ld]\n", __func__, node->name, i, node->num_links);
| ~~^
| |
| long int
| %d
In file included from include/linux/kernel.h:19,
from include/linux/list.h:9,
from include/linux/wait.h:7,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from include/linux/debugfs.h:15,
from drivers/interconnect/core.c:9:
drivers/interconnect/core.c:215:48: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
215 | printk("%s() node=%s [%ld/%ld]\n", __func__, node->name, i, node->num_links);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
| |
| size_t {aka unsigned int}
include/linux/printk.h:418:25: note: in definition of macro 'printk_index_wrap'
418 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~
drivers/interconnect/core.c:215:41: note: in expansion of macro 'printk'
215 | printk("%s() node=%s [%ld/%ld]\n", __func__, node->name, i, node->num_links);
| ^~~~~~
drivers/interconnect/core.c:215:69: note: format string is defined here
215 | printk("%s() node=%s [%ld/%ld]\n", __func__, node->name, i, node->num_links);
| ~~^
| |
| long int
| %d


vim +215 drivers/interconnect/core.c

176
177 static struct icc_path *path_find(struct device *dev, struct icc_node *src,
178 struct icc_node *dst)
179 {
180 struct icc_path *path = ERR_PTR(-EPROBE_DEFER);
181 struct icc_node *n, *node = NULL;
182 struct list_head traverse_list;
183 struct list_head edge_list;
184 struct list_head visited_list;
185 size_t i, depth = 1;
186 bool found = false;
187
188 printk("%s() src=%p dst=%p", __func__, src, dst);
189
190 INIT_LIST_HEAD(&traverse_list);
191 INIT_LIST_HEAD(&edge_list);
192 INIT_LIST_HEAD(&visited_list);
193
194 list_add(&src->search_list, &traverse_list);
195 src->reverse = NULL;
196
197 do {
198 list_for_each_entry_safe(node, n, &traverse_list, search_list) {
199 if (!node) {
200 printk("%s() node=%p", __func__, node);
201 }
202 if (node == dst) {
203 found = true;
204 list_splice_init(&edge_list, &visited_list);
205 list_splice_init(&traverse_list, &visited_list);
206 break;
207 }
208 for (i = 0; i < node->num_links; i++) {
209 if (!node) {
210 printk("%s() node=%p", __func__, node);
211 }
212 struct icc_node *tmp = node->links[i];
213
214 if (!tmp) {
> 215 printk("%s() node=%s [%ld/%ld]\n", __func__, node->name, i, node->num_links);
216 path = ERR_PTR(-ENOENT);
217 goto out;
218 }
219
220 if (tmp->is_traversed)
221 continue;
222
223 tmp->is_traversed = true;
224 tmp->reverse = node;
225 list_add_tail(&tmp->search_list, &edge_list);
226 }
227 }
228
229 if (found)
230 break;
231
232 list_splice_init(&traverse_list, &visited_list);
233 list_splice_init(&edge_list, &traverse_list);
234
235 /* count the hops including the source */
236 depth++;
237
238 } while (!list_empty(&traverse_list));
239
240 out:
241
242 /* reset the traversed state */
243 list_for_each_entry_reverse(n, &visited_list, search_list)
244 n->is_traversed = false;
245
246 if (found)
247 path = path_init(dev, dst, depth);
248
249 return path;
250 }
251

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip